我们将海洋模型的每小时输出存储在一系列 netcdf 文件中,每个月一个。
我们在每个文件中存储该月的第一个小时和最后一个小时。我们希望使用 NcML 聚合这些文件,但我们不希望在聚合中获得重复的时间值。
有办法实现这一点吗?
最佳答案
在 NCML 中,您可以使用 NCOORDS
来准确指定要使用的记录数。因此,为了避免重复的时间值,您可以将每个月的 NCOORDS
指定为比当前值少 1。因此,对于非闰年,您的聚合可能会这样指定:
<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"
为二月。
关于xml - 使用 ncml 聚合 netcdf 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15227684/