![](/img/trans.png)
[英]Monthly sum of wet days from daily data using Climate Data Operators (CDO)
[英]Monthly sum of of a variable stored at daily timesteps using cdo (Climate Data Operators)
我有一個 40 年的 nc 文件,用於以每日時間分辨率記錄的變量。 我想按月對這些進行總結,並嘗試了以下方法:
cdo monsum inputfile.nc outputfile.nc
雖然這運行沒有錯誤,但我在輸出文件中只得到一幀。 我希望有一個更大的文件。
我認為這可能是輸入文件中的時間問題。
從ncdump-h input file
復制信息:
dimensions:
time = UNLIMITED ; // (14975 currently)
longitude = 40 ;
latitude = 66 ;
variables:
double time(time) ;
time:standard_name = "time" ;
time:units = "days since 1979-1-1 00:00:00" ;
time:calendar = "proleptic_gregorian" ;
time:axis = "T" ;
double longitude(longitude) ;
longitude:standard_name = "projection_x_coordinate" ;
longitude:long_name = "longitude" ;
longitude:units = "degrees_east" ;
longitude:axis = "X" ;
double latitude(latitude) ;
latitude:standard_name = "projection_y_coordinate" ;
latitude:long_name = "latitude" ;
latitude:units = "degrees_north" ;
latitude:axis = "Y" ;
int crs ;
crs:proj4 = "+proj=longlat +datum=WGS84" ;
float variable(time, latitude, longitude) ;
variable :grid_mapping = "crs" ;
variable :_FillValue = -3.4e+38f ;
variable :missing_value = -3.4e+38f ;
variable :proj4 = "+proj=longlat +datum=WGS84" ;
variable :min = 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0. ;
variable :max = 6.5701843261719, 8.62581787109377, 6.24334106445315, 8.29082641601565, 7.59359130859377, 10.0182434082031, 9.76052246093752, 9.95830688476565, 10.3648010253906, 12.8482604980469, 13.1276489257813, 13.1267333984375, 10.9829345703125, 9.82497558593752, 10.1014953613281, 11.8195434570313, 13.9579711914063, 10.0517211914063, 9.37850341796877, 11.3964782714844, 13.0114074707031, 14.4672180175781, 11.4755798339844, 10.6639953613281, 11.3891540527344, 11.9616943359375, 13.7388854980469, 5.56426391601565, 7.07705078125002, 7.64479980468752, 8.25527343750002 ; // global attributes:
:CDI = "Climate Data Interface version 1.9.10 (https://mpimet.mpg.de/cdi)" ;
:Conventions = "CF-1.4" ;
:created_by = "R, packages ncdf4 and raster (version 3.4-10)" ;
:date = "2021-10-06 11:52:06" ;
:history = "Mon Oct 18 13:50:40 2021: cdo setreftime,1979-01-01,00:00:00 kdd_AR_1979_2019.nc kdd_AR_1979_2019_adj.nc\n",
非常感謝幫助。 很抱歉沒有提供一個簡單的可重復示例。 如果需要,我可以通過 we-transfer 或類似方式共享數據。 謝謝!
CDO 使用屬性 proj_params 來標識 proj 參數。 您文件中的相應屬性是 proj4。 您需要重命名此屬性以自動應用 proj 參數:
ncrename -a crs@proj4,proj_params file.nc
完成后,我希望您可以使用 cdo 正確處理文件,讓我知道它是否有效。
感謝 Adrian Tompkins 直接引導我找到答案。 我必須修復此處用作輸入的合並文件的時間軸。 這可以使用settaxis operator
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.