Skip to content

Commit 3885b44

Browse files
identify X and Y in rotated pole grids (#426)
* added grid mapping standard coordinate names * update guess_coord test
1 parent ce9cd5a commit 3885b44

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

cf_xarray/criteria.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,22 @@
9494
"positive": ("up", "down"),
9595
},
9696
"X": {
97-
"standard_name": ("projection_x_coordinate",),
97+
"standard_name": (
98+
"projection_x_coordinate",
99+
"grid_longitude",
100+
"projection_x_angular_coordinate",
101+
),
98102
"_CoordinateAxisType": ("GeoX",),
99103
"axis": ("X",),
100104
"cartesian_axis": ("X",),
101105
"grads_dim": ("x",),
102106
},
103107
"Y": {
104-
"standard_name": ("projection_y_coordinate",),
108+
"standard_name": (
109+
"projection_y_coordinate",
110+
"grid_latitude",
111+
"projection_y_angular_coordinate",
112+
),
105113
"_CoordinateAxisType": ("GeoY",),
106114
"axis": ("Y",),
107115
"cartesian_axis": ("Y",),
@@ -134,9 +142,9 @@
134142
"(z|nav_lev|gdep|lv_|[o]*lev|bottom_top|sigma|h(ei)?ght|altitude|depth|"
135143
"isobaric|pres|isotherm)[a-z_]*[0-9]*"
136144
),
137-
"Y": re.compile("y|j|nlat|nj"),
145+
"Y": re.compile("y|j|nlat|rlat|nj"),
138146
"latitude": re.compile("y?(nav_lat|lat|gphi)[a-z0-9]*"),
139-
"X": re.compile("x|i|nlon|ni"),
147+
"X": re.compile("x|i|nlon|rlon|ni"),
140148
"longitude": re.compile("x?(nav_lon|lon|glam)[a-z0-9]*"),
141149
}
142150
regex["T"] = regex["time"]

cf_xarray/tests/test_accessor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,8 +1142,8 @@ def _check_attrs_equal(o, n):
11421142
"nav_lev",
11431143
]
11441144
)
1145-
_X_NAMES = _make_names(["x", "nlon", "i", "ni"])
1146-
_Y_NAMES = _make_names(["y", "nlat", "j", "nj"])
1145+
_X_NAMES = _make_names(["x", "nlon", "i", "ni", "rlon"])
1146+
_Y_NAMES = _make_names(["y", "nlat", "j", "nj", "rlat"])
11471147
_Z_NAMES = _VERTICAL_NAMES + ["olevel", "level", "zlevel"]
11481148
_LATITUDE_NAMES = _make_names(["lat", "latitude", "gphi", "nav_lat"])
11491149
_LONGITUDE_NAMES = _make_names(["lon", "longitude", "glam", "nav_lon"])

0 commit comments

Comments
 (0)