Browse Source

Fixed typos.

Adjusted metadata for individual products to reflect single product.
lon0
Bill Ladwig 6 years ago
parent
commit
c7e3944832
  1. 48
      src/wrf/g_cape.py
  2. 21
      src/wrf/g_cloudfrac.py
  3. 27
      src/wrf/g_uvmet.py
  4. 28
      src/wrf/g_wind.py
  5. 8
      src/wrf/routines.py

48
src/wrf/g_cape.py

@ -227,40 +227,76 @@ def get_3dcape(wrfin, timeidx=0, method="cat",
def get_cape2d_only(wrfin, timeidx=0, method="cat", squeeze=True, cache=None, def get_cape2d_only(wrfin, timeidx=0, method="cat", squeeze=True, cache=None,
meta=True, _key=None, missing=default_fill(np.float64)): meta=True, _key=None, missing=default_fill(np.float64)):
return get_2dcape(wrfin, timeidx, method, squeeze, cache, result = get_2dcape(wrfin, timeidx, method, squeeze, cache,
meta, _key, missing)[0,:] meta, _key, missing)[0,:]
if meta:
result.attrs["description"] = "mcape"
result.attrs["units"] = "J kg-1"
return result
def get_cin2d_only(wrfin, timeidx=0, method="cat", squeeze=True, cache=None, def get_cin2d_only(wrfin, timeidx=0, method="cat", squeeze=True, cache=None,
meta=True, _key=None, missing=default_fill(np.float64)): meta=True, _key=None, missing=default_fill(np.float64)):
return get_2dcape(wrfin, timeidx, method, squeeze, cache, result = get_2dcape(wrfin, timeidx, method, squeeze, cache,
meta, _key, missing)[1,:] meta, _key, missing)[1,:]
if meta:
result.attrs["description"] = "mcin"
result.attrs["units"] = "J kg-1"
return result
def get_lcl(wrfin, timeidx=0, method="cat", squeeze=True, cache=None, def get_lcl(wrfin, timeidx=0, method="cat", squeeze=True, cache=None,
meta=True, _key=None, missing=default_fill(np.float64)): meta=True, _key=None, missing=default_fill(np.float64)):
return get_2dcape(wrfin, timeidx, method, squeeze, cache, result = get_2dcape(wrfin, timeidx, method, squeeze, cache,
meta, _key, missing)[2,:] meta, _key, missing)[2,:]
if meta:
result.attrs["description"] = "lcl"
result.attrs["units"] = "m"
return result
def get_lfc(wrfin, timeidx=0, method="cat", squeeze=True, cache=None, def get_lfc(wrfin, timeidx=0, method="cat", squeeze=True, cache=None,
meta=True, _key=None, missing=default_fill(np.float64)): meta=True, _key=None, missing=default_fill(np.float64)):
return get_2dcape(wrfin, timeidx, method, squeeze, cache, result = get_2dcape(wrfin, timeidx, method, squeeze, cache,
meta, _key, missing)[3,:] meta, _key, missing)[3,:]
if meta:
result.attrs["description"] = "lfc"
result.attrs["units"] = "m"
return result
def get_3dcape_only(wrfin, timeidx=0, method="cat", def get_3dcape_only(wrfin, timeidx=0, method="cat",
squeeze=True, cache=None, meta=True, squeeze=True, cache=None, meta=True,
_key=None, missing=default_fill(np.float64)): _key=None, missing=default_fill(np.float64)):
return get_3dcape(wrfin, timeidx, method, squeeze, cache, meta, result = get_3dcape(wrfin, timeidx, method, squeeze, cache, meta,
_key, missing)[0,:] _key, missing)[0,:]
if meta:
result.attrs["description"] = "cape"
result.attrs["units"] = "J kg-1"
return result
def get_3dcin_only(wrfin, timeidx=0, method="cat", def get_3dcin_only(wrfin, timeidx=0, method="cat",
squeeze=True, cache=None, meta=True, squeeze=True, cache=None, meta=True,
_key=None, missing=default_fill(np.float64)): _key=None, missing=default_fill(np.float64)):
return get_3dcape(wrfin, timeidx, method, squeeze, cache, meta, result = get_3dcape(wrfin, timeidx, method, squeeze, cache, meta,
_key, missing)[1,:] _key, missing)[1,:]
if meta:
result.attrs["description"] = "cin"
result.attrs["units"] = "J kg-1"
return result

21
src/wrf/g_cloudfrac.py

@ -166,27 +166,42 @@ def get_low_cloudfrac(wrfin, timeidx=0, method="cat", squeeze=True,
cache=None, meta=True, _key=None, cache=None, meta=True, _key=None,
vert_type="height_agl", low_thresh=None, mid_thresh=None, vert_type="height_agl", low_thresh=None, mid_thresh=None,
high_thresh=None, missing=default_fill(np.float64)): high_thresh=None, missing=default_fill(np.float64)):
return get_cloudfrac(wrfin, timeidx, method, squeeze, result = get_cloudfrac(wrfin, timeidx, method, squeeze,
cache, meta, _key, cache, meta, _key,
vert_type, low_thresh, mid_thresh, vert_type, low_thresh, mid_thresh,
high_thresh, missing)[0,:] high_thresh, missing)[0,:]
if meta:
result.attrs["description"] = "low clouds"
return result
def get_mid_cloudfrac(wrfin, timeidx=0, method="cat", squeeze=True, def get_mid_cloudfrac(wrfin, timeidx=0, method="cat", squeeze=True,
cache=None, meta=True, _key=None, cache=None, meta=True, _key=None,
vert_type="height_agl", low_thresh=None, mid_thresh=None, vert_type="height_agl", low_thresh=None, mid_thresh=None,
high_thresh=None, missing=default_fill(np.float64)): high_thresh=None, missing=default_fill(np.float64)):
return get_cloudfrac(wrfin, timeidx, method, squeeze, result = get_cloudfrac(wrfin, timeidx, method, squeeze,
cache, meta, _key, cache, meta, _key,
vert_type, low_thresh, mid_thresh, vert_type, low_thresh, mid_thresh,
high_thresh, missing)[1,:] high_thresh, missing)[1,:]
if meta:
result.attrs["description"] = "mid clouds"
return result
def get_high_cloudfrac(wrfin, timeidx=0, method="cat", squeeze=True, def get_high_cloudfrac(wrfin, timeidx=0, method="cat", squeeze=True,
cache=None, meta=True, _key=None, cache=None, meta=True, _key=None,
vert_type="height_agl", low_thresh=None, mid_thresh=None, vert_type="height_agl", low_thresh=None, mid_thresh=None,
high_thresh=None, missing=default_fill(np.float64)): high_thresh=None, missing=default_fill(np.float64)):
return get_cloudfrac(wrfin, timeidx, method, squeeze, result = get_cloudfrac(wrfin, timeidx, method, squeeze,
cache, meta, _key, cache, meta, _key,
vert_type, low_thresh, mid_thresh, vert_type, low_thresh, mid_thresh,
high_thresh, missing)[2,:] high_thresh, missing)[2,:]
if meta:
result.attrs["description"] = "high clouds"
return result

27
src/wrf/g_uvmet.py

@ -523,29 +523,48 @@ def get_uvmet10_wspd_wdir(wrfin, timeidx=0, method="cat", squeeze=True,
def get_uvmet_wspd(wrfin, timeidx=0, method="cat", squeeze=True, def get_uvmet_wspd(wrfin, timeidx=0, method="cat", squeeze=True,
cache=None, meta=True, _key=None, cache=None, meta=True, _key=None,
units="m s-1"): units="m s-1"):
return get_uvmet_wspd_wdir(wrfin, timeidx, method, squeeze, result = get_uvmet_wspd_wdir(wrfin, timeidx, method, squeeze,
cache, meta, _key, units)[0,:] cache, meta, _key, units)[0,:]
if meta:
result.attrs["description"] = "earth rotated wspd"
return result
def get_uvmet_wdir(wrfin, timeidx=0, method="cat", squeeze=True, def get_uvmet_wdir(wrfin, timeidx=0, method="cat", squeeze=True,
cache=None, meta=True, _key=None, cache=None, meta=True, _key=None,
units="m s-1"): units="m s-1"):
return get_uvmet_wspd_wdir(wrfin, timeidx, method, squeeze, result = get_uvmet_wspd_wdir(wrfin, timeidx, method, squeeze,
cache, meta, _key, units)[1,:] cache, meta, _key, units)[1,:]
if meta:
result.attrs["description"] = "earth rotated wdir"
return result
def get_uvmet10_wspd(wrfin, timeidx=0, method="cat", squeeze=True, def get_uvmet10_wspd(wrfin, timeidx=0, method="cat", squeeze=True,
cache=None, meta=True, _key=None, cache=None, meta=True, _key=None,
units="m s-1"): units="m s-1"):
return get_uvmet10_wspd_wdir(wrfin, timeidx, method, squeeze, result = get_uvmet10_wspd_wdir(wrfin, timeidx, method, squeeze,
cache, meta, _key, units)[0,:] cache, meta, _key, units)[0,:]
if meta:
result.attrs["description"] = "10m earth rotated wspd"
return result
def get_uvmet10_wdir(wrfin, timeidx=0, method="cat", squeeze=True, def get_uvmet10_wdir(wrfin, timeidx=0, method="cat", squeeze=True,
cache=None, meta=True, _key=None, cache=None, meta=True, _key=None,
units="m s-1"): units="m s-1"):
return get_uvmet10_wspd_wdir(wrfin, timeidx, method, squeeze, result = get_uvmet10_wspd_wdir(wrfin, timeidx, method, squeeze,
cache, meta, _key, units)[1,:] cache, meta, _key, units)[1,:]
if meta:
result.attrs["description"] = "10m earth rotated wdir"
return result

28
src/wrf/g_wind.py

@ -511,26 +511,46 @@ def get_destag_wspd_wdir10(wrfin, timeidx=0, method="cat",
def get_destag_wspd(wrfin, timeidx=0, method="cat", def get_destag_wspd(wrfin, timeidx=0, method="cat",
squeeze=True, cache=None, meta=True, _key=None, squeeze=True, cache=None, meta=True, _key=None,
units="m s-1"): units="m s-1"):
return get_destag_wspd_wdir(wrfin, timeidx, method, squeeze, cache, result = get_destag_wspd_wdir(wrfin, timeidx, method, squeeze, cache,
meta, _key, units)[0,:] meta, _key, units)[0,:]
if meta:
result.attrs["description"] = "wspd in projection space"
return result
def get_destag_wdir(wrfin, timeidx=0, method="cat", def get_destag_wdir(wrfin, timeidx=0, method="cat",
squeeze=True, cache=None, meta=True, _key=None, squeeze=True, cache=None, meta=True, _key=None,
units="m s-1"): units="m s-1"):
return get_destag_wspd_wdir(wrfin, timeidx, method, squeeze, cache, result = get_destag_wspd_wdir(wrfin, timeidx, method, squeeze, cache,
meta, _key, units)[1,:] meta, _key, units)[1,:]
if meta:
result.attrs["description"] = "wdir in projection space"
return result
def get_destag_wspd10(wrfin, timeidx=0, method="cat", def get_destag_wspd10(wrfin, timeidx=0, method="cat",
squeeze=True, cache=None, meta=True, _key=None, squeeze=True, cache=None, meta=True, _key=None,
units="m s-1"): units="m s-1"):
return get_destag_wspd_wdir10(wrfin, timeidx, method, result = get_destag_wspd_wdir10(wrfin, timeidx, method,
squeeze, cache, meta, _key, units)[0,:] squeeze, cache, meta, _key, units)[0,:]
if meta:
result.attrs["description"] = "10m wspd in projection space"
return result
def get_destag_wdir10(wrfin, timeidx=0, method="cat", def get_destag_wdir10(wrfin, timeidx=0, method="cat",
squeeze=True, cache=None, meta=True, _key=None, squeeze=True, cache=None, meta=True, _key=None,
units="m s-1"): units="m s-1"):
return get_destag_wspd_wdir10(wrfin, timeidx, method, result = get_destag_wspd_wdir10(wrfin, timeidx, method,
squeeze, cache, meta, _key, units)[1,:] squeeze, cache, meta, _key, units)[1,:]
if meta:
result.attrs["description"] = "10m wdir in projection space"
return result

8
src/wrf/routines.py

@ -92,9 +92,9 @@ _FUNC_MAP = {"cape2d" : get_2dcape,
"wdir" : get_destag_wdir, "wdir" : get_destag_wdir,
"wspd10" : get_destag_wspd10, "wspd10" : get_destag_wspd10,
"wdir10" : get_destag_wdir10, "wdir10" : get_destag_wdir10,
"low_cfrac" : get_low_cloudfrac, "low_cloudfrac" : get_low_cloudfrac,
"mid_cfrac" : get_mid_cloudfrac, "mid_cloudfrac" : get_mid_cloudfrac,
"high_cfrac" : get_high_cloudfrac "high_cloudfrac" : get_high_cloudfrac
} }
_VALID_KARGS = {"cape2d" : ["missing"], _VALID_KARGS = {"cape2d" : ["missing"],
@ -187,7 +187,7 @@ _ALIASES = {"cape_2d" : "cape2d",
"th" : "theta", "th" : "theta",
"low_cfrac" : "low_cloudfrac", "low_cfrac" : "low_cloudfrac",
"mid_cfrac" : "mid_cloudfrac", "mid_cfrac" : "mid_cloudfrac",
"migh_cfrac" : "high_cloudfrac", "high_cfrac" : "high_cloudfrac",
"wspd_uvmet" : "uvmet_wspd" , "wspd_uvmet" : "uvmet_wspd" ,
"wdir_uvmet" : "uvmet_wdir" , "wdir_uvmet" : "uvmet_wdir" ,
"wspd_uvmet10" : "uvmet10_wspd" , "wspd_uvmet10" : "uvmet10_wspd" ,

Loading…
Cancel
Save