我正在尝试使用xarray组合多个NetCDF文件。
以下是我的维度:
Dimensions: (Time: 1, XCells: 2000, YCells: 1000)
Coordinates:
longitude (YCells, XCells) float32
latitude (YCells, XCells) float32
* Time (Time) datetime64[ns]
Dimensions without coordinates: XCells, YCellsCombine by_coords仅适用于一维坐标。combining spatial netcdf files using xarray python
但是,当我使用combine=“嵌套”时,它会重复纬度和经度来表示时间。
float longitude(Time, YCells, XCells);
longitude:_FillValue = NaNf;
float latitude(Time, YCells, XCells);
latitude:_FillValue = NaNf;纬度和经度是二维的,但在时间上是相同的。Xarray有没有组合这些数据的方法?
发布于 2020-10-17 00:33:48
我使用netcdf-python和numpy按时间组合了这些文件。
将一个数据集复制到另一个数据集的代码类似于Xavier Ho的解决方案:python netcdf: making a copy of all variables and attributes but one
我不想重复的变量,我直接复制了。对于时间维度和随时间变化的变量,我使用numpy切片更改了复制表达式。
https://stackoverflow.com/questions/64252816
复制相似问题