Skip to content

Units error with metpy.calc and AWS HRRR zarr data #2333

Answered by dcamron
wxwizard asked this question in Q&A
Discussion options

You must be logged in to vote

You need to pull out the individual temperature xarray.DataArray from the temp xarray.Dataset you've created. A Dataset is basically a collection of potentially multiple DataArrays, and you can access individual DataArrays within through dictionary or attribute-style notations. E.g.,

theta_e = mpcalc.equivalent_potential_temperature(pres, temp["TMP"], dpt)
# or
thera_e = mpcalc.equivalent_potential_temperature(pres, temp.TMP, dpt)

or you can assign this DataArray to a new variable, if preferred. Using quantify here did work (and can also work on individual DataArrays) to add units, but you still have to select the specific DataArray you want to use.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@wxwizard
Comment options

Answer selected by dcamron
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants