Project

General

Profile

Integration between 'show' and 'sel' timestamp operators

Added by Kieran Lynch about 11 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 about 11 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 about 11 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 about 11 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?

@Ralf Thehos

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).

    (1-3/3)