Skip to content

Commit

Permalink
additional unit check
Browse files Browse the repository at this point in the history
  • Loading branch information
jwarner8 committed Dec 12, 2024
1 parent f9b9429 commit 8625379
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/CSET/operators/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,9 @@ def _fix_spatialcoord_name_callback(cube: iris.cube.Cube):
# We only want to modify instances where the coordinate system is actually
# latitude/longitude, and not touch the cube if the coordinate system is say
# meters.
if y_name in ["latitude"]:
if y_name in ["latitude"] and cube.coord(y_name).units == "degrees":
cube.coord(y_name).rename("grid_latitude")
if x_name in ["longitude"]:
if x_name in ["longitude"] and cube.coord(x_name).units == "degrees":
cube.coord(x_name).rename("grid_longitude")

return cube
Expand Down

0 comments on commit 8625379

Please sign in to comment.