从在线NETCDF时间表中提取值,而无需下载整个文件

发布于 2025-02-11 01:10:37 字数 1141 浏览 0 评论 0原文

我在Python& GDAL(专门为此踩在我的R-World之外),因此,如果您需要更多的东西来使此可再现或更清楚,请告诉我!

我正在尝试从几个NETCDF文件中提取时间序列数据,而不必下载整个文件。我知道gdallocationinfo可以为下载.nc文件,但是/vsicurl/(这是访问此处访问在线文件的唯一方法案例)与.nc文件无法使用。

In the end I'd like to have something like this

gdallocationinfo -wgs84 -valonly "/vsicurl/https://os.zhdk.cloud.switch.ch/envicloud/chelsa/chelsa_V2/GLOBAL/monthly/cmi/CHELSA_cmi_01_1981_V.2.1.tif" 14.27585 48.9335

that will work for this file: https://os.zhdk.cloud.switch.ch/envicloud/chelsa/chelsa_V1/chelsa_cmip5_ts/CHELSAcmip5ts_pr_ACCESS1-3_rcp45_2030-2049_V1.1.nc

So I '希望找到一种方法来说服vsicurl接受.nc文件,或者完全不同的东西,无论有效!

编辑
我首先要求一种“修复”以下行的方法,但是@Robert Davy的评论清楚地表明,vsicurl将与.nc 。 >文件,因此稍微改变了问题的重点。

gdallocationinfo -wgs84 -valonly "/vsicurl/" 14.27585 48.9335

I'm brand new in python & gdal (stepping outside of my R-world specifically for this), so if you need anything more to make this reproducible or more clear, please let me know!

I'm trying to extract time series data from several netCDF files WITHOUT having to download the whole files. I know that gdallocationinfo can do so for downloaded .nc files, but /vsicurl/ (which is the only way to access online files in this case) doesn't work together with .nc files.

In the end I'd like to have something like this

gdallocationinfo -wgs84 -valonly "/vsicurl/https://os.zhdk.cloud.switch.ch/envicloud/chelsa/chelsa_V2/GLOBAL/monthly/cmi/CHELSA_cmi_01_1981_V.2.1.tif" 14.27585 48.9335

that will work for this file: https://os.zhdk.cloud.switch.ch/envicloud/chelsa/chelsa_V1/chelsa_cmip5_ts/CHELSAcmip5ts_pr_ACCESS1-3_rcp45_2030-2049_V1.1.nc

So I'm looking to find a way to either convince vsicurl to accept the .nc files, or something totally different, whatever works!

Edit
I was first asking for a way to "fix" the line below, but comments from @Robert Davy made it clear that the vsicurl was going to create issues in combination with .nc files, so slightly changed the emphasis of the question.

gdallocationinfo -wgs84 -valonly "/vsicurl/" 14.27585 48.9335

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

染火枫林 2025-02-18 01:10:37

尝试

gdallocationinfo -wgs84 -valonly NETCDF:"/vsicurl/https://os.zhdk.cloud.switch.ch/envicloud/chelsa/chelsa_V1/chelsa_cmip5_ts/CHELSAcmip5ts_pr_ACCESS1-3_rcp45_2030-2049_V1.1.nc":varname 14.27585 48.9335

其中varname是netcdf感兴趣的变量。

但是,我认为对于vsicurlnetcdf,需要满足某些条件。

Try

gdallocationinfo -wgs84 -valonly NETCDF:"/vsicurl/https://os.zhdk.cloud.switch.ch/envicloud/chelsa/chelsa_V1/chelsa_cmip5_ts/CHELSAcmip5ts_pr_ACCESS1-3_rcp45_2030-2049_V1.1.nc":varname 14.27585 48.9335

where varname is the netcdf variable of interest.

However, I think there are some conditions that need to be met for vsicurl and netcdf to work together.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文