当时间被指定为“base_time”的偏移量时合并 netCDF 文件

问题描述

我想使用时间维度合并多个 netCDF 文件。这些文件是相同的,但时间由来自“base_time”的“time_offset”指定,其中“base_time”在每个文件中都不同。

特别是在我的情况下,我每天有一个文件,“base_time”是那天的开始,即:

    <class 'netCDF4._netCDF4.Variable'>
int32 base_time()
    string: 1-Jan-2019,00:00:00 GMT
    long_name: Base time in Epoch
    units: seconds since 1970-1-1 0:00:00 0:00
    unlimited dimensions: 
    current shape = ()
    filling on,default _FillValue of -2147483647 used

并且 'time_offset' 是该基准时间的偏移量(以秒为单位),即:

<class 'netCDF4._netCDF4.Variable'>
float64 time_offset(time)
    long_name: Time offset from base_time
    units: seconds since 2019-1-1 00:00:00 0:00
unlimited dimensions: time
current shape = (826,)
filling on,default _FillValue of 9.969209968386869e+36 used

因此'time_offset'的单位每天都不同,因为'base_time'不同。

我尝试了以下方法

test = xarray.open_mfdataset(all_files,decode_cf=True,concat_dim='time')

但我收到以下错误

ValueError: Could not find any dimension coordinates to use to order the datasets for concatenation

我是 xarray 的新手,不太确定如何解决这个问题,任何建议都会有所帮助:)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)