2013-04-23 117 views
1

NcML可以用來聚合3D和4D網格嗎?我不確定,因爲他們的維度數量不同。例如海面高度(ssh)和水溫,其中ssh有三個維度[時間,經度,緯度],溫度有四個維度[時間,深度,緯度,經度]。我的測試不成功,所以我的直覺是我必須將3D和4D變量分解成單獨的目錄。但我希望別人可能有其他建議?遠程3D和4D變量的NcML聚合?

雖然我嘗試使用下面的代碼片段一個「聯盟」聚集,時間維度沒有得到適當的映射,因爲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> 

然後我在「時間」維上嘗試了「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)夏威夷大學 馬諾阿

回答

1

約翰,

既然你要加入的文件有不同的時間座標,但具有相同的名稱,您需要重命名其中一個。我本來以爲,這個簡單的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> 

這裏的AA截圖來自ToolsUI所產生的數據集,在這裏你可以看到3D和4D變量:

+0

佑呼!這樣可行!好主意,Rich。非常感謝。 – 2013-04-23 22:14:33