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

Drop use of shapeOfTheEarth for Grib 1 #316

Merged
merged 3 commits into from Mar 15, 2023
Merged

Conversation

lbdreyer
Copy link
Member

@lbdreyer lbdreyer commented Jan 4, 2023

Fixes #241

A more detailed summary is on that issue, in this comment but to summarise:
In eccodes v2.19.0 the default shapeOfTheEarth was changed to 0, with a radius of 6367470 m. This alligned the behaviour with GRIB2. It was also recommended to not use this key and instead use the radius key.

Previously, for backwards compatibility, we decided to circumvent this change and hardcode a value of 6 and associate this with the old radius rather than the new radius.

We have now decided to adopt the change in eccodes. This means we should also not use the shapeOfTheEarth key.

We could use the radius key instead but this assumes a spherical Earth. I think it would make more sense to use the resolutionAndComponentFlag which distinguishes between a spherical Earth and an oblate spheroidal Earth.

I have added support for a spherical Earth, but not an oblate spheroidal Earth, as this would mean adding new functionality. We could consider adding support for oblate spheroidal later should someone request it.

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.

After some background reading on GRIB1, I do agree that this all makes sense.
I think it's right to say that previous behaviour was "wrong" + this is therefore a fix.
Likewise, the shift in coordinate values with projected transforms is I think just a consequence of the adjusted radius -- i.e. effectively a scaling factor, which again is a "bug fix" not "new behaviour".

So, I think all it now just needs is a whats-new entry : highlight the backwards-incompatible changes + explain it is a bug-fix.

docs/ref/release_notes.rst Show resolved Hide resolved
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.

That sorts it, good to go!

@pp-mo pp-mo merged commit 5b04ede into SciTools:main Mar 15, 2023
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.

Fix the assumed spherical earth radius for GRIB1 data.
2 participants