xml - 使用 ncml 聚合 netcdf 文件?

标签 xml netcdf ncml

我们将海洋模型的每小时输出存储在一系列 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/

相关文章:

netcdf - 如何使用 NCO 提取单个变量。关联变量问题

xslt - 如何获取当前节点的父节点名称?

Java使用sax来解析xml文件。出现时无法获取正确的内容

c - 用 C 将 XML 解析为树

android - 为页眉和页脚添加一个 TextView

python - 使用纬度经度坐标从卫星图像获取最近的像素值

python - 如何使用 python 对 numpy 数组(来自 netCDF 文件)进行比较?

python - 使用 DOM 从纯文本中提取信息并写入 XML

ncml - 用于匹配目录的正则表达式