Project

General

Profile

calculating daily climatology from multi-file dataset

Added by Don Murray about 11 years ago

Hi-

I have daily data which each year in a separate file, e.g.:

temp2_echam5_amip_vary_ghg_mean_1980.nc
temp2_echam5_amip_vary_ghg_mean_1981.nc
temp2_echam5_amip_vary_ghg_mean_1982.nc
temp2_echam5_amip_vary_ghg_mean_1983.nc
temp2_echam5_amip_vary_ghg_mean_1984.nc
temp2_echam5_amip_vary_ghg_mean_1985.nc
temp2_echam5_amip_vary_ghg_mean_1986.nc
temp2_echam5_amip_vary_ghg_mean_1987.nc
etc

I want to create a 30 year climatology from these files and was thinking of using ydaymean. However, ydaymean doesn't take multiple files (at least from the docs). What's the best way to going about this? The files are large so combining them into one 30year file might not be the best thing to do.

Thanks for any help you can give.

Don


Replies (6)

RE: calculating daily climatology from multi-file dataset - Added by Ralf Mueller about 11 years ago

With 1.5.9 you can use wildcards with the cat operators. So you might try something like this:

cdo yeardaymean -cat "temp2_echam5_amip_vary_ghg_mean_19*.nc" climate.nc

hth
ralf

RE: calculating daily climatology from multi-file dataset - Added by Uwe Schulzweida about 11 years ago

For this feature the wildcards have to be expanded in CDO and not by the Shell. Therefor single quotes must be used:

cdo yeardaymean -cat 'temp2_echam5_amip_vary_ghg_mean_19*.nc' climate.nc

RE: calculating daily climatology from multi-file dataset - Added by Don Murray about 11 years ago

Ralf and Uwe-

Thanks for the suggestions. Are only simple wildcards allowed, or can I use more complex regular expressions. Since I'll be going over 30 years and want to exclude some of the files, a simple 19* won't work.

Don

RE: calculating daily climatology from multi-file dataset - Added by Uwe Schulzweida about 11 years ago

Hi Don,

We implemented a simple pattern matching via glob [http://en.wikipedia.org/wiki/Glob_%28programming%29]. Allowed wildcards are `*', `?' or `[ characters ]'.

Uwe

RE: calculating daily climatology from multi-file dataset - Added by Argel Ramírez Reyes about 6 years ago

Hi! I'm just starting to use CDO.

In some posts I have seen the answer "As all CDO operators with an unlimited number of input files this operator can't be combined with other operators.", but the first option appears to overcome that limitation. Is there something I am missing?
Thanks!

RE: calculating daily climatology from multi-file dataset - Added by Ralf Mueller about 6 years ago

if you use operators like 'cat' or merge together with a wildcard your can more operators on top of the results of therese operations. But operators output cannot be used for input of 'cat' or 'merge'

hth
ralf

    (1-6/6)