小编Mar*_*ina的帖子

Xarray:没有维度的切片坐标

我在这个话题上遇到了困难,尽管它看起来应该很简单。

我想使用一组纬度和经度坐标对 xarray 数据集进行切片。

这是我的数据集的样子:

In [31]: data = xr.open_mfdataset(open_file, decode_cf=True)

In [32]: data
Out[32]: 
<xarray.Dataset>
Dimensions:  (time: 108120, x: 349, y: 277)
Coordinates:
    lons     (y, x) float64 -145.5 -145.3 -145.1 -144.9 -144.8 -144.6 -144.4 ...
    lats     (y, x) float64 1.0 1.104 1.208 1.312 1.416 1.519 1.621 1.724 ...
  * time     (time) datetime64[ns] 1980-01-01 1980-01-01T03:00:00 ...
Dimensions without coordinates: x, y
Data variables:
    stp      (time, y, x) float64 0.1235 0.0867 0.07183 0.05389 0.05901 ...
Run Code Online (Sandbox Code Playgroud)

这是我如何切片:

In [48]: lat_bnd = [25,30] …
Run Code Online (Sandbox Code Playgroud)

python xarray

8
推荐指数
1
解决办法
2819
查看次数

标签 统计

python ×1

xarray ×1