Spherical gridding example
The below is an example of spherical gridding using the sph_scat function.
;example
window,0,xs=600,ys=400
loadct,13
npoints=10
random_lats=randomu(seed,npoints)*180-90
random_lons=randomu(seed,npoints)*360-180
random_vals=randomu(seed,npoints)*100
random_lats(npoints-1)=40
random_lons(npoints-1)=-80
random_vals(npoints-1)=100
plot,random_lons,random_lats, $
xrange=[-180,180],/xstyle, $
yrange=[-90,90],/ystyle, $
xticks=4,yticks=6,color=100, $
psym=4,symsize=0.5
for i=0,npoints-1 do xyouts,random_lons(i),random_lats(i), $
strcompress(fix(random_vals(i)),/remove_all),charsize=1.5,/data
bounds=[-130,0,-30,80]
position=fltarr(4)
coord1=convert_coord(bounds(0),bounds(1),/data,/to_normal)
coord2=convert_coord(bounds(2),bounds(3),/data,/to_normal)
position(0)=coord1(0)
position(1)=coord1(1)
position(2)=coord2(0)
position(3)=coord2(1)
plots,[-130,-30,-30,-130,-130],[80,80,0,0,80],/data,color=200
grid=sph_scat(random_lons,random_lats,random_vals,bounds=bounds)
contour,grid,nlevels=6,level=findgen(6)*20, $
c_labels=fltarr(6)+1,color=150,charsize=1.5, $
position=position,/noerase, $
xstyle=4,ystyle=4
end