Repository navigation
Use geospatial_vertical_units when inferring the length unit - #170
Closed
aarab-malik wants to merge 1 commit into
Closed
aarab-malik wants to merge 1 commit into
aarab-malik wants to merge 1 commit into
Conversation
Geodetic datasets were always assigned a length unit of 1.0 before geospatial_vertical_units was checked, so code_length became 1 cm even when the file recorded km. Check the attribute first.
Collaborator
|
Hi @aarab-malik , thanks for the PR but I've actually already got a branch with the fix including more significant redesign. |
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.
_infer_length_unitreturned 1.0 as soon as a dataset had latitude and longitude, so it never looked atgeospatial_vertical_units. A depth axis stored in km then got acode_lengthof 1 cm, and converting a physical length into code units was off by 1e5. Passinggeometry=into the load call did not change that, because the check still used the inferred geometry.I check
geospatial_vertical_unitsfirst and only fall back to 1.0 for geodetic data when that attribute is missing. The reproducer from the issue is now a test inyt_xarray/tests/test_accesor.py.Closes #167