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

pyart.core.Grid.to_xarray returns 1-dimensional lon-lat instead of 2-dimensional #1389

Closed
Vforcell opened this issue Feb 22, 2023 · 0 comments · Fixed by #1390
Closed

pyart.core.Grid.to_xarray returns 1-dimensional lon-lat instead of 2-dimensional #1389

Vforcell opened this issue Feb 22, 2023 · 0 comments · Fixed by #1390
Labels
Bug Issue in the Code

Comments

@Vforcell
Copy link
Contributor

Vforcell commented Feb 22, 2023

@mgrover1
## Context

In pyart.core.Grid.to_xarray, only one dimension of the longitude (resp. latitude) 2-dimensional array is used to create the xarray object.

By doing so, we make the assumption that the Grid is regular in longitude and latitude, which is not.

This involves displacements in the Grid object when plotting using longitude and latitude. This displacement increases with the distance to the origin of the Grid. At 100km range, there is a displacement of ~7km when using 1-dimensional lon / lat compared to the 2-dimensional lon / lat coming from Grid.get_point_longitude_latitude function.

Solution

lon / lat coordinates in the xarray.Dataset object should be defined as 2-dimensional along (y, x).

"lat": (["y"], lat[:, 0]), ---> "lat": (["y", "x"], lat)
"lon": (["x"], lon[0, :]), ---> "lon": (["y", "x"], lon)

displacement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issue in the Code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants