Skip to content

Commit

Permalink
Merge pull request #1471 from ESMValGroup/fix_era5_cmorizer
Browse files Browse the repository at this point in the history
Fix making latitude increasing for ERA5
  • Loading branch information
mattiarighi authored Dec 19, 2019
2 parents 82788e0 + d3f2e31 commit 231280d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions esmvaltool/cmorizers/obs/cmorize_obs_era5.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ def _extract_variable(in_file, var, cfg, out_dir):
cube.coord('latitude').var_name = 'lat'
cube.coord('longitude').var_name = 'lon'

# Make latitude increasing
cube = cube[..., ::-1, :]

for coord_name in 'latitude', 'longitude', 'time':
try:
coord = cube.coord(coord_name)
Expand All @@ -186,9 +189,6 @@ def _extract_variable(in_file, var, cfg, out_dir):
# Convert units if required
cube.convert_units(definition.units)

# Make latitude increasing
cube = cube[:, ::-1, ...]

logger.info("Saving cube\n%s", cube)
logger.info("Expected output size is %.1fGB",
np.prod(cube.shape) * 4 / 2**30)
Expand Down

0 comments on commit 231280d

Please sign in to comment.