Project

General

Profile

replace missing data in one file with data from another file

Added by Oliver Angelil over 6 years ago

Attached are two files with the same grid (60 time x 96 lon x 73 lat).

Where "GHCND" has missing data, I want to fill it with data from "H2". I want to do this at each grid cell and time step. I will ideally end with a file of the same dimensions but fewer missing values. Can CDO do this?

Thanks.


Replies (2)

RE: replace missing data in one file with data from another file - Added by Oliver Angelil over 6 years ago

This seems to work:

cdo ifthenelse -gtc,-999 -setmisstoc,-999 GHCND_PRCPTOT_1951-2017_RegularGrid_global_2.5x2.5deg_LSmask_3.75x2.5deg_QCmasked.nc GHCND_PRCPTOT_1951-2017_RegularGrid_global_2.5x2.5deg_LSmask_3.75x2.5deg_QCmasked.nc H2_PRCPTOT_1901-2010_RegularGrid_global_3.75x2.5deg_LSmask_QCmasked.nc ofile.nc
    (1-2/2)