I am PhD student from the University of Balearic Islands (Spain) and I am using the module wrf-python to depict a wide range of wrf fields. I am performing EnKF data assimilation experiments, with the help of Louis Wicker (Oklahoma, NSSL), which requires an ensemble of simulations.
where the wrf_dict_SYN_d02 is a dictionary where I defined the path of all ensemble members. When I am trying to compute slp, I do not have any problem and everything works correctly. However, when I am trying to compute the 'updraft helicity' I obtain the following error:
TypeError Traceback (most recent call last)
<ipython-input-24-aea088113e37> in <module>()
----> 1 kk=getvar(wrflist, "updraft_helicity", timeidx=ALL_TIMES)
/opt/anaconda/anaconda2/lib/python2.7/site-packages/wrf/routines.pyc in getvar(wrfin, varname, timeidx, method, squeeze, cache, meta, **kwargs)
283
284 return _FUNC_MAP[actual_var](wrfin, timeidx, method, squeeze, cache,
--> 285 meta, _key, **kwargs)
286
/opt/anaconda/anaconda2/lib/python2.7/site-packages/wrf/metadecorators.pyc in func_wrapper(wrapped, instance, args, kwargs)
127 new_args[cache_argloc] = new_cache
128
--> 129 result = wrapped(*new_args)
130
131 outname = ""
/opt/anaconda/anaconda2/lib/python2.7/site-packages/wrf/helicity.pyc in get_uh(wrfin, timeidx, method, squeeze, cache, meta, _key, bottom, top)
177
178 ncvars = extract_vars(wrfin, timeidx, ("W", "PH", "PHB", "MAPFAC_M"),
--> 179 method, squeeze, cache, meta=False, _key=None)
180
181 wstag = ncvars["W"]
/opt/anaconda/anaconda2/lib/python2.7/site-packages/wrf/util.pyc in extract_vars(wrfin, timeidx, varnames, method, squeeze, cache, meta, _key)
2178 return {var:_extract_var(wrfin, var, timeidx, None,
2179 method, squeeze, cache, meta, _key)
-> 2180 for var in varlist}
2181
2182
/opt/anaconda/anaconda2/lib/python2.7/site-packages/wrf/util.pyc in <dictcomp>((var,))
2178 return {var:_extract_var(wrfin, var, timeidx, None,
2179 method, squeeze, cache, meta, _key)
-> 2180 for var in varlist}
2181
2182
/opt/anaconda/anaconda2/lib/python2.7/site-packages/wrf/util.pyc in _extract_var(wrfin, varname, timeidx, is_moving, method, squeeze, cache, meta, _key)
2111 # Squeeze handled in this routine, so just return it
2112 return combine_files(wrfin, varname, timeidx, is_moving,
-> 2113 method, squeeze, meta, _key)
2114
2115 return result.squeeze() if squeeze else result
/opt/anaconda/anaconda2/lib/python2.7/site-packages/wrf/util.pyc in combine_files(wrfin, varname, timeidx, is_moving, method, squeeze, meta, _key)
2010 # Dictionary is unique
2011 if is_mapping(wrfseq):
-> 2012 outarr = _combine_dict(wrfseq, varname, timeidx, method, meta, _key)
2013 elif method.lower() == "cat":
2014 outarr = _cat_files(wrfseq, varname, timeidx, is_moving,
/opt/anaconda/anaconda2/lib/python2.7/site-packages/wrf/util.pyc in _combine_dict(wrfdict, varname, timeidx, method, meta, _key)
944 timeidx, is_moving=is_moving, method=method,
945 squeeze=False, cache=None, meta=meta,
--> 946 _key=_key[first_key])
947
948 # Create the output data numpy array based on the first array
TypeError: 'NoneType' object has no attribute '__getitem__'
I do not know why the updraft helicity is giving this error and the slp, geopotential or wind fields do not.
I would like to know if you could help me to fix this problem or if you know any other python function that calculates the updraft helicity for an ensemble of members.