NcML可以用来聚合3D和4D网格吗?我不确定,因为它们在维度的数量上不同。例如,海面高度( ssh )和水温,其中ssh具有三维时间,纬度,经度,温度具有四个维度时间,深度,纬度,经度?我的测试没有成功,所以我的直觉是我必须将3D和4D变量分解成单独的目录。但我希望其他人能有其他的建议?
虽然我尝试使用以下代码片段的“联合”聚合,但时间维度没有得到适当的映射,因为3D变量从2008-12-28开始,4D变量从2008-05-08开始:
<?xml version="1.0" encoding="UTF-8"?>
<netcdf xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2">
<attribute name="title" value="HYCOM test aggregation #1"/>
<aggregation type="union">
<!-- These are the 3D variables: -->
<netcdf location="dods://apdrc.soest.hawaii.edu:80/dods/public_data/Model_output/HYCOM/global/hycom2d"/>
<!-- These are the 4D variables: -->
<netcdf location="dods://apdrc.soest.hawaii.edu:80/dods/public_data/Model_output/HYCOM/global/hycomT"/>
<netcdf location="dods://apdrc.soest.hawaii.edu:80/dods/public_data/Model_output/HYCOM/global/hycomS"/>
<netcdf location="dods://apdrc.soest.hawaii.edu:80/dods/public_data/Model_output/HYCOM/global/hycomU"/>
<netcdf location="dods://apdrc.soest.hawaii.edu:80/dods/public_data/Model_output/HYCOM/global/hycomV"/>
</aggregation>
</netcdf>然后我在"time“维度上尝试了一个"joinExisting”聚合,但只有在每个数据集都包含相同的变量时才有效(实际上并不是这样)。根据我在聚合中首先列出的数据集,在下面的示例中排除3D或4D变量:
<?xml version="1.0" encoding="UTF-8"?>
<netcdf xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2">
<attribute name="title" value="HYCOM test aggregation #2"/>
<aggregation dimName="time" type="joinExisting">
<!-- These are the 3D variables: -->
<netcdf location="dods://apdrc.soest.hawaii.edu:80/dods/public_data/Model_output/HYCOM/global/hycom2d"/>
<!-- These are the 4D variables: -->
<aggregation type="union">
<netcdf location="dods://apdrc.soest.hawaii.edu:80/dods/public_data/Model_output/HYCOM/global/hycomT"/>
<netcdf location="dods://apdrc.soest.hawaii.edu:80/dods/public_data/Model_output/HYCOM/global/hycomS"/>
<netcdf location="dods://apdrc.soest.hawaii.edu:80/dods/public_data/Model_output/HYCOM/global/hycomU"/>
<netcdf location="dods://apdrc.soest.hawaii.edu:80/dods/public_data/Model_output/HYCOM/global/hycomV"/>
</aggregation>
</aggregation>
</netcdf>那么,有没有办法聚合这些数据集?我必须将3D和4D变量分开吗?
感谢夏威夷大学马诺阿分校的约翰·毛雷尔太平洋岛屿海洋观测系统(PacIOOS)
发布于 2013-04-24 04:52:37
约翰
由于要加入的文件具有不同的时间坐标,但具有相同的名称,因此需要重命名其中一个文件。我本以为这个简单的NcML会起作用,只需在3D数据中重命名时间维度和时间变量的维度和名称
<?xml version="1.0" encoding="UTF-8"?>
<netcdf xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2">
<attribute name="title" value="HYCOM test aggregation #1"/>
<aggregation type="union">
<!-- These are the 3D variables: -->
<netcdf location="dods://apdrc.soest.hawaii.edu:80/dods/public_data/Model_output/HYCOM/global/hycom2d">
<dimension name="time2d" orgName="time"/>
<variable name="time2d" orgName="time"/>
</netcdf>
<!-- These are the 4D variables: -->
<netcdf location="dods://apdrc.soest.hawaii.edu:80/dods/public_data/Model_output/HYCOM/global/hycomT"/>
<netcdf location="dods://apdrc.soest.hawaii.edu:80/dods/public_data/Model_output/HYCOM/global/hycomS"/>
<netcdf location="dods://apdrc.soest.hawaii.edu:80/dods/public_data/Model_output/HYCOM/global/hycomU"/>
<netcdf location="dods://apdrc.soest.hawaii.edu:80/dods/public_data/Model_output/HYCOM/global/hycomV"/>
</aggregation>
</netcdf>但它没有,因为不知何故,NetCDF-Java似乎在我们更改变量和维度名称之前添加了一个带有"time lon lat“值的属性_CoordinateAxes。因此,如果我们从3D数据中删除该属性,它就会起作用:
<?xml version="1.0" encoding="UTF-8"?>
<netcdf xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2">
<attribute name="title" value="HYCOM test aggregation #1"/>
<aggregation type="union">
<!-- These are the 3D variables: -->
<netcdf location="dods://apdrc.soest.hawaii.edu:80/dods/public_data/Model_output/HYCOM/global/hycom2d">
<dimension name="time2d" orgName="time"/>
<variable name="time2d" orgName="time"/>
<variable name="qtot">
<remove type="attribute" name="_CoordinateAxes"/>
</variable>
<variable name="emp">
<remove type="attribute" name="_CoordinateAxes"/>
</variable>
<variable name="t_trend">
<remove type="attribute" name="_CoordinateAxes"/>
</variable>
<variable name="s_trend">
<remove type="attribute" name="_CoordinateAxes"/>
</variable>
<variable name="ssh">
<remove type="attribute" name="_CoordinateAxes"/>
</variable>
<variable name="mld">
<remove type="attribute" name="_CoordinateAxes"/>
</variable>
<variable name="mlp">
<remove type="attribute" name="_CoordinateAxes"/>
</variable>
</netcdf>
<!-- These are the 4D variables: -->
<netcdf location="dods://apdrc.soest.hawaii.edu:80/dods/public_data/Model_output/HYCOM/global/hycomT"/>
<netcdf location="dods://apdrc.soest.hawaii.edu:80/dods/public_data/Model_output/HYCOM/global/hycomS"/>
<netcdf location="dods://apdrc.soest.hawaii.edu:80/dods/public_data/Model_output/HYCOM/global/hycomU"/>
<netcdf location="dods://apdrc.soest.hawaii.edu:80/dods/public_data/Model_output/HYCOM/global/hycomV"/>
</aggregation>
</netcdf>这是来自ToolsUI的结果数据集的屏幕截图,其中您可以看到3D和4D变量:

https://stackoverflow.com/questions/16177438
复制相似问题