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

Handle missing keys for GDT10 Mercator #446

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

trexfeathers
Copy link
Contributor

Closes #188

@trexfeathers trexfeathers marked this pull request as draft April 19, 2024 17:25
Copy link
Member

@pp-mo pp-mo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than tiny query -- LGTM

@@ -776,10 +776,35 @@ def grid_definition_template_10(section, metadata):
# intersects the Earth
standard_parallel = section["LaD"] * _GRID_ACCURACY_IN_DEGREES

if "orientationOfTheGrid" in section and not np.isclose(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the need for "if ... in section" here -- have I misunderstood something ?
By my understanding, if gdt is 10 then this key should always be present, though it may have missing/None value ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the same, but some of my tests failed so I had to add 44437da . Of course I suppose there is a chance that it is present but also None...

Comment on lines +795 to +798
if not (
np.isclose(section["longitudeOfLastGridPoint"], final_x_point)
and np.isclose(section["latitudeOfLastGridPoint"], final_y_point)
):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Experiments so far have produced many cases where this block is true, which makes me worried I need an extra factor in here like scaling or units or something. That's why I changed the PR back to draft.

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

Successfully merging this pull request may close these issues.

Incomplete validity checking in GDT 3.10
2 participants