我试图从TDScatalog获得一个带有虹吸但带有倍数变量的数据集,向我显示错误或最后一行。在这里,代码:
import siphon
from siphon.catalog import TDSCatalog
import datetime
from xarray.backends import NetCDF4DataStore
import xarray as xr
point = [-7, 41]
hours = 48
best_gfs = TDSCatalog('http://thredds.ucar.edu/thredds/catalog/grib/NCEP/GFS/'
'Global_0p25deg/catalog.xml?dataset=grib/NCEP/GFS/Global_0p25deg/Best')
best_gfs.datasets
best_ds = list(best_gfs.datasets.values())[0]
ncss = best_ds.subset()
query = ncss.query()
query.lonlat_point( point[1], point[0] ).time_range(datetime.datetime.utcnow(), datetime.datetime.utcnow() + datetime.timedelta(hours))
query.accept('netcdf4')
query.variables('Temperature_surface',
'Relative_humidity_height_above_ground',
'u-component_of_wind_height_above_ground',
'v-component_of_wind_height_above_ground',
'Wind_speed_gust_surface'
)
data = ncss.get_data(query)谢谢!
发布于 2022-08-22 18:23:38
这个消息是因为您的点请求试图返回时间序列(您的_surface变量)和时间序列的配置文件( u/v风分量)。单个netCDF文件中不同功能的组合不受netCDF CF-公约的支持。
一种方法是请求CSV或XML格式化的数据(虹吸仍然可以解析并作为数组字典返回)。
另一种是对具有不同几何形状的字段分别提出请求。Temperature_surface和Wind_speed_gust_surface有一个,u-component_of_wind_height_above_ground和v-component_of_wind_height_above_ground有一个,Relative_humidity_height_above_ground有最后一个。最后一次拆分是围绕着THREDDS数据服务器中的一个明显缺陷而进行的,在该漏洞中,具有不同垂直级别的配置文件也不能组合。
https://stackoverflow.com/questions/73423142
复制相似问题