如何指定某个地方(CDS)天气数据查询?- 江南体育网页版- - - - -地球科学堆江南电子竞技平台栈交换 最近30从www.hoelymoley.com 2023 - 07 - 08 - t04:33:10z //www.hoelymoley.com/feeds/question/20920 https://creativecommons.org/licenses/by-sa/4.0/rdf //www.hoelymoley.com/q/20920 1 如何指定某个地方(CDS)天气数据查询? N8_Coder //www.hoelymoley.com/users/21942 2021 - 02 - 28 - t20:55:35z 2021 - 02 - 28 - t20:55:35z < p >我想让时间序列数据为一个特定的位置(经度和纬度)对不同天气元素从cd数据池。Therefore, I am using the cdsapi package and can run queries such as:

import cdsapi import xarray as xr # settings filename = "here.nc" # request c = cdsapi.Client() res = c.retrieve( "reanalysis-era5-single-levels", { "product_type": "reanalysis", "variable": "2m_temperature", "year": "2019", "month": "01", "day": "01", "time": [ "00:00", ], "format": "netcdf", }, filename, ) nc = xr.open_dataset(filename, decode_cf=False) df = nc.to_dataframe().reset_index(drop=False) print(df) 

This can easily be extended to more time points, but not as easily to places (even the returned latitude and longitude coordinates sometimes do are unreasonable). If I understand correctly the netcdf data is already interpolated, but there is no parameter to specify a distinct place (only area and grid). Because I have to query several places all over the world and want to go a few years back with hourly/daily resolution, querying large grids will not work.

Does anybody have an idea how to get the data for a specific place? If possible, I would like to keep my tooling Python only, but happy to use other packages or try other solutions.

Baidu
map