-
Notifications
You must be signed in to change notification settings - Fork 16
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
[Bug]: ValueError when using MetPy to calculate geostrophic winds #120
Comments
Hi @starforge, thanks for raising this issue. We definitely want to support interoperability with I tried reproducing your issue, however unfortunately I did not manage to do so. With my own xarray.DataArray 'geopotential_height' (Time: 169, z_stag: 42, y: 170, x: 155)>
[...]
Coordinates:
XLAT (y, x) float32 38.8 38.82 38.84 38.86 ... 60.74 60.7 60.66 60.63
XLONG (y, x) float32 -3.86 -3.693 -3.525 -3.357 ... 30.41 30.67 30.93
XTIME (Time) timedelta64[ns] 00:00:00 01:00:00 ... 7 days 00:00:00
* z_stag (z_stag) float32 1.0 0.9981 0.9957 0.9926 ... 0.01458 0.006846 0.0
* Time (Time) datetime64[ns] 2020-04-01 2020-04-01T01:00:00 ... 2020-04-08
* y (y) float64 -1.267e+06 -1.252e+06 ... 1.253e+06 1.268e+06
* x (x) float64 -1.086e+06 -1.071e+06 ... 1.209e+06 1.224e+06
Attributes:
units: m
standard_name: geopotential_height
stagger: Z
grid_mapping: wrf_projection |
Hi @lpilz , Thanks very much for your reply! Here's what
(Sorry, I couldn't figure out how to format it properly.) I notice that my z array has a coordinate called CLAT, which yours does not have. |
Hi @starforge, PS: you can format code into a block by using triple ticks (```) before and after the relevant section. |
Closing because stale |
Can this issue be reopened? I am trying to use xWRF to open a CONUS404 NetCDF file and compute some variables using MetPy. I use the same code snippet as in the original post and receive the same warning. However, the traceback information is different. I have tried a number of things to fix this issue, including using wrf-python with NetCDF4 instead of xWRF, passing dx/dy/lat arrays to the mpcalc function, etc., amongst other things. I am at a loss for opening CONUS404 (ideally as an xarray for functionality with some additional calculations) and using MetPy to calculate geostrophic wind, inertial advective wind, etc. Would prefer to use this functionality rather than having to start over and compute everything from scratch. Thank you!! Code:
Log:
Here is the result from printing z. Again, nothing obviously unusual:
|
It works with my data. Moving this to discussions (#152) until we figure out whether there is a problem with |
So perhaps this is an issue with the CONUS404 WRF data and not the
xwrf/metpy interface in general? Just trying to figure out how to work with
this data...
…On Thu, Dec 7, 2023, 1:48 AM Lukas Pilz ***@***.***> wrote:
It works with my data. Moving this to discussions until we figure out
whether there is a problem with xwrf. If we do, I'm more than happy to
reopen.
—
Reply to this email directly, view it on GitHub
<#120 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGJ6SGGY333JCRLYIIULMCLYIGGFDAVCNFSM6AAAAAASSZ66C2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBVGAYTSNRTGU>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
What happened?
I'm trying to use the MetPy function mpcalc.geostrophic_wind() to calculate geostrophic winds from a wrfout file.
I'm getting "ValueError: Must provide dx/dy arguments or input DataArray with latitude/longitude coordinates", along with a warning, "warnings.warn('More than one ' + axis + ' coordinate present for variable'".
I don't know what's causing the problem.
Minimal Complete Verifiable Example
Relevant log output
Environment
Anything else we need to know?
No response
The text was updated successfully, but these errors were encountered: