从多维NETCDF创建[时间,LON,LAT]维度

发布于 2025-01-25 10:32:09 字数 1157 浏览 3 评论 0原文

我有来自Jason具有不寻常维度的卫星高度学数据(点,未握住):时间和suse_index。我想拥有一个[时间,LON,LAT]维度,而不会影响数据集。目前,LAT和LON是坐标,我尝试了 this ,但是我们有不同的数据集。

import xarray as xr
import pandas as pd

all_lat = xr.open_dataset('dataset.nc')
xarray.Dataset
Dimensions: time: 3031 meas_ind: 20
Coordinates:
**time** (time) datetime64[ns] 2002-01-23T02:26:13.761423824 .....
**meas_ind** (meas_ind) int8 0 1 2 3 4 5 6 ... 14 15 16 17 18 19
lat (time) float64 ...
lon (time) float64 ...
lon_20hz (time, meas_ind) float64 ...
lat_20hz (time, meas_ind) float64 ...
Data variables: (141)
Attributes: (25)

此外,我只需要SSHA变量,该变量在LAT和LON是坐标时会索引到时间。

xarray.DataArray'ssha' time: 3031
array([ 0.011, -0.019,  0.026, ...,    nan,    nan,    nan], dtype=float32)
Coordinates:
time (time) datetime64[ns] 2002-01-23T02:26:13.761423824 .....
lat (time) float64 -66.15 -66.15 ... 66.15 66.15
lon (time) float64 34.11 34.24 34.37 ... 199.0 199.2

我在这里上传了数据集:

I have this satellite altimetry data (points, not gridded) from Jason that has unusual dimensions: time and meas_index. I would like to have a [time, lon, lat] dimension without affecting the dataset. Currently, the lat and lon are coordinates and I have tried this but we have different datasets.

import xarray as xr
import pandas as pd

all_lat = xr.open_dataset('dataset.nc')
xarray.Dataset
Dimensions: time: 3031 meas_ind: 20
Coordinates:
**time** (time) datetime64[ns] 2002-01-23T02:26:13.761423824 .....
**meas_ind** (meas_ind) int8 0 1 2 3 4 5 6 ... 14 15 16 17 18 19
lat (time) float64 ...
lon (time) float64 ...
lon_20hz (time, meas_ind) float64 ...
lat_20hz (time, meas_ind) float64 ...
Data variables: (141)
Attributes: (25)

In addition, I only need the ssha variable, which is indexed to time while the lat and lon are coordinates.

xarray.DataArray'ssha' time: 3031
array([ 0.011, -0.019,  0.026, ...,    nan,    nan,    nan], dtype=float32)
Coordinates:
time (time) datetime64[ns] 2002-01-23T02:26:13.761423824 .....
lat (time) float64 -66.15 -66.15 ... 66.15 66.15
lon (time) float64 34.11 34.24 34.37 ... 199.0 199.2

I uploaded the dataset here: link

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文