Project

General

Profile

cdo settime

Added by Gg La almost 10 years ago

hello,

I have a netcdf file, with a variable Times. One step of this variable is not defined:

ncdump -v,Times fic.nc

Times =

"2042-07-30_00:00:00",
"2042-07-30_03:00:00",
"2042-07-30_06:00:00",
"2042-07-30_09:00:00",
"2042-07-30_12:00:00",
"2042-07-30_15:00:00",
"2042-07-30_18:00:00",
"2042-07-30_21:00:00",
"2042-07-31_00:00:00",
"2042-07-31_03:00:00",
"2042-07-31_06:00:00",
"2042-07-31_09:00:00",
"2042-07-31_12:00:00",
"2042-07-31_15:00:00",
"2042-07-31_18:00:00",
"2042-07-31_21:00:00",
"2042-08-01_00:00:00",
"2042-08-01_03:00:00",
"2042-08-01_06:00:00",
"2042-08-01_09:00:00",
"2042-08-01_12:00:00",
"2042-08-01_15:00:00",
"2042-08-01_18:00:00",
"",
"2042-08-02_00:00:00",
"2042-08-02_03:00:00",
...

How can I add the missing time step , "2042-08-01_21:00:00" with cdo ?

Thank you


Replies (6)

RE: cdo settime - Added by Jaison-Thomas Ambadan almost 10 years ago

try selecting a particular timestep/date, reset the time, and then merge to the original file; like

cdo -f nc -b F64 -mergetime -setrtomiss,-9e31,9e31 -settime,21:00:00 -seldate,2042-08-01T18:00:00 ifile ifile ofile

Also, I think it is better to set all the values of that particular timestep to "missing/_FillValue" unless you really want to change to something else

RE: cdo settime - Added by Gg La almost 10 years ago

the values of this time step are not missing.
I just want to define correctly "Times"
I should have "2042-08-01_21:00:00", and I have " ".

RE: cdo settime - Added by Jaison-Thomas Ambadan almost 10 years ago

sorry, I thought that particular timestep is missing somehow

try using settaxis operator to fix the time axis

RE: cdo settime - Added by Gg La almost 10 years ago

I have tried:
cdo settaxis,2042-07-30,00:00:00,3hour ifile ofile
but I get
Times = 20420730, 20420730.125, 20420730.25, 20420730.375, 20420730.5,
20420730.625, 20420730.75, 20420730.875, 20420731, 20420731.125,
20420731.25, 20420731.375, 20420731.5, 20420731.625, 20420731.75,
20420731.875, 20420801, 20420801.125, 20420801.25, 20420801.375,
20420801.5, 20420801.625, 20420801.75, 20420801.875, 20420802,
20420802.125, 20420802.25, 20420802.375, 20420802.5, 20420802.625,
20420802.75, 20420802.875, 20420803, 20420803.125, 20420803.25,
20420803.375, 20420803.5, 20420803.625, 20420803.75, 20420803.875,
20420804 ;

RE: cdo settime - Added by Jaison-Thomas Ambadan almost 10 years ago

It is NetCDF way [CF convention]of storing the time info. I do not think that is wrong. Please have a look at the section 25 Absolute time in this [I couldn't find an updated document] http://www-pcmdi.llnl.gov/drach/GDT_convention.html

If you want to check the time stamps of your file, use: sinfov or showtimestamp operators or

cdo outputtab,date,time ifile

RE: cdo settime - Added by Gg La almost 10 years ago

Thanks.
But for some reason, when I use settaxis, it also changes all the dimensions name, and
my variable Times become a dimension ...

    (1-6/6)