[Thread Prev][Thread Next][Index]

Re: [ferret_users] erratic IF masking behaviour




Hi Lev,

The problem here is due to when the interpolation is being carried out due to the interpolation mode being set.

You are getting the interpolated value of HDF rather than rather than a value of HDF based on interpolating HDHF and HD and getting the appropriate value with the mask. The IF condition is calculated/evaluated on the original grid.

Therefore you need to define a new mask on the grid to which you are interpolating::

let ifhfnew = ifhf[g=newgrid]                         ! Interpolate the mask
let hdf= IF ifhfnew eq 1 then hdhf else hd ! Get a value based on the new mask

! or explicitly... let hdf= IF ifhfnew eq 1 then hdhf[g=newgrid] else hd[g=newgrid]


Cheers,
Russ


On 11/12/13 14:35, Lev Tarasov wrote:
Why does the IF condition not work in the
masking below and how do I fix this:
(ie CONDITION should be false, but hdf doesn't take on
the ELSE value of hd)

let hdf= IF ifhf eq 1 then hdhf else hd

yes? list ifhf
             VARIABLE : IF HFB GT HDG THEN 1 ELSE 0
             FILENAME : idHhpt.nn9927
             LONGITUDE: 69W (interpolated)
             LATITUDE : 41.5N (interpolated)
             T        : -20
          0.5000

yes? list hd
...
             LONGITUDE: 69W (interpolated)
             LATITUDE : 41.5N (interpolated)
          36.75
yes? list hdf
...
             LONGITUDE: 69W (interpolated)
             LATITUDE : 41.5N (interpolated)
          35.50

note using
     NOAA/PMEL TMAP
     FERRET v6.401
     Linux(g77) 2.6.9-89.ELsmp - 12/09/09
     11-Dec-13 00:05


Cheers,

lev

Lev Tarasov -   Dept of Physics and Physical Oceanography,
        Memorial University of Newfoundland.
                email: lev@xxxxxx
                http://www.physics.mun.ca/~lev/
             Currently at Antarctic Research Centre,
                Victoria University of Wellington




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

Privacy Policy | Disclaimer | Accessibility Statement