Project

General

Profile

mergegrid variable scores

Added by Maria Volgler over 4 years ago

hi guys, i am fairly new to cdo and need some help ;)
i have a world_grid.nc and some regional_grid.nc they are all the same grid, variables etc.
now i try to megre them, so the worldgrid-pixels get the reginal-pixel-value when they overlap and the regional-pixel is not NAN.
i use: mergegrid world_grid.nc regional_grid.nc output.nc
this works and gives me a global raster, but the overlap pixels do not have the values of the regional-grid, but the difference between both grids.
how do i change that? i only want the original reginal values?!
thanks a lot!


Replies (1)

RE: mergegrid variable scores - Added by Karin Meier-Fleischer over 4 years ago

Hi Maria,

just to understand, you want to 'exchange' the values of world_grid.nc by regional_grid.nc, right?

Assuming that

- world_grid.nc has 180 x 90 (lon x lat)

- regional_grid.nc has 180 x 90 (lon x lat) and contains missing values

You can use the ifthenelse operator to exchange the values but you have to set the missing value of regional_grid.nc to 0. See https://code.mpimet.mpg.de/projects/cdo/embedded/index.html#x1-1870002.4.2.

cdo ifthenelse -setmisstoc,0 regional_grid.nc regional_grid.nc world_grid.nc outfile.nc

-Karin

    (1-1/1)