Project

General

Profile

Extrapolate coarse grid to finer grid mask

Added by Anne Moree over 6 years ago

Hello again!
Thank you for your previous help, I have another puzzle which I have not been able to solve by myself:

I want to extrapolate a course ocean surface (2D) dataset to a land-ocean mask that is smaller than the one it is on. My question is similar to: https://code.mpimet.mpg.de/boards/2/topics/5806.
My target mask is smaller partly because it has a finer resolution than the dataset, partly because sea-level is lower in the dataset.

I have a pmask variable available for the desired land-ocean mask (1 or 0 values). I already regridded to the desired grid (using remapbil) earlier in the process.
The function remapnn does not extrapolate onto the whole missing ocean area.
'export REMAP_EXTRAPOLATE=on' did not make a difference for this. The undocumented fillmiss (https://code.mpimet.mpg.de/boards/2/topics/3087) does not work for curvilinear grids.
It would be fine for me to extrapolate over the whole missing area (so including the part that later on will be land), and then multiply with the pmask which I have to get the correct mask.

What function could I use here?

Cheers,
Anne


Replies (2)

RE: Extrapolate coarse grid to finer grid mask - Added by Ralf Mueller over 6 years ago

hi Anne!

check the operator setmisstonn. it works for any grid, but fills the missing area with nearest neighbor values instead of linear interpolation. IMO the tricky part in these workflows is the correct handling of source and target land-sea-masks.

The wish for extrapolation on a nearest-neighbor interpolation seem a little contradictory, because that's what this type of interpolation is made for anyway. But without your data files I can only guess around a bit.

you might have a look to this on slide 14 - CDO offers other techniques, too: https://code.mpimet.mpg.de/boards/53/topics/4511

hth
ralf

RE: Extrapolate coarse grid to finer grid mask - Added by Anne Moree over 6 years ago

Hello Ralf!

Thank you, I like the result of the setmisstodis best.
Multiplication with the land-sea mask (1 in ocean, 0 on land) then leaves the ocean values, which is what I need.
cdo mul infile.nc maskfile.nc outfile.nc

Thanks again and have a nice day/evening,
Anne

    (1-2/2)