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

Home » Public Forums » archive » Re: create an UTM grid
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: create an UTM grid [message #78410 is a reply to message #78409] Mon, 28 November 2011 14:33 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
nata writes:

> Thank you David. Just to be sure, if I want a grid of 1000x1000, 1km
> resolution and centered on 45.42419lat -73.9372lon, is the following
> code right ?
>
> center_lat=45.42419
> center_lon=-73.9372
> xdim=1000
> ydim=1000
> resolution=1000.
>
> map_utm=MAP_PROJ_INIT('UTM', /GCTP, CENTER_LON=center_lon,
> CENTER_LAT=center_lat, ELLIPSOID=24)
>
> xycenter=MAP_PROJ_FORWARD(center_lon, center_lat,
> MAP_STRUCTURE=map_utm)
>
> x_grid=xycenter[0] + FINDGEN(xdim)*resolution - xdim/2.*resolution
> y_grid=xycenter[1] + FINDGEN(ydim)*resolution - ydim/2.*resolution
>
> result = MAP_PROJ_INVERSE(x_grid, y_grid, MAP_STRUCTURE=map_utm)
>
> lon=REFORM(result[0,*])
> lat=REFORM(result[1,*])

Well, something like that. :-)

More like this, I think. (Maybe this is what you had.)

mapStruct = Map_Proj_Init('UTM', /GCTP, $
Center_Lon=-74, Center_Lat=45, Ellipsoid=24)
xycenter = Map_Proj_Forward(-74, 45, Map_Structure=mapStruct)
xstart = [xycenter[0]-49995
ystart = [xycenter[1]-49995

xgrid = Findgen(1000)*1000 + xstart
ygrid = Findgen(1000)*1000 + ystart

xdim = 1000
ydim = 1000

xgrid = Rebin(xgrid, xdim, ydim)
ygrid = Rebin(Reform(ygrid, 1, ydim), xdim, ydim)

Cheers,

David




--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Writing arrays to text file - format code trickery?
Next Topic: Search single column of array - removing nasty loop

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

Current Time: Sun Oct 12 10:34:43 PDT 2025

Total time taken to generate the page: 1.19583 seconds