Re: Lambert Projection to Lat Lon [message #40025] |
Sun, 04 July 2004 17:09  |
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)
|
|
|