Improve setting GRIB2 key shapeOfTheEarth#1491
Conversation
|
This all looks good to me I have cross checked the GRIB2 specification and all the definitions match up I like the refactoring of the unit tests so that The test coverage seems good. I recommend this as being ready to merge |
There was a problem hiding this comment.
It seems odd to be setting the radius even for shape 0 and 6 which have an implicit shape...?
There was a problem hiding this comment.
I feel that just because it's implicit doesn't mean it shouldn't be explicitly set -- the key exists in the templates regardless of the value of the shape of the earth key. This is a downside of the overspecified nature of GRIB templates... However, whether also setting the scale factor to 0 is appropriate is another question...
There was a problem hiding this comment.
Given that there are merits to how I've implemented this above and @rhattersley's suggestion I had a look at the _load_convert code for interpreting the shapeOfTheEarth key. It just uses the value of this key to set the coord system of the the grid specified in the message's Section 3, so I'm happy to concede this point.
I'd still like some thoughts on setting the scale factor to 0 though!
|
Review actions. I've added a couple of tests for the |
|
👍 - I see this as an improvement of the current handling of |
|
@pelson I'll have a play! |
|
Having now had a play the test failures are non-trivial to fix, so I'm going to close this for now on account of time constraints. |
Improve grib saving of shape of the earth key
Improves the setting and testing of the GRIB2 Grid Definition Section key
shapeOfTheEarth.Translation of three more key values has been added. These are (see GRIB Spec Code Table 3.2):
the Greenwich meridian as 0 longitude, and the Newlyn datum as mean sea level, 0 height".
Some test results have been changed in line with these changes, where these changes have corrected the value that
shapeOfTheEarthwas previously and incorrectly being set to.The shape of the earth tests in the tests for GDT 0, 1, 5 and 12 have also been refactored into their own test module to prevent duplicating the tests.