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

xesmf util.grid_2d across International Dateline with negative longitudes in W. Hemisphere #247

Open
jwynnsmith opened this issue Mar 16, 2023 · 1 comment

Comments

@jwynnsmith
Copy link

Good afternoon:

I have a 2 km squared grid that I need to bin GOES-17 GLM Flash longitudes and latitudes to individual grid cells.
From here I will go on to use he scipy binned_statistics_2d function
I am using the xe.util.grid_2d to define the grid.
The GOES-17 GLM crosses the International Dateline where the EH goes from 0 to 180 (Dateline) and the WH goes from -180 (Dateline) to 0.

Specifically, a function with the following lons/lats does not work for the longitudes:

lon_km = 111.321
lat_km = 110.567
two_km_lon = 2/lon_km
two_km_lat = 2/lat_km

ds_out = xe.util.grid_2d(141.78874488924427, -55.7888745, two_km_lon, -81.06280786164186,81.06280786164186, two_km_lat)

as the lon_max is technically a smaller number than the lon_min.

How can I work around this with out having to had 360 to the WH longitudes? If this issue has already been addressed, can you point me to that link?
Best regards
Jonathan

@huard
Copy link
Contributor

huard commented Jun 15, 2023

Hi Jonathan,

I'm not aware of another solution than what you're proposing.

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

No branches or pull requests

2 participants