Integration between 'show' and 'sel' timestamp operators
Added by Kieran Lynch almost 12 years ago
Hi,
I'm assuming this isn't currently possible but is there a way of using the 'showtimestamp' operator to print out the timestamps to a text file then use a 'seltimestamp' command to select a range of timestamps in a new file (a bit like you can with the seltimestep operator)?
An example would using the timestamps in a forecast to select the same days from the reanalysis data:
cdo showtimestamp forecast_file.grb > forecast_timestamps.txt
cdo seltimestamp,$(cat forecast_timestamps.txt) reanalysis_file.grb reanalysis_output.grb
Does this make sense? It would be a powerful feature allowing two way interaction between the operators and save you from having to manipulate the timestamps in another program.
Kind Regards,
Kieran
Replies (3)
RE: Integration between 'show' and 'sel' timestamp operators - Added by Jaison-Thomas Ambadan almost 12 years ago
Hi,
I think you can still do the same in one step like:
cdo -seltimestamp,$(cdo -showtimestamp forecast_file.grb) reanalysis_file.grb reanalysis_output.grb
is that what you mean?
Cheers,
J
RE: Integration between 'show' and 'sel' timestamp operators - Added by Ralf Mueller almost 12 years ago
cdo supports a range notation for integers. if you can use seltimestep instead of seltimestamp, this might be useful.
RE: Integration between 'show' and 'sel' timestamp operators - Added by Kieran Lynch almost 12 years ago
@Jason
Yes you're right that is a more efficient way of expressing the same task. However, there doesn't seem to be a 'seltimestamp' operator yet?
I have been using 'seltimestep' and am aware of the range notation for integers but am wanting to extract consecutive chunks of data (beyond the capabilities of the range notation).