-
Notifications
You must be signed in to change notification settings - Fork 72
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
Improve support for geographic coordinates #171
Comments
👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. You might also want to take a look at our Contributing Guide and Code of Conduct. |
@leouieda Can you think more functions that need this enhancement? |
I'm not used to using |
The pyproj.CRS object has a is_geographic property that is likely useful. |
@djhoese I kind of wanted to avoid units in Verde because there are no restrictions on the actual data types that can be used. I like the idea but I don't know if it would be worth the effort of dealing with a unit library to replace the keyword. Are you planning on using that with geoxarray? @snowman2 that's interesting but I'm not sure how we could use it. The functions above don't really take any CRS arguments right now. So we'd still have to add an argument and pass it around but instead of |
@santisoler I think you could get started with a |
👍 I'll add a PR when I start tackling this. |
The function moves a set of longitudinal coordinates either to the `[0, 360)` or `[-180, 180)` degrees intervals to ensure that longitude is continuous throughout the array (no 360 -> 0 jump). Optionally change a given region to match the longitude values. This way, longitude arrays can be sliced to a sub region with simple `>= <=` comparisons. Fixes #171
Description of the desired feature
Some functions from
verde
are intended to work with both projected and geographic coordinates.Nevertheless, working with the latter imposes some requirements.
For example, one must ensure continuity around the globe: setting a grid between longitudes 170° and -170° or between 350° and 10° is not possible at the time because numerically the
east
coordinate is lower than thewest
one.One way to fix this is to add a
latlon=True
argument to those functions in order to make clear that we are passing geographic coordinates.I'll try to make a complete list of the functions that needs to be enhanced:
inside()
grid_coordinates()
scatter_coordinates()
profile_coordinates()
get_region()
pad_region()
Are you willing to help implement and maintain this feature? Yes
The text was updated successfully, but these errors were encountered: