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

Home » Public Forums » archive » Re: get LAT/LON from georef image
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: get LAT/LON from georef image [message #65087 is a reply to message #65077] Wed, 11 February 2009 05:43 Go to previous messageGo to previous message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
titan wrote:
> Hello! I have a georef image and I would like to extract the LAT and
> LON values from it.
> the dims of my image are not equal, let's say [65,80].
> I create two vectors to be associated with the x_pixel and y_pixel of
> the image
>
> x_pixel=indgen(65)
> y_pixel=indgen(80)
>
> I know that there is the envi routine ENVI_CONVERT_FILE_COORDINATES to
> convert X and Y pixel coordinates into their corresponding X and Ymap
> coordinates and vice-versa.
>
> Unfortunately it seems to work only if the lat and lon array are of
> the same dimension in fact if we consider this example I should write
>
> envi_convert_file_coordinates, fid, x_pixel, y_pixel, xmap, ymap, /
> to_map
>
> in this way I should have the respective vector xmap and ymap of lat
> and lon
> but if I write
>
> help, xmap
> help, ymap
>
> I get
>
> LAT_MAP DOUBLE = Array[65]
> LON_MAP DOUBLE = Array[65]
>
> two vector of the same dims (in this case 65) and one of 65 elements
> and the other with 80 elements
>
> Could someone tell me where I'm wrong??Are there any methods to
> overpass this problem??
> thanks

Titan,

yes, this is normal. x_pixel and y_pixel represent the XY pairs of
coordinates... I am not too sure of what you are trying to extract
exactly, but the idea is to create, in pixel index, the coordinates of
your points of interests.

So, if you want to have the coordinates of the 1st line of pixels, you
would have:
X_pixel = indgen(65) ; 0,1,2,3,...
Y_pixels = intarr(65) ; 0,0,0,0,...

So the pairs are [0,0],[1,0],[2,0] ....

If you want to have the coords of the first column, do
X_pixel = intarr(85)
Y_pixels = indgen(85)

And if you want the coord of every pixels,

X_pixels = rebin(indgen(65),65*85) ;0*85 times, 1*85 times etc
Y_pixels = reform(rebin(indgen(85),85,65),85*65) ;0 to 85, * 65 times

Jean
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: How to simplify or mesh a IDLgrLegend Obj ?
Next Topic: Update text widget

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

Current Time: Wed Oct 08 17:30:11 PDT 2025

Total time taken to generate the page: 0.00427 seconds