[Thread Prev][Thread Next][Index]

Re: [ferret_users] @FNR in 2D fills up x dimension first



Hi Hella,

Only a few of the transformations are calculated in multiple dimensions.  Most apply the operation one direction at a time as you're seeing here. For transformations in general,

Transformations are normally computed axis by axis; if multiple axes have transformations specified simultaneously (e.g., U[Z=@AVE,L=@SBX:10]) the transformations will be applied sequentially in the order X then Y then Z then T. ...
only averages and definite integrals are computed using multiple dimensions, as they involve area calculations, and NGD and NBD also count over all dimensions given.  So yes, the filling transformations fill in X then in Y, etc.

Ansley


On 6/28/2018 7:37 AM, Hella Riede wrote:
Hello ferret community,

I am using @FNR in two dimensions and got an unexpected result (see ferret script at end of this mail):

In the attached ferret_before_FNR.png, the original 2D grid cells are shown (values inherited from dots by scat2grid, see below).

ferret_after_FNR.png shows the result after applying @FNR (fill with nearest neighbor) in 2 dimensions.

As an example for the unexpected result, lets take the grid cell at (x=8,y=5). Its value before @FNR was undefined. The nearest neighbor is (x=8,y=8). Yet, the value is inherited from (x=2,y=4).

Is @FNR not supposed to be applied in 2D or is the logic behind different from what I expected? It seems the missing points are always filled up in x dimension first, and only remaining missing values are then filled up in y direction ...

I attached a manual version of what I would have expected as ferret_FNR_expected.png.


Thank you very much in advance for helping to clarify this.


Best regards,
Hella Riede




can var/all
can sym/all

let a   = {1,1,8,8,2}
let b   = {1,8,8,1,4}
let val = {2,4,6,8,10}

def ax/x=1:8:1 xax
def ax/y=1:8:1 yax

def sym lev = (1.5,10.5,1)

!! assign values from dots to grid cells
set win 1
let gridded = SCAT2GRIDGAUSS_XY(a,b,val,x[gx=xax],y[gy=yax],0.8,0.8,0.8,0)
shade/lev=($lev) gridded
!! plot original scattered values for comparison
go polymark poly/lev=($lev)/key/ov/line/fill a b val circle 2


!! fill up undefined values with nearest neighbor
set win 2
let nn = gridded[x=@FNR,y=@FNR]
shade/lev=($lev) nn
go polymark poly/lev=($lev)/key/ov/line/fill a b val circle 2



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

Privacy Policy | Disclaimer | Accessibility Statement