【发布时间】:2013-02-20 01:59:56
【问题描述】:
我们将海洋模型的每小时输出存储在一系列 netcdf 文件中,每个月一个。
我们将每月的第一个小时和最后一个小时存储在每个文件中。我们想使用 NcML 聚合这些文件,但我们不想在聚合中获得重复的时间值。
有没有办法做到这一点?
【问题讨论】:
我们将海洋模型的每小时输出存储在一系列 netcdf 文件中,每个月一个。
我们将每月的第一个小时和最后一个小时存储在每个文件中。我们想使用 NcML 聚合这些文件,但我们不想在聚合中获得重复的时间值。
有没有办法做到这一点?
【问题讨论】:
在 NCML 中,您可以使用 NCOORDS 准确指定要使用的记录数。因此,为了避免重复的时间值,您可以将每个月的 NCOORDS 指定为比您当前拥有的值少一。因此,对于非闰年,您的聚合可能会这样指定:
<netcdf xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2">
<aggregation dimName="time" type="joinExisting">
<netcdf location="/Data/wave/2010/Jan/gom01_0001.nc" ncoords="744"/>
<netcdf location="/Data/wave/2010/Feb/gom01_0001.nc" ncoords="672"/>
<netcdf location="/Data/wave/2010/Mar/gom01_0001.nc" ncoords="744"/>
<netcdf location="/Data/wave/2010/Apr/gom01_0001.nc" ncoords="720"/>
<netcdf location="/Data/wave/2010/May/gom01_0001.nc" ncoords="744"/>
<netcdf location="/Data/wave/2010/Jun/gom01_0001.nc" ncoords="720"/>
<netcdf location="/Data/wave/2010/Jul/gom01_0001.nc" ncoords="744"/>
<netcdf location="/Data/wave/2010/Aug/gom01_0001.nc" ncoords="744"/>
<netcdf location="/Data/wave/2010/Sep/gom01_0001.nc" ncoords="720"/>
<netcdf location="/Data/wave/2010/Oct/gom01_0001.nc" ncoords="744"/>
<netcdf location="/Data/wave/2010/Nov/gom01_0001.nc" ncoords="720"/>
<netcdf location="/Data/wave/2010/Dec/gom01_0001.nc" ncoords="744"/>
</aggregation>
</netcdf>
在闰年,您可以将 ncoords="696" 指定为二月。
【讨论】: