Project

General

Profile

Multiply only one variable by a constant

Added by Amali, AMALI over 2 years ago

I have a land mask dataset (dir_msk) with a variable 'sftlf' that I wish to divide by 100.
I am using a chained operation.

cdo.fldsum(input='-mul {} -mul {} -gridarea {}'.format(dir_in, dir_msk, dir_in), output=out_dir +'weighted.nc')

Is there a way I can do this directly in cdo, say on the same line of code or otherwise?

Regards,
Amali


Replies (1)

RE: Multiply only one variable by a constant - Added by Ralf Mueller over 2 years ago

hi Amali!

do I get it right, that you want to know corresponding call on the command line?

in that case, rerun your python code after setting

cdo.debug = True
This will bring the command line used internally.

hth
ralf

    (1-1/1)