Open griff-rees opened 3 months ago
@stuartlynn thanks for suggesting following your process_data.py
example. I think there's an inherent issue with the way the dimensions are intertwined in the raw UKCP2.2km
files that makes this a bit tricky, and the files you're working from have solved that problem (via sticking with the 360 day calendar).
Here's what I've tried to so far:
>>> from xarray.core.dataset import Dataset
>>> lat_lon: Dataset = expanded_calendar.rio.set_spatial_dims("grid_longitude", "grid_latitude", True)
>>> lat_lon_projected: Dataset = lat_lon.rio.reproject("EPSG:27700")
*** rioxarray.exceptions.TooManyDimensions: Only 2D and 3D data arrays supported. Data variable: tasmin
This matches a question I asked on the rioxarray
repo
some time ago.
Continuing with your suggestion:
>>> without_attrs: DataArray = DataArray(
... data=expanded_calendar.tasmin.to_numpy(),
... coords={'time': expanded_calendar.tasmin.time,
... "latitude": expanded_calendar.tasmin.latitude,
... "longitude": expanded_calendar.tasmin.longitude},
... name="tasmin")
*** ValueError: coordinate time has dimensions ('time',), but these are not a subset of the DataArray
dimensions ('dim_0', 'dim_1', 'dim_2', 'dim_3')
I'm thinking if I can get the raw coordinate values via your .to_numpy()
method that might help. I'll keep trying.
Potential solutions
vmfileshare/ClimateData/CPM-365/tif-projection-rewrite/refactored-third-run/test-1980-cpm-365-or-366-27700-final.nc
y
axis by-1
simplify
stepSeparately (but related)
HADs
CRS
is written correctly