Hi David, I have no problems with GRIDDATA; take a look at the code.
The only problem I had was the triangulate function - you might have
problems with collinear points on the poles if you don't remove
them).
Cheers, Klemen
pro tmp_fanning_map
;input size in x and y direction
sx = 144
sy = 73
;read input data
im=fltarr(sx,sy)
openr,1,"usegriddata.dat"
readu,1,im
close,1
im=reverse(im,2)
;generate input lon and lat array
im_lat = rebin(reform(findgen(sy)/(sy-1)*180.-90., 1, sy), sx, sy)
im_lon = rebin(findgen(sx)/sx*360., sx, sy)
;reduce the dimension in y directon (otherwise problems with colinear
points on the poles)
sy = sy - 2
im_lon = im_lon[*,1:sy]
im_lat = im_lat[*,1:sy]
im = im[*,1:sy]
;Polar projection on WGS84
map=map_proj_init(106, DATUM=8, /GCTP, center_lon=-45.,
center_lat=90.)
;transform input coorduiante arrays into vector
v_x = transpose(im_lon[*])
v_y = transpose(im_lat[*])
point_prj = MAP_PROJ_FORWARD(v_x, v_y, MAP_STRUCTURE=map)
;Make triangles
TRIANGULATE, point_prj[0,*], point_prj[1,*], Trng, TOLERANCE=1.
im_prj = GRIDDATA(point_prj[0,*], point_prj[1,*], im[*], $
/NEAREST_NEIGHBOR, DELTA=[25000.,25000.], TRIANGLES=Trng, $
DIMENSION=[304,448], START=[-3850000., -5350000.])
im_prj = reverse(im_prj, 2)
save, im_prj, file='faning.sav'
device,decomposed=0
loadct,11
tvscl,im_prj
end
|