远程 THREDDS 目录的 NcML 聚合

NcML aggregation of remote THREDDS catalog

我想聚合远程 THREDDS 目录的特定目录中的所有文件。这些是用于 nam 预测的 grib2 个文件。 This is the main list of directories for each month. Here is my ncml file for the aggregation of this catalog 个文件:

<?xml version="1.0" encoding="UTF-8"?>
<netcdf xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2" >
    <aggregation dimName="time" type="joinExisting">
    <scan location="http://www.ncei.noaa.gov/thredds/dodsC/nam218/201807/20180723/" regExp="^.*\.grb2$" subdirs="false"/>
    <dimension name="time" orgName="t" />
    </aggregation>
</netcdf>

此外,我最感兴趣的是在文件中包含这两个变量:u-component_of_wind_height_above_groundv-component_of_wind_height_above_ground

我不确定 远程 目录中的上述聚合是否正确。我从上面的 ncml 文件中得到这个错误:

There are no datasets in the aggregation DatasetCollectionManager{ collectionName='http://www.ncei.noaa.gov/thredds/dodsC/nam218/201807/20180723/^.*\.grb2$' recheck=null dir=http://www.ncei.noaa.gov/thredds/dodsC/nam218/201807/20180723/ filter=^.*\.grb2$

这个ncml文件应该怎么写?

谢谢。

您不能全局访问远程 URL,因此您需要向聚合提供这些 OPeNDAP 端点的列表,例如:

<dataset name="Nam218" urlPath="nam218">
  <netcdf xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2">
    <aggregation dimName="time" type="joinExisting">
      <netcdf location="http://www.ncei.noaa.gov/thredds/dodsC/nam218/201807/20180723/<file01>.grb2"/>
      <netcdf location="http://www.ncei.noaa.gov/thredds/dodsC/nam218/201807/20180723/<file02>.grb2"/>
      <netcdf location="http://www.ncei.noaa.gov/thredds/dodsC/nam218/201807/20180723/<file03>.grb2"/>
    </aggregation>
  </netcdf>
</dataset>

你可以写一个简单的程序(我用的是c++)在命令提示符中使用。 (我使用 Windows。)它启动一个 BAT 文件,该文件启动 wget 并下载最新的 THREDDS 目录,然后将其保存为纯文本,然后 c++ 程序将整个文件加载到一个字符串中,我在其中解析它并执行操作我想要数据。