admin管理员组文章数量:1026062
I am trying to download weather forecast data using the Siphon library (example below). When I specify multiple variables to download, it downloads just some of them (print at the end shows just two of the requested). In the case below, it downloads data only for u-component_of_wind_isobaric
and u-component_of_wind_isobaric
, ignoring all others. If I comment out those two, it will download the first two. It seems to be limited to either 2 or 3 variables. Is it due to some API restrictions, or do I understand something wrong? I know I could make multiple requests, but it looks strange since it seems to be working in the past.
from datetime import datetime, timedelta
from siphon.catalog import TDSCatalog
variables = [
'Temperature_surface',
'Wind_speed_gust_surface',
'u-component_of_wind_isobaric',
'v-component_of_wind_isobaric',
'Total_cloud_cover_entire_atmosphere_Mixed_intervals_Average',
]
best_gfs = TDSCatalog(
'/'
'Global_0p5deg/catalog.xml?dataset=grib/NCEP/GFS/Global_0p5deg/Best'
)
print(best_gfs.datasets)
ncss = best_gfs.datasets[0].subset()
query = ncss.query()
start, end = datetime.utcnow(), datetime.utcnow() + timedelta(days=1)
query.lonlat_point(17.918611, 59.651944).vertical_level(100000).time_range(start, end)
query.variables(*variables)
query.accept("netcdf4")
data = ncss.get_data(query)
print(list(data.variables))
Result: ['latitude', 'longitude', 'stationAltitude', 'station_id', 'station_description', 'u-component_of_wind_isobaric', 'v-component_of_wind_isobaric', 'time', 'stationIndex']
As seen most of requested variables missing in the result.
I am trying to download weather forecast data using the Siphon library (example below). When I specify multiple variables to download, it downloads just some of them (print at the end shows just two of the requested). In the case below, it downloads data only for u-component_of_wind_isobaric
and u-component_of_wind_isobaric
, ignoring all others. If I comment out those two, it will download the first two. It seems to be limited to either 2 or 3 variables. Is it due to some API restrictions, or do I understand something wrong? I know I could make multiple requests, but it looks strange since it seems to be working in the past.
from datetime import datetime, timedelta
from siphon.catalog import TDSCatalog
variables = [
'Temperature_surface',
'Wind_speed_gust_surface',
'u-component_of_wind_isobaric',
'v-component_of_wind_isobaric',
'Total_cloud_cover_entire_atmosphere_Mixed_intervals_Average',
]
best_gfs = TDSCatalog(
'http://thredds.ucar.edu/thredds/catalog/grib/NCEP/GFS/'
'Global_0p5deg/catalog.xml?dataset=grib/NCEP/GFS/Global_0p5deg/Best'
)
print(best_gfs.datasets)
ncss = best_gfs.datasets[0].subset()
query = ncss.query()
start, end = datetime.utcnow(), datetime.utcnow() + timedelta(days=1)
query.lonlat_point(17.918611, 59.651944).vertical_level(100000).time_range(start, end)
query.variables(*variables)
query.accept("netcdf4")
data = ncss.get_data(query)
print(list(data.variables))
Result: ['latitude', 'longitude', 'stationAltitude', 'station_id', 'station_description', 'u-component_of_wind_isobaric', 'v-component_of_wind_isobaric', 'time', 'stationIndex']
As seen most of requested variables missing in the result.
Share Improve this question asked Nov 18, 2024 at 10:54 PrimozPrimoz 1,4942 gold badges19 silver badges37 bronze badges1 Answer
Reset to default 1A limitation of the NCSS service you're trying to use is that it can only return variables on a single coordinate system (e.g. combination of horizontal coords + vertical coord + time). The first two variables use one vertical coordinate, the second two use a different one, and last variable yet another vertical coordinate. You'll need to separate this into 3 different requests.
You can see the variables grouped by coordinate system on the web form for NCSS for that dataset.
I am trying to download weather forecast data using the Siphon library (example below). When I specify multiple variables to download, it downloads just some of them (print at the end shows just two of the requested). In the case below, it downloads data only for u-component_of_wind_isobaric
and u-component_of_wind_isobaric
, ignoring all others. If I comment out those two, it will download the first two. It seems to be limited to either 2 or 3 variables. Is it due to some API restrictions, or do I understand something wrong? I know I could make multiple requests, but it looks strange since it seems to be working in the past.
from datetime import datetime, timedelta
from siphon.catalog import TDSCatalog
variables = [
'Temperature_surface',
'Wind_speed_gust_surface',
'u-component_of_wind_isobaric',
'v-component_of_wind_isobaric',
'Total_cloud_cover_entire_atmosphere_Mixed_intervals_Average',
]
best_gfs = TDSCatalog(
'/'
'Global_0p5deg/catalog.xml?dataset=grib/NCEP/GFS/Global_0p5deg/Best'
)
print(best_gfs.datasets)
ncss = best_gfs.datasets[0].subset()
query = ncss.query()
start, end = datetime.utcnow(), datetime.utcnow() + timedelta(days=1)
query.lonlat_point(17.918611, 59.651944).vertical_level(100000).time_range(start, end)
query.variables(*variables)
query.accept("netcdf4")
data = ncss.get_data(query)
print(list(data.variables))
Result: ['latitude', 'longitude', 'stationAltitude', 'station_id', 'station_description', 'u-component_of_wind_isobaric', 'v-component_of_wind_isobaric', 'time', 'stationIndex']
As seen most of requested variables missing in the result.
I am trying to download weather forecast data using the Siphon library (example below). When I specify multiple variables to download, it downloads just some of them (print at the end shows just two of the requested). In the case below, it downloads data only for u-component_of_wind_isobaric
and u-component_of_wind_isobaric
, ignoring all others. If I comment out those two, it will download the first two. It seems to be limited to either 2 or 3 variables. Is it due to some API restrictions, or do I understand something wrong? I know I could make multiple requests, but it looks strange since it seems to be working in the past.
from datetime import datetime, timedelta
from siphon.catalog import TDSCatalog
variables = [
'Temperature_surface',
'Wind_speed_gust_surface',
'u-component_of_wind_isobaric',
'v-component_of_wind_isobaric',
'Total_cloud_cover_entire_atmosphere_Mixed_intervals_Average',
]
best_gfs = TDSCatalog(
'http://thredds.ucar.edu/thredds/catalog/grib/NCEP/GFS/'
'Global_0p5deg/catalog.xml?dataset=grib/NCEP/GFS/Global_0p5deg/Best'
)
print(best_gfs.datasets)
ncss = best_gfs.datasets[0].subset()
query = ncss.query()
start, end = datetime.utcnow(), datetime.utcnow() + timedelta(days=1)
query.lonlat_point(17.918611, 59.651944).vertical_level(100000).time_range(start, end)
query.variables(*variables)
query.accept("netcdf4")
data = ncss.get_data(query)
print(list(data.variables))
Result: ['latitude', 'longitude', 'stationAltitude', 'station_id', 'station_description', 'u-component_of_wind_isobaric', 'v-component_of_wind_isobaric', 'time', 'stationIndex']
As seen most of requested variables missing in the result.
Share Improve this question asked Nov 18, 2024 at 10:54 PrimozPrimoz 1,4942 gold badges19 silver badges37 bronze badges1 Answer
Reset to default 1A limitation of the NCSS service you're trying to use is that it can only return variables on a single coordinate system (e.g. combination of horizontal coords + vertical coord + time). The first two variables use one vertical coordinate, the second two use a different one, and last variable yet another vertical coordinate. You'll need to separate this into 3 different requests.
You can see the variables grouped by coordinate system on the web form for NCSS for that dataset.
本文标签: SiphonCannot download data with all requested variablesStack Overflow
版权声明:本文标题:Siphon - Cannot download data with all requested variables - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745624428a2159774.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论