Issue with time rebasing
Added by david moreno over 7 years ago
Hi,
I have several (many...) nc files each one with a different reference time, but all of them with the same reference time units (hours since...).
If I cat them all, the catted file does not handle correctly the times.
For example, if I have 3 files with reference times (daily files with hourly data, this is, 24 times in each file):
file 1 > hours since 2009-12-26 00:00
file 2 > hours since 2001-01-01 00:00
file 3 > hours since 2001-02-01 00:00
The catted file (cdo cat file1 file2 file 3 catted_file.nc) will have as reference time hours since 2001-01-01 00:00 BUT when I do ncdump -v time catted_file.nc the result is: -1,0,1,2,3 (...) and the hours of Dec 26-Dec 31 2009 do not appear (should be something like -72,-71, etc).
In addition, they do not come ordered... In this example, the ncdump -v time would dump something like: 24(...)48,0(...)23,-1(...)22... How can I re-order the time axis??
Any help on this? Thanks!
Replies (2)
RE: Issue with time rebasing - Added by Karin Meier-Fleischer over 7 years ago
Hi David,
did you try the operator mergetime to sort the input data by date and time?
cdo -mergetime infile1 infile2 infile3 outfile
If this won't do what you want you can set the same reference time using the setreftime operator
cdo -setreftime,hours since 2001-01-01 00:00 infile outfile
-Karin
RE: Issue with time rebasing - Added by david moreno over 7 years ago
I tried the mergetime but seems like I have too many files... It gives error message "too many fies open".
I can do it catting 20-30 files at a time, but isn't there a simpler way to just re-order/sort the time coordinate of a single nc file?
Sounds like a simple procedure, some cdo or nco utility should do this...