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

WIP GRIB2 table3.2 earth radius 6,371,229m #369

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions iris_grib/_save_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,16 @@ def shape_of_the_earth(cube, grib):
eccodes.codes_set_long(grib, "scaledValueOfEarthMajorAxis", 0)
eccodes.codes_set_long(grib, "scaleFactorOfEarthMinorAxis", 0)
eccodes.codes_set_long(grib, "scaledValueOfEarthMinorAxis", 0)
# Spherical earth.
elif (ellipsoid.semi_major_axis == 6371229.0) and (ellipsoid.semi_minor_axis == 6371229.0):
eccodes.codes_set_long(grib, "shapeOfTheEarth", 6)
eccodes.codes_set_long(grib, "scaleFactorOfRadiusOfSphericalEarth", 0)
eccodes.codes_set_long(grib, "scaledValueOfRadiusOfSphericalEarth",
ellipsoid.semi_major_axis)
eccodes.codes_set_long(grib, "scaleFactorOfEarthMajorAxis", 0)
eccodes.codes_set_long(grib, "scaledValueOfEarthMajorAxis", 0)
eccodes.codes_set_long(grib, "scaleFactorOfEarthMinorAxis", 0)
eccodes.codes_set_long(grib, "scaledValueOfEarthMinorAxis", 0)
# Oblate spheroid earth.
else:
eccodes.codes_set_long(grib, "shapeOfTheEarth", 7)
Expand Down