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 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Lambert Projection to Lat Lon [message #40025] Sun, 04 July 2004 17:09
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)
Re: Lambert Projection to Lat Lon [message #40031 is a reply to message #40025] Fri, 02 July 2004 11:58 Go to previous message
willmccarty is currently offline  willmccarty
Messages: 3
Registered: December 2003
Junior Member
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. It also looks for center lat/lon, which I don't
believe is given in its entirety.

Will
Re: Lambert Projection to Lat Lon [message #40042 is a reply to message #40031] Thu, 01 July 2004 15:00 Go to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
Will McCarty wrote:
> Does anyone have any code that will generate a latitude and longitude
> grid given typical lambert projection and grid settings? I'm trying
> to get GRIB data (from the ETA 212 grid) into a format easily compared
> with some satellite and point data I'm using. Without a Lat and Lon
> grid, however, it is generally useless to me. I've got the projection
> info extracted from the file:
>
> Lambert Conf: Lat1 12.190000 Lon1 -133.459000 Lov -95.000000
> Latin1 25.000000 Latin2 25.000000 LatSP 0.000000 LonSP 0.000000
> North Pole (185 x 129) Dx 40.635000 Dy 40.635000 scan 64 mode 8
>
> I'm just looking for a nice piece of code that can dump out a lat an
> lon grid for a known grid size and spacing.

I should think you could write something suitable using the
MAP_PROJ_INVERSE function (introduced in IDL 5.6).

--
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)

xxx Article not posted: more included text than new text Bla bla xxx
xxx Article not posted: more included text than new text Bla bla xxx
xxx Article not posted: more included text than new text Bla bla xxx
xxx Article not posted: more included text than new text Bla bla xxx
xxx Article not posted: more included text than new text Bla bla xxx
xxx Article not posted: more included text than new text Bla bla xxx
xxx Article not posted: more included text than new text Bla bla xxx
xxx Article not posted: more included text than new text Bla bla xxx
xxx Article not posted: more included text than new text Bla bla xxx
xxx Article not posted: more included text than new text Bla bla xxx
xxx Article not posted: more included text than new text Bla bla xxx
xxx Article not posted: more included text than new text Bla bla xxx
xxx Article not posted: more included text than new text Bla bla xxx
xxx Article not posted: more included text than new text Bla bla xxx
  Switch to threaded view of this topic Create a new topic Submit Reply
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: Thu Oct 09 12:41:36 PDT 2025

Total time taken to generate the page: 1.76144 seconds