[Thread Prev][Thread Next][Index]

Re: [ferret_users] Interpolation 2D issue



Hi Ferreters,
I am wandering if there exists any functions which do almost the same as SBX and SHN but on the boundary where there are not sufficient number of neighbours they just take the neighbouring sites only at the interior direction where the neighbours exist.
They could really help me.

kind regards,
Szymon Roziewski

2011/3/11 Szymon Roziewski <szymon.roziewski@xxxxxxxxx>
Yes, I found it.
But when I was searching through the manual pdf I had to overlook it.
Thank you.

2011/3/11 Martin Schmidt <martin.schmidt@xxxxxxxxxxxxxxxxx>

Please go to the ferret web site, documentation, open the index, click "m" and scroll down
to "missing function"

Best,
martin
Szymon Roziewski wrote:
Hi Martin,
It looks very nice.
I have to try out this but I don't really know what the function missing does. I had a look at manual and searched ferret site but there's no anything about this function.

Kind regards,
Szymon Roziewski

2011/3/9 Ansley Manke <Ansley.B.Manke@xxxxxxxx <mailto:Ansley.B.Manke@xxxxxxxx>>


   Hi -
   We had noticed recently that documentation for fill_xy was missing
   from the manual. Your email here gives a nice example that we can
   use there.

   Ansley


   On 3/9/2011 7:16 AM, Martin Schmidt wrote:

       Hi,
       you are right, the documentation did not find its way into the
       manual. It is easy anyway. The mask needs to be
       1 where filling is allowed and zero otherwise. Please try the
       following

       yes? use coads_climatology
       yes? let mask=missing(sst/sst,1)
       yes? shade/l=1 mask
       yes? shade/l=1 fill_xy(sst,mask,5)
       Filling is allowed

       !Now missings at land
       yes? let mask=sst/sst
       yes? shade/l=1 mask
       yes? shade/l=1 fill_xy(sst,mask,5)
       Nothing is filled.

       And now:
       yes? let mask= if y[gy=sst] gt 0 then missing(sst/sst,1) else
       sst/sst
       yes? shade/l=1 fill_xy(sst,mask,5)

       Now filling happens in the northern hemisphere.

       Hope this helps,
       Martin

       Szymon Roziewski wrote:

           Dear Martin / Ferreters,
           I have problem with using fill_xy function. I saw some
           examples and read sth in the ferret archives but I still
           stuck.
           I try to explain my issue.
           This is reading an ice field and putting into a lndseaf. I
           also quote the grid definition.

           DEFINE AXIS/X=-5.666666667:5.25:0.083333333/unit=degree xlon
           DEFINE AXIS/Y=-2.0:10.0:0.083333333/unit=degree ylat
           DEFINE GRID/x=xlon/y=ylat grid_xlon_xlat
           file/skip=1/format=(80f1.0/52f1.0)/columns=132/grid=grid_xlon_xlat/var=lndseaf
           ICE.DAT

           Then I interpolate the lndseaf onto a fine grid.

           DEFINE AXIS/X=-5.666666667:5.25:0.010416667/unit=degree xfine
           DEFINE AXIS/Y=-2.0:10.0:0.010416667/unit=degree yfine !1/8
           DEFINE GRID/x=xfine/y=yfine grid_xfine_yfine
           let ice_regridded lndseaf[gxy=grid_xfine_yfine]

           What I did next was make the mask.

           let mask = ice_regridded/ice_regridded

           And I used the mask with fill_xy as the following

           let ice_ext = fill_xy(ice_regridded,mask,5)

           But It didn't change anything. I tried out using different
           values of third argument of fill_xy. However, I didn't
           improve at all.
           So, I think either I was using fill_xy badly or I
           misunderstood something.

           I also tried out FLN function as follows

           let ext = ice_regridded[x=@FLN:50,y=@FLN:50]

           But this resulted with no changes to the ice_regridded as
           well.
           I attach ICE.DAT to make it more real.

           Kind regards,
           Szymon Roziewski



           2011/3/9 Martin Schmidt <martin.schmidt@xxxxxxxxxxxxxxxxx
           <mailto:martin.schmidt@xxxxxxxxxxxxxxxxx>
           <mailto:martin.schmidt@xxxxxxxxxxxxxxxxx
           <mailto:martin.schmidt@xxxxxxxxxxxxxxxxx>>>

              Dear Szymon,

              you may use fill_xy(data, mask, 2) before you filter
           data. This
              extrapolates the data smoothly into land by two points
           and the
              filter @SBX and @SHN
              can do something reasonable near land too. Applying
           your land mask
              later removes remaining extrapolated points.

              Greetings,
              Martin

              Szymon Roziewski wrote:

                  Dear Ferreters,

                  I have an ice field that is a matrix filled by 0 or
           1. Because
                  of weak resolution I need it to be interpolated on
           a finer grid.
                  I tried out two approaches.
                  The first, I interpolated with using @SBX and @SHN
           functions.
                  Basically, I got neat result except to the boundary
           where I
                  got a lack of data. Because this functions don't
           have data to
                  interpolate and ending up with 0 value.
                  As the second I used scat2gridgauss_xy function
           which gave me
                  smoother result but near the boundary I got the ice
           that
                  should not to be. I think that this function is do
           smooth the
                  data sometimes to much.

                  Have any of you had something similar with it?
                  Maybe there are some good ferret functions to
           interpolate ice
                  field which is 0 or 1.

                  I attach two graphics for better explanation.

                  Kind regards,
                  Szymon Roziewski





           --             Z wyrazami szacunku,
           Szymon Roziewski





--
Z wyrazami szacunku,
Szymon Roziewski




--
Z wyrazami szacunku,
Szymon Roziewski



--
Z wyrazami szacunku,
Szymon Roziewski

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

Privacy Policy | Disclaimer | Accessibility Statement