Skip to content

Commit

Permalink
Codestyle fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
pp-mo committed Jan 20, 2021
1 parent 6474926 commit 063a6a3
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions iris_grib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,17 +343,24 @@ def _compute_extra_keys(self):

# shape of the earth
soe_code = self.shapeOfTheEarth
# As this class is now *only* for GRIB1, 'shapeOfTheEarth' is not a value read from the actual file : It is
# really a GRIB2 param, and the value is merely what eccodes (griabpi) considers the correct default.
# This was always =6 until eccodes 0.19, when it changed to 0. See https://jira.ecmwf.int/browse/ECC-811
# As this class is now *only* for GRIB1, 'shapeOfTheEarth' is not a
# value read from the actual file : It is really a GRIB2 param, and
# the value is merely what eccodes (gribapi) gives as the default.
# This was always = 6, until eccodes 0.19, when it changed to 0.
# See https://jira.ecmwf.int/browse/ECC-811
# The two represent different sized spherical earths.
if soe_code not in (6, 0):
raise ValueError('Unexpected shapeOfTheEarth value =', soe_code)
# *FOR NOW* maintain the old behaviour (radius=6371229) in all cases for backwards compatibility.
# However, this does not match 'radiusOfTheEarth' and may be incorrect : We may change it in future.

soe_code = 6
# *FOR NOW* maintain the old behaviour (radius=6371229) in all cases,
# for backwards compatibility.
# However, this does not match the 'radiusOfTheEarth' default from the
# gribapi so is probably incorrect (see above issue ECC-811).
# So we may change this in future.

if soe_code == 0:
# New supposedly-correct correct value, matches the 'radiusOfTheEarth' parameter.
# New supposedly-correct default value, matches 'radiusOfTheEarth'.
geoid = coord_systems.GeogCS(semi_major_axis=6367470)
elif soe_code == 6:
# Old value, does *not* match the 'radiusOfTheEarth' parameter.
Expand Down

0 comments on commit 063a6a3

Please sign in to comment.