Closed irowebbn closed 4 years ago
I misread the documentation. The function returns a dict, which contains one or more variables as keys, and the corresponding arrays as values. You have to index into the dict in order to get the xarray DataArray. I was confused because I was only extracting 1 variable and therefore my dict only had one entry.
In the documentation for
wrf.extract_vars
, the details on return say the following:It also says the return type is
dict
, which confuses me because the previous paragraph just said it would be a xarray or numpy array.I have xarray enabled and
meta
set toTrue
, but the return I am getting is not axarray.DataArray
object, just adict
. The dict is not in the correct form to construct a xarray.DataArray using the__init__
orfrom_dict()
functions.How can I get a xarray DataArray returned from the extract_vars function? If I am misunderstanding how this works please correct me.