Skip to content

Conversation

@abooton
Copy link
Contributor

@abooton abooton commented Jul 17, 2023

Description
Saving of cubes on the Lambert Azimuthal Equal Area (LAEA) projection is added.
The LAEA template is described here: https://codes.ecmwf.int/grib/format/grib2/templates/3/140/

It is very similar to the Lambert Conformal projection specification in template_30, and so the coding was based on that.
https://codes.ecmwf.int/grib/format/grib2/templates/3/30/

Associated Issue
#344

@abooton abooton force-pushed the add_LAEA_template_140_saving branch from 228dbce to 56a2885 Compare July 17, 2023 07:43
@abooton abooton changed the title Add saving for the Lambert Azimuthual Equal Area grid Save LAEA grid Jul 17, 2023
@trexfeathers trexfeathers self-assigned this Jul 19, 2023
@pp-mo
Copy link
Member

pp-mo commented Jul 27, 2023

I just realised that we have an outstanding previous request to do this (plus another thing) ... #295.
The discussion there seems to have stalled, but we should probably choose one over the other somehow.

Copy link
Contributor

@trexfeathers trexfeathers left a comment

Choose a reason for hiding this comment

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

Thanks @abooton! I've compared this to the templates (thanks for the links), the Lambert Conformal code, and to #295; the changes make sense.

I have a few questions/suggestions below.

@trexfeathers
Copy link
Contributor

@lbdreyer @abooton any thoughts on progressing this?

@trexfeathers
Copy link
Contributor

Happy to close this if no longer important

@abooton
Copy link
Contributor Author

abooton commented Nov 14, 2023

Sorry - I get so much GitHub spam I had not realised it had review comments on it. This is still important. It may still be need operationally.

@trexfeathers
Copy link
Contributor

trexfeathers commented Nov 15, 2023

Posting this outside any review comments to give me a common place to reference.

I tracked down template.3.140.def in eccodes, which I combined with ECMWF | Section 3 - Template 140 : Lambert azimuthal equal area projection to generate this:

Octets Key Type Content
15 shapeOfTheEarth codetable Shape of the Earth (see Code table 3.2)
16 scaleFactorOfRadiusOfSphericalEarth unsigned Scale factor of radius of spherical Earth
17-20 scaledValueOfRadiusOfSphericalEarth unsigned Scaled value of radius of spherical Earth
21 scaleFactorOfMajorAxisOfOblateSpheroidEarth unsigned Scale factor of major axis of oblate spheroid Earth
22-25 scaledValueOfMajorAxisOfOblateSpheroidEarth unsigned Scaled value of major axis of oblate spheroid Earth
26 scaleFactorOfMinorAxisOfOblateSpheroidEarth unsigned Scale factor of minor axis of oblate spheroid Earth
27-30 scaledValueOfMinorAxisOfOblateSpheroidEarth unsigned Scaled value of minor axis of oblate spheroid Earth
31-34 numberOfPointsAlongXAxis unsigned Nx - numberOfPointsAlongXAxis
35-38 numberOfPointsAlongYAxis unsigned Ny - numberOfPointsAlongYAxis
39-42 latitudeOfFirstGridPoint signed La1 - latitudeOfFirstGridPoint
43-46 longitudeOfFirstGridPoint signed Lo1 - longitudeOfFirstGridPoint
47-50 standardParallelInMicrodegrees signed Standard Parallel In Microdegrees
51-54 centralLongitudeInMicrodegrees signed Central Longitude In Microdegrees
55 resolutionAndComponentFlags codeflag Resolution and component flags (see Flag table 3.3)
56-59 xDirectionGridLengthInMillimetres unsigned Dx - X-direction grid length in millimetres
60-63 yDirectionGridLengthInMillimetres unsigned Dy - Y-direction grid length in millimetres
64 scanningMode codeflag Scanning mode (see Flag table 3.4)

… centralLongitude to centralLongitudeInMicrodegrees
@abooton
Copy link
Contributor Author

abooton commented Nov 20, 2023

I have:

  • Renamed standardParallel to standardParallelInMicrodegrees (in _save_rules.py and in the unit tests)
  • Renamed centralLongitude to centralLongitudeInMicrodegrees (in _save_rules.py and in the unit tests)
  • Added the raising the exception if the false_easting and false_northing are not zero. (I can see this can be configured when creating the LAEA coord-system, but there isn't the slot in the GRIB to save it, hence the need to raise the exception).
  • I am happy that the lat and lon are set in degrees in the test _make_test_cube and are coded to be in micro-degrees in the test__template_specifics

@abooton abooton force-pushed the add_LAEA_template_140_saving branch 13 times, most recently from 9e1775f to 7b21ce6 Compare November 21, 2023 08:29
@abooton abooton force-pushed the add_LAEA_template_140_saving branch from 7b21ce6 to c0cae4f Compare November 21, 2023 08:42
@abooton abooton force-pushed the add_LAEA_template_140_saving branch from c0cae4f to 9ab66a5 Compare November 21, 2023 08:47
@trexfeathers
Copy link
Contributor

The docs build failure is not a concern for this pull request - #365

@abooton abooton force-pushed the add_LAEA_template_140_saving branch 2 times, most recently from 4ef8d6e to b1f2aa3 Compare November 21, 2023 13:11
@abooton abooton force-pushed the add_LAEA_template_140_saving branch from b1f2aa3 to 9ca9e7f Compare November 21, 2023 13:23
@trexfeathers trexfeathers merged commit 58cb9ff into SciTools:main Nov 21, 2023
@trexfeathers
Copy link
Contributor

Thanks very much for your contribution @abooton

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants