! test gridding scattered points to modulo axis. 
! Show Southern hemisphere.

use coads_climatology

let xpts = 360*randu(i+10)-180; let ypts = 80*randu(i) -80
let sstpts = samplexy(sst[l=1], xpts[i=1:1000], ypts[i=1:1000])

def axis/x=180w:180e:1/modulo xax
def axis/y=-89:0:1 yax
def grid/x=xax/y=yax mygrid

let a  = scat2gridgauss_xy (xpts[i=1:1000], ypts[i=1:1000], sstpts, x[gx=mygrid], y[gy=mygrid], 6, 1, 6, 6)

let b = if sst[l=1,gx=mygrid,gy=mygrid] then a

shade b
plot/vs/over xpts[i=1:1000]+360, ypts[i=1:1000]
