我的典型工作流程是下载大型数据集(netcdf),然后通过单个lat/lon(gridpoint)将其子集。然而,我通常只需要一个特定变量(如气温/降水量)的单一网格点,并且希望能够在下载之前有效地对大型数据集(如CMIP6)进行子集划分,以便下载量较小。然而,到目前为止,我已经尝试过esgf pyclient,为单个网格点提取一个变量(在1850-2100年间,每行数据约91675天)可能需要一个小时以上的时间。这种速度太慢,无法在下载之前进行子集设置。互联网不是问题,因为我的下载速度(以太网)是>;1Gbps。如果任何人有任何建议或替代工作流程,将不胜感激
我正在为esgf pyclient使用的代码:
from pyesgf.search import SearchConnection
import xarray as xr
import numpy as np
conn = SearchConnection('https://esgf-data.dkrz.de/esg-search', distrib=True)
ctx = conn.new_context(
product = 'input',
project = 'ISIMIP3b',
# model = 'GFDL-ESM4',
experiment='historical',
variable='tasAdjust', #, tasminAdjust, tasmaxAdjust, prAdjust'
time_frequency='day',
data_node='esg.pik-potsdam.de'
)
ctx.hit_count
result = ctx.search()[0]
result.dataset_id
files = result.file_context().search()
ds = xr.open_dataset(files[0].opendap_url).sel(lat=32.298583, lon=-97.78538710, method="nearest")
所需的输出将是所需网格点(lat/lon)的91675行、单列/矢量数据
这似乎要快得多:
相关问题 更多 >
编程相关推荐