Skip to content

Commit 7a60214

Browse files
committed
Fix dropping attrs in format_lat
1 parent d7775a7 commit 7a60214

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/xarray_regrid/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,15 +316,15 @@ def format_lat(
316316
if dy - polar_lat >= obj.coords[lat_coord].values[0] > -polar_lat:
317317
south_pole = obj.isel({lat_coord: 0})
318318
if lon_coord is not None:
319-
south_pole = south_pole.mean(lon_coord)
319+
south_pole = south_pole.mean(lon_coord, keep_attrs=True)
320320
obj = xr.concat([south_pole, obj], dim=lat_coord) # type: ignore
321321
lat_vals = np.concatenate([[-polar_lat], lat_vals])
322322

323323
# North pole
324324
if polar_lat - dy <= obj.coords[lat_coord].values[-1] < polar_lat:
325325
north_pole = obj.isel({lat_coord: -1})
326326
if lon_coord is not None:
327-
north_pole = north_pole.mean(lon_coord)
327+
north_pole = north_pole.mean(lon_coord, keep_attrs=True)
328328
obj = xr.concat([obj, north_pole], dim=lat_coord) # type: ignore
329329
lat_vals = np.concatenate([lat_vals, [polar_lat]])
330330

0 commit comments

Comments
 (0)