假设我xarray.Dataset
在使用中加载了一个对象xarray.open_dataset(..., decode_times=False)
,打印时看起来像这样:
<xarray.Dataset>
Dimensions: (bnds: 2, lat: 15, lon: 34, plev: 8, time: 3650)
Coordinates:
* time (time) float64 3.322e+04 3.322e+04 3.322e+04 3.322e+04 ...
* plev (plev) float64 1e+05 8.5e+04 7e+04 5e+04 2.5e+04 1e+04 5e+03 ...
* lat (lat) float64 40.46 43.25 46.04 48.84 51.63 54.42 57.21 60.0 ...
* lon (lon) float64 216.6 219.4 222.2 225.0 227.8 230.6 233.4 236.2 ...
Dimensions without coordinates: bnds
Data variables:
time_bnds (time, bnds) float64 3.322e+04 3.322e+04 3.322e+04 3.322e+04 ...
lat_bnds (lat, bnds) float64 39.07 41.86 41.86 44.65 44.65 47.44 47.44 ...
lon_bnds (lon, bnds) float64 215.2 218.0 218.0 220.8 220.8 223.6 223.6 ...
hus (time, plev, lat, lon) float64 0.006508 0.007438 0.008751 ...
给定、 和的多个范围lat
,将其子集化的最佳方法是什么?我尝试链接一系列条件并使用,但我收到一条错误消息:lon
time
xarray.Dataset.where
IndexError: The indexing operation you are attempting to perform is not valid on netCDF4.Variable object. Try loading your data into memory first by calling .load().
我无法将整个数据集加载到内存中,那么典型的方法是什么?