Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variables mcape and mcin doesn´t work #194

Closed
fedecutraro opened this issue Oct 22, 2022 · 1 comment · Fixed by #195
Closed

Variables mcape and mcin doesn´t work #194

fedecutraro opened this issue Oct 22, 2022 · 1 comment · Fixed by #195

Comments

@fedecutraro
Copy link
Contributor

Documentation says that calling the function getvar with the variables 'mcape' and 'mcin' retrieve only those variables of cape_2d variable but I receive the following error

from wrf import getvar
from netCDF4 import Dataset
nc = Dataset('wrfout_d01_2015-12-24_03:00:00')
mcape = getvar(nc, 'mcape')
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In [4], line 1
----> 1 mcape = getvar(nc, 'mcape')

File ~/miniconda3/envs/wrf_python_build/lib/python3.10/site-packages/wrf/routines.py:350, in getvar(wrfin, varname, timeidx, method, squeeze, cache, meta, **kwargs)
    348 actual_var = _undo_alias(varname)
    349 if actual_var not in _VALID_KARGS:
--> 350     raise ValueError("'{}' is not a valid variable name".format(varname))
    352 _check_kargs(actual_var, kwargs)
    354 return _FUNC_MAP[actual_var](wrfin, timeidx, method, squeeze, cache,
    355                              meta, _key, **kwargs)

ValueError: 'mcape' is not a valid variable name
@erogluorhan
Copy link
Collaborator

erogluorhan commented Nov 28, 2022

Hi @fedecutraro , thanks very much for your contribution! I will look at the corresponding PR #195 soon.

@erogluorhan erogluorhan linked a pull request Nov 28, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants