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

Home » Public Forums » archive » Re: map_set stereographic projection
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: map_set stereographic projection [message #48494 is a reply to message #48493] Fri, 28 April 2006 06:40 Go to previous messageGo to previous message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
dvila wrote:
> Hi all,
>
> I'm trying to deal with a pre-projected polar stereographic image with
> this geometrical characteristics:
>
> # It is a 1121x881 polar stereographic grid.
> # Point (1,1) is at 23.117N 119.023W.
> # Point (1,881) is at 53.509N 134.039W.
> # Point (1121,1) is at 19.805N 80.750W.
> # Point (1121,881) is at 45.619N 59.959W.
> # The y-axis is parallel to 105W.
> # The resolution is 4.7625km at 60N.
> # The pole point is (I,J) = (400.5,1600.5)
>
> I don't know how may I set the map_set routine to fit the map with the
> data. Is it possible to work with pre-projected data?

stereo = MAP_PROJ_INIT('Stereographic', CENTER_LONGITUDE=-105, $
CENTER_LATITUDE=90)

; The repeat at the end will serve to close the box in oplot command
longitude = [-119.023D, -134.039, -59.959, -80.750, -119.023]
latitude = [23.117D, 53.509, 45.619, 19.8057, 23.117]
uv = MAP_PROJ_FORWARD(longitude,latitude,MAP_STRUCTURE=stereo)

; These are the u-v values corresponding to pixel centers along each
edge.
topv = (uv[1,1]+uv[1,2])*0.5
botv = (uv[1,0]+uv[1,3])*0.5
leftu = (uv[0,0]+uv[0,1])*0.5
rightu = (uv[0,2]+uv[0,3])*0.5

xscale = (rightu-leftu)/(1121-1)
yscale = (topv-botv)/(881-1)

; U-V coordinates of midpoints of outer edges
u = [leftu-0.5*xscale, 0.5*(leftu+rightu), rightu+0.5*xscale, $
0.5*(leftu+rightu)]
v = [0.5*(botv+topv), topv+0.5*yscale, 0.5*(botv+topv),
botv-0.5*yscale]
lonlat = MAP_PROJ_INVERSE(u, v, MAP_STRUCTURE=stereo)
limit = [lonlat[1,*],lonlat[0,*]]

WINDOW,XSIZE=1120,YSIZE=880
MAP_SET, 90, -105, /STEREOGRAPHIC,
LIMIT=limit,/NOBORDER,XMARGIN=0,YMARGIN=0
; To verify that we've set up the map projection correctly:
pixels = CONVERT_COORD(longitude,latitude,/DATA,/TO_DEVICE)
print,pixels

data = FLTARR(1120,880)
; Fill in data
TVSCL,data

MAP_GRID,/LABEL
MAP_CONTINENTS,/HIRES
; Draw closed box through corner pixels
OPLOT,longitude,latitude
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: widget tutorial
Next Topic: Re: Importing data from C/C++ to IDL when type is only known at runtime

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

Current Time: Fri Oct 10 14:45:31 PDT 2025

Total time taken to generate the page: 0.71871 seconds