comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: GridData Conundrum
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: GridData Conundrum [message #70565 is a reply to message #70468] Mon, 19 April 2010 06:32 Go to previous message
Klemen is currently offline  Klemen
Messages: 80
Registered: July 2009
Member
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
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: How to shift the values of x axis from position of x axis to other
Next Topic: Re: Help needed!!

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:07:09 PDT 2025

Total time taken to generate the page: 0.00460 seconds