[Thread Prev][Thread Next][Index]

Re: [ferret_users] Ferret Question: Fill in combination with conset



Hi,
to fill gaps (for example near land) smoothly please consider to use fill_xy

The following is a technical example. It depends on the problem, if one should do this or not.

use coads_climatology
set region/x=0:90/y=20:90
shade/l=1 sst
fill/over/l=1 sst !as proposed by Hein Zelle
go fland 5

There are a few gaps that could be filled for some purpose. fill_xy is a nearest neighbour filler in two dimensions. (step wise average over all valid neighbour points)

let mask = 1+0*missing(sst,0)
!where mask is "missing" nothing is filled. It could be also "let mask = if y[gy=sst] lt 80 then 1+0*missing(sst,0) else sst/0"

let sst_fill=fill_xy(sst,mask,5)   ! call the fill sequence five times

set win 2
let sst_fill=fill_xy(sst,mask,5)
shade/l=1 sst_fill
fill/over/l=1 sst_fill
go fland 5

! fill much more
set win 3
let sst_fill=fill_xy(sst,mask,25)
shade/l=1 sst_fill
fill/over/l=1 sst_fill
go fland 5

Best,
Martin

Hein Zelle wrote:
Dear Volker, Ansley,

You can get some smoothing in to the contours by regridding the data
to a finer grid.
this is what I usuallyu do with wave data near the coast.  Keep in
mind that you're smoothing data, so you have to be careful that the
data still looks like the original enough.  I typically do either

shade  /lev=(...)  significant_wave_height     ! coarse blocks
fill /over /lev    significant_wave_height     ! overlay smoothed
                                                ! part, doesn't reach coastlines

when that fails, I use scat2gridgauss_xy to regrid the data to a much
finer grid, typically the grid of etopo05 or something similar.  This
has the advantage that you can use scat2grid_gauss to extrapolate
toward the coast a bit, so you don't get so much missing data.

let hs=significant_wave_height
smooth_hs = scat2gridgauss(xsequence(x[g=hs]), \
                            xsequence(y[g=hs]), \
                            xsequence(hs), \
			   x[g=rose], y[g=rose], 0.5, 0.5, 3, 0)

shade smooth_hs
contour /overlay smooth_hs

The resulting contours of a high resolution regrid are typically quite
smooth.  Again, beware of changing the data too much!  You have to
play with the xscale, yscale and cutoff parameters a bit depending on
the data and the target grid.

Kind regards,
      Hein





[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement