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

Home » Public Forums » archive » Re: Lambert Projection to Lat Lon
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: Lambert Projection to Lat Lon [message #40025] Sun, 04 July 2004 17:09 Go to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
Will McCarty wrote:

> Mark Hadfield <m.hadfield@niwa.co.nz> wrote in message
>
>> I should think you could write something suitable using the
>> MAP_PROJ_INVERSE function (introduced in IDL 5.6).
>
>
> If only it were that easy, unless I'm missing something. Along with
> the Lambert projection settings mentioned, I'm working on a fixed grid
> scale of 185x129. I don't see anything for fixed grid sizes in
> map_proj_init.

I think you just have to construct the fixed-size grid yourself and
supply it to the map_projection function.


> It also looks for center lat/lon, which I don't
> believe is given in its entirety.

There are various Lambert projections mentioned in the documentation.
I'm no expert, but the one that sounds closest to what you want is #104,
Lambert Conformal Conic. It takes CENTER_LONGITUDE and CENTER_LATITUDE
keywords. The following example constructs a 185x129 grid with 10 km
spacing and seems to produce reasonable answers.

map = map_proj_init('Lambert Conformal Conic', $
CENTER_LONGITUDE=90, $
CENTER_LATITUDE=30, $
STANDARD_PAR1=20, $
STANDARD_PAR2=30)

x0 = 0.
nx = 185
dx = 10.E3

y0 = 0.
ny = 129
dy = 10.e3

x = x0+dx*findgen(nx)
y = y0+dy*findgen(ny)

x2d = rebin(x, nx, ny)
y2d = rebin(reform(y, 1, ny), nx, ny)

lonlat = map_proj_inverse(x2d, y2d, MAP_STRUCTURE=map)

lon = reform(lonlat[0,*], nx, ny)
lat = reform(lonlat[1,*], nx, ny)

print, min(lon), max(lon), min(lat), max(lat)

It prints:

90.000000 110.97169 28.835737 41.354015

--
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Need advice on building a project
Next Topic: cursor shape in XROI

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

Current Time: Fri Oct 10 21:53:15 PDT 2025

Total time taken to generate the page: 0.32238 seconds