cdo mergetime: behavior when values overlap
Added by Jed Kaplan over 6 years ago
Reading the documentation, it is not clear to me what
cdo mergetime infile1 infile2 outfiledoes when merging datasets that overlap in time. Does it:
- Return the average of the values between the two files in the overlapping period?
- Choose data from one file or the other?
- Paste the two files together, reproducing the overlapping period?
I would prefer if CDO did option (1) above, but it would be good to know what actually is going on.
Many thanks,
Jed
Replies (6)
RE: cdo mergetime: behavior when values overlap - Added by Jed Kaplan over 6 years ago
Running some tests, it looks like CDO actually does option(3), reproducing the period that overlaps in time. I would be grateful if anyone could propose a method using CDO that would give me what I want, a merge of two files, with the period overlapping in time being the average between the files.
Many thanks again,
Jed
RE: cdo mergetime: behavior when values overlap - Added by Ralf Mueller over 6 years ago
Hi Jed!
in order to average the overlapping time, you have to select these timesteps (possible operators: select
,seltimestep
) and do the averaging manually (add
, divc,2
). The oneline could look like this
cdo -divc,2 -add -select,mon=3/4 <ifile1> -select,mon=3/4 <ifile2> <ofile>
hth
ralf
RE: cdo mergetime: behavior when values overlap - Added by Shafiqah M over 6 years ago
Hi, I am having the same situation as Jed. I had tried to run the command that you suggested "cdo -divc,2 -add -select,mon=3/4 <ifile1> -select,mon=3/4 <ifile2> <ofile>", but the operator responded "Too many mainstream and the operator need 1 input and 1 output streams."
Can you help me to solve this?
RE: cdo mergetime: behavior when values overlap - Added by Ralf Mueller over 6 years ago
Shafiqah M wrote:
Hi, I am having the same situation as Jed. I had tried to run the command that you suggested "cdo -divc,2 -add -select,mon=3/4 <ifile1> -select,mon=3/4 <ifile2> <ofile>", but the operator responded "Too many mainstream and the operator need 1 input and 1 output streams."
Can you help me to solve this?
not without
- your input files
- the precise call, you are using
RE: cdo mergetime: behavior when values overlap - Added by Shafiqah M over 6 years ago
The data are hourly temperature data. The command that I used is
cdo -divc,5 -add -select,timestep=1/201624 file1.nc -select,timestep=1/201621 file2.nc -select,timestep=1/201621 file3.nc -select,timestep=1/201623 file4.nc -select,timestep=1/201623 file5.nc kb.nc
Thank you.
RE: cdo mergetime: behavior when values overlap - Added by Ralf Mueller over 6 years ago
I don't see an obvious bug in the command line, but, as I said, without the actual files I cannot know whats going on.
-ralf