apply cdo operator without copy of input file
Added by Christopher Danek almost 5 years ago
Hi
I have a general question: are there possibilities to operate cdo commands directly on a file, without making a copy of the input file? For instance, is it possible to delete specific timesteps directly in a file without the workaround `cdo -delete,timestep=1,3 fin fout && mv fout fin`?
Thanks and kind regards,
Chris
Replies (5)
RE: apply cdo operator without copy of input file - Added by Karin Meier-Fleischer almost 5 years ago
Hi Christopher,
the answer is no. Sorry.
-Karin
RE: apply cdo operator without copy of input file - Added by Christopher Danek almost 5 years ago
Thanks for answer!
RE: apply cdo operator without copy of input file - Added by Ralf Mueller almost 5 years ago
Well, actually there is an undocumented operator currently in a testing phase and it's called apply
with a list of files
ls [0-9][0-9].nc 01.nc 02.nc 03.nc 04.nc 05.nc 06.nc 07.nc 08.nc 09.nc 10.nc 11.nc 12.nc 13.nc 14.nc 15.nc 16.nc 17.nc 18.nc 19.nc 20.nc 21.nc 22.nc
you can for example select a certain region before merging with
cdo -mergetime -apply,selindexbox,1,2,1,2 [ [0-9][0-9].nc ] out.ncWith the latest release you can check it yourself.
Another option is to create a proper command line, but this might be easier with python than with bash. Inserting a CDO operators in front of each filename in a python list is a one-liner...
hth
ralf
RE: apply cdo operator without copy of input file - Added by Christopher Danek almost 5 years ago
Ok thanks for the info
RE: apply cdo operator without copy of input file - Added by Ralf Mueller almost 5 years ago
sorry Christopher, my answer has nothing to do with your question. I got that completely wrong - should take more time for reading before writing I guess
cheers
ralf