-
Notifications
You must be signed in to change notification settings - Fork 425
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
(Incorrect calculation)Incorrect Meridional Scale (dy) Calculation in parse_grid_arguments for Partial differential calculation #3769
Comments
Hello, thanks for opening your first issue with us. Please provide these significant errors in final value and what values and methods you are comparing against, and please elaborate on what errors you believe to be tracing through In case it helps, there are thorough discussions on these implementations and statistical comparison of their outputs to other sources in #893 and #2743. Please follow up with any additional questions plus the clarifications above so that we can understand your issue and help. Thanks! |
thanks for your reply From the code below , we can see that MetPy encounters errors when calculating delta in this simple coordinate system. Additionally, when considering the ellipsoidal coordinate system, Here is the code that demonstrates the problem
looking forward to your response. Thanks for your time! |
Perfect, this is a super helpful follow-up! We are prioritizing v1.7 releasing this week, but will take a look at this as soon as we can. Thanks. |
What went wrong?
When using the projection <Geographic 2D CRS: +proj=latlon +type=crs> with the datum World Geodetic System 1984, the calculation of vorticity from the wind field uv fails to provide accurate results when dx and dy are not explicitly specified. The same issue may occur with other projections as well.Specifically, the parse_grid_arguments decorator in the tool.py file under the calc directory returns an incorrect dy to the vorticity function. The dy is prematurely assigned as meridional_scale, resulting in significant errors in the final output.
Steps to Reproduce
Set the projection to <Geographic 2D CRS: +proj=latlon +type=crs>.
Attempt to compute vorticity using the wind field uv data.
Do not explicitly provide dx and dy.
Check the output from the vorticity function for accuracy.
Actual Result
The vorticity calculation yields inaccurate results due to the incorrect dy value. The param dy is prematurely assigned as meridional_scale
Code Trace
The issue originates in the parse_grid_arguments section related to metpy.grid_deltas, as shown below:
grid_deltas = grid_prototype.metpy.grid_deltas
bound_args.arguments['dx'] = grid_deltas['dx']
bound_args.arguments['dy'] = grid_deltas['dy']
Further tracing leads to the nominal_lat_lon_grid_deltas section:
forward_az, _, dy = geod.inv(lon_meridian_diff, lat[:-1], lon_meridian_diff, lat[1:], radians=False)
Operating System
Windows
Version
1.5.0
Python Version
3.8
Code to Reproduce
Errors, Traceback, and Logs
The text was updated successfully, but these errors were encountered: