[Thread Prev][Thread Next][Index]

Re: [ferret_users] shifted longitude problem with scat2gridgauss_xy

Hi Lev,
The SCAT2GRID functions don't apply modulo shifting to the scattered X location data.  The note in the SCAT2GRIDGAUSS_XY documentation in the Users Guide is

If the output X axis is a modulo longitude axis, then the scattered X values should lie within the range of the actual coordinates of the axis. That is, if the scattered X values are xpts={355, 358, 2, 1, 352, 12} and the coordinates of the X axis you wish to grid to are longitudes of x=20,23,25,...,379 then you should apply a shift to your scattered points ...
This means that, for instance, if your variable xln cpntains values such as x= {-2, -3, 0.4, 1., 19}

and if you define an axis,

DEFINE AXIS/X=4.75W:119.25E:0.5/UNIT=DEGREE xlone5fb

The values on the X axis are used in the function as 355.25, 355.75, ...
yes? set list/prec=6
yes? list x[gx=xlone5fb]
             VARIABLE : X
                        axis XLONE5FB
             SUBSET   : 249 points (LONGITUDE)
 4.75W    /   1:  355.250
 4.25W    /   2:  355.750
 3.75W    /   3:  356.250
 3.25W    /   4:  356.750
 2.75W    /   5:  357.250

And so you would need to add 360 to xln before calling the function. Or, you could define your axis starting with x= -4.75E  as follows to perhaps match the modulo branch that the scattered x values lie in:

yes? DEFINE AXIS/X=-4.75E:119.25E:0.5/UNIT=DEGREE xlone5fb
yes? list x[gx=xlone5fb]
             VARIABLE : X
                        axis XLONE5FB
             SUBSET   : 249 points (LONGITUDE)
 4.75W   /   1:   -4.750
 4.25W   /   2:   -4.250
 3.75W   /   3:   -3.750
 3.25W   /   4:   -3.250
 2.75W   /   5:   -2.750

Is this the kind of thing that you're seeing??


Lev Tarasov wrote:


DEFINE AXIS/X=1:2000:1 xin
DEFINE GRID/X=xin  gin
FILE/SKIP=1/VAR="cn,ylt,xln,bedRfr,tillcode" /GRID=gin NOR_2212DriftThickKleman.dat

DEFINE AXIS/X=0.25E:119.25E:0.5/UNIT=DEGREE xlone5fb
works for
LET bedR1 = scat2gridgauss_xy (xln,ylt, bedRfr[d=1], x[gx=xlone5fb], y[gy=ylate25f], 0.5,0.5, 0.9,0)

DEFINE AXIS/X=4.75W:119.25E:0.5/UNIT=DEGREE xlone5fb
shifts the data eastward about 10 degrees.

And I need to grid to a Longitude grid that crosses 0 Longitude.

I'm using         FERRET v5.81,         Linux(g77) 2.4.21-32 - 07/14/05

How do I fix this? It's a problem I've run into the past as well, and
have crudely just shifted the input longitudes in scat2gridgauss_xy but
I'm hoping a better fix is available.



[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement