feat: add spherical coordinate support via coords_crs parameter#136
Closed
opeblow wants to merge 1 commit into
Closed
feat: add spherical coordinate support via coords_crs parameter#136opeblow wants to merge 1 commit into
opeblow wants to merge 1 commit into
Conversation
Author
|
Hello 👋🏿🤗 |
Author
|
Hi, just checking in on this PR. |
Contributor
|
Thanks for the contribution @opeblow. Closing this in favour of existing PRs that cover the same ground: The np.atleast_1d fix for max_num_neighbours=1 (#83) is already addressed in #90 and #113. If you want to stay involved, #90 has a change request from @leifdenby that could use a follow-up, or #132 could use review attention. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
This PR adds spherical coordinate support to weather-model-graphs,
enabling the library to work with lat/lon coordinates (EPSG:4326)
instead of only flat Cartesian coordinates.
Changes made in
src/weather_model_graphs/create/base.py:coords_crsparameter to accept input coordinate reference systemgraph_crsparameter to specify projection for graph constructionfrom lat/lon degrees to a metre-based CRS before graph construction
max_num_neighbours=1caused a TypeError becausenumpy returned a scalar instead of an array — fixed with np.atleast_1d()
Added tests in
tests/test_spherical_coords.py:edge distances (e.g. 394,581m, 789,163m) proving haversine projection
Issue Link
closes #42
Type of change