2013-03-05 55 views
2

我們每小時都會從一系列netcdf文件中存儲的海洋模型輸出,每個月一個。使用ncml來聚合netcdf文件?

我們在每個文件中存儲月份的第一個小時和最後一個小時。我們希望使用NcML來聚合這些文件,但我們不希望在聚合中獲得重複的時間值。

有沒有辦法做到這一點?

回答

2

在NCML中,您可以使用NCOORDS來準確指定要使用的記錄數。因此,爲避免重複的時間值,您可以爲每個月指定NCOORDS,比您目前的要少。因此,對於非閏年,你可能聚集這樣指定:

<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"