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

Home » Public Forums » archive » Help needed in remapping data using IDL
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
Help needed in remapping data using IDL [message #70718] Tue, 04 May 2010 14:30 Go to next message
kaba is currently offline  kaba
Messages: 2
Registered: May 2010
Junior Member
Hello Guys, I am relative a new IDL programer who would appreciate
some help in how to remap a sample data from satellite projection to
Lambert Conformal.

Here are the detail of What I have done so far:


;;INPUTS are 2D- arrays of : DATA, LAT & LON ;;; each 1600*600
inproj = 7 ;Satellite projection
indatum = 0 ; Clarke 1866
yy=WHERE(LAT GE -90.0 AND LAT LE 90.0)
zz=WHERE(LON GE -180.0 AND LON LE 180.0)

inclat=MEAN(lat(yy)) & inclon=MEAN(lon(zz)) ;;input central
lat,lon
inlimit=[MIN(LAT(yy)), MIN(LON(zz)), MAX(LAT(yy)), MAX(LON(zz))]
LAT1=REVERSE(LAT,2) & LON=REVERSE(LON, 2) & DATA=REVERSE(DATA,
2)


;;;Desired output 2D ARRAY of DATA, LAT & LON ;;each 1073* 689
;;; I want the LAT/LON values of the corners of the grid to be :

outproj=104 ; /GCTP lambert conformal conic
outdatum = 0 ; Clarke 1866
outlimit=[238.4459,20.1919, 229.8965,49.9396, 299.1145,50.1054,
290.7919, 20.3317]
outsp1 = 25.0 ; Out standard parallel 1
outsp2 = 25.0 ; Out standard parallel 2
outclat = 37.9 ; Out standard parallel 2
outclon = -97.0 ; Out standard parallel 2


;;Define the malp projections

mapin=MAP_PROJ_INIT(inproj, ELLIPSOID=indatum, CENTER_LATITUDE=inclat,
$
CENTER_LONGITUDE=inclon, limit=inlimit)

mapout= MAP_PROJ_INIT(outproj, /GCTP, ELLIPSOID=outdatum,
STANDARD_PAR1=outsp1,
STANDARD_PAR2=outsp2, CENTER_LATITUDE=outclat,
$
CENTER_LONGITUDE=outclon,
limit=outlimit)



;;;converting lat/lon to UV coord with some help from Mr. Fanning's
docs online
xx=MAP_PROJ_FORWARD(LON(*,0), LAT(*,0),
MAP_STRUCTURE=mapout)
yy=MAP_PROJ_FORWARD(LON(0,*), LAT(0,*),
MAP_STRUCTURE=mapout)

xvec=REFORM(xx[0,*]) & yvec=REFORM(yy[1,*])
xhalf=(xvec[1]-xvec[0])/2.0 & yhalf=(yvec[1]-yvec[0])/2.0
xrange=[xvec[0]-xhalf, xvec[N_ELEMENTS(xvec)-1] +xhalf]
yrange=[yvec[0]-yhalf, yvec[N_ELEMENTS(yvec)-1] +yhalf]
newrange=[xrange[0], yrange[0], xrange[1], yrange[1]]


;;Question: I actually wanted to use “outlimit” which is an 8
element not 4, how
;;can I use that instead?



;;; Remap the data

timgout=MAP_PROJ_IMAGE(data, MAP_STRUCTURE=mapin) ;,
UVRANGE=uvrange) ; inlimit, IMAGE_STRUCTURE=mapin,

imgout=MAP_PROJ_IMAGE(data, newrange, MAP_STRUCTURE=mapout,
UVRANGE=uvrange,
IMAGE_STRUCTURE=mapout)



When I plot this using on a window, the map projection looks right but
the data does not seem to be remapped correctly.
This is my first time using map_proj_init and map_pro_image. Please
help.

Thanks
Re: Help needed in remapping data using IDL [message #70801 is a reply to message #70718] Wed, 05 May 2010 05:50 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
kaba writes:

>
> Hello Guys, I am relative a new IDL programer who would appreciate
> some help in how to remap a sample data from satellite projection to
> Lambert Conformal.
>
> Here are the detail of What I have done so far:
> ...
>
> When I plot this using on a window, the map projection looks right but
> the data does not seem to be remapped correctly.
> This is my first time using map_proj_init and map_pro_image. Please
> help.

It seems natural to want to work with latitude and
longitude coordinates when you are working with map
projections, but resist that thought! To do this kind
of reprojection properly, you want to be in XY space.
(IDL sometimes calls this UV space, but in any case
it is a rectangular space where things make a lot of
sense, as opposed to, say, lat/lon space where they
don't.)

Have a look at this article for additional information:

http://www.dfanning.com/map_tips/warpimage.html

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Device independent plotting
Next Topic: VI, VIM IDL plugin

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

Current Time: Wed Oct 08 11:35:19 PDT 2025

Total time taken to generate the page: 0.00661 seconds