Project

General

Profile

mask missing value in timeseries and fill missing value with other dataset

Added by Guillaume S over 6 years ago

Hi,

I have 2 timeseries (1D) with the same time axes and dimensions, but one contains missing value at some dates, while the other one contains only valid values.
I would like to replace the missing values of the first timseries by the valid values from the second one (and keep the valid values from the first dataset elsewhere).
Is it possible to do this with cdo (using mask and mergetime for exemple) ? Thank you.

Best regards,

Guillaume


Replies (1)

RE: mask missing value in timeseries and fill missing value with other dataset - Added by Karin Meier-Fleischer over 6 years ago

Hi Guillaume,

the ifthenelse operator is what you are looking for.

cdo ifthenelse -gtc,-9999 -setmisstoc,-9999 tser1.nc tser1.nc tser2.nc outfile.nc

-Karin

    (1-1/1)