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

Home » Public Forums » archive » Re: Geographic 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: Geographic Lat/Lon [message #59884] Sat, 12 April 2008 15:45
jeffnettles4870 is currently offline  jeffnettles4870
Messages: 111
Registered: October 2006
Senior Member
On Apr 11, 6:33 pm, robinson....@gmail.com wrote:
> On Apr 11, 5:00 pm, David Fanning <n...@dfanning.com> wrote:
>
>> David Fanning writes:
>>> lons = -130.540 * Indgen(ysize) * 4.811e-3
>>> lats = 40.00 * Indgen(xsize) * 4.811e-3
>
>> Whoops! YSIZE and XSIZE would be reversed, certainly.
>> I'm going to order another....
>
>> 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.")
>
> Thanks David. But in Geographic lons are like curve lines. Thus the
> lon value for the (1,1) pixel will be, in general, different respect
> to the (last,1) pixel.

David was correct about what these ENVI header values represent. You
can verify this yourself by opening an image in ENVI that is in the
Geographic Lat/Lon projection (i used the world_dem file that comes
with ENVI) and going to File->Edit ENVI Header. From there select
Edit Attributes and then Map Info... from that pulldown menu. Then
open the corresponding .hdr file for the image you opened in a text
editor. You can match up numbers to the values they represent that
way.

Jeff
Re: Geographic Lat/Lon [message #59892 is a reply to message #59884] Fri, 11 April 2008 16:33 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
robinson.inj@gmail.com writes:

> Thanks David. But in Geographic lons are like curve lines. Thus the
> lon value for the (1,1) pixel will be, in general, different respect
> to the (last,1) pixel.

Then I suggest there is no possibility of getting where
you want to go from where you are standing. :-)

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.")
Re: Geographic Lat/Lon [message #59893 is a reply to message #59892] Fri, 11 April 2008 15:33 Go to previous message
robinson.inj is currently offline  robinson.inj
Messages: 32
Registered: August 2007
Member
On Apr 11, 5:00 pm, David Fanning <n...@dfanning.com> wrote:
> David Fanning writes:
>>    lons = -130.540 * Indgen(ysize) * 4.811e-3
>>    lats = 40.00 * Indgen(xsize) * 4.811e-3
>
> Whoops! YSIZE and XSIZE would be reversed, certainly.
> I'm going to order another....
>
> 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.")

Thanks David. But in Geographic lons are like curve lines. Thus the
lon value for the (1,1) pixel will be, in general, different respect
to the (last,1) pixel.
Re: Geographic Lat/Lon [message #59894 is a reply to message #59893] Fri, 11 April 2008 15:00 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> lons = -130.540 * Indgen(ysize) * 4.811e-3
> lats = 40.00 * Indgen(xsize) * 4.811e-3

Whoops! YSIZE and XSIZE would be reversed, certainly.
I'm going to order another....

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.")
Re: Geographic Lat/Lon [message #59895 is a reply to message #59894] Fri, 11 April 2008 14:59 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
robinson.inj@gmail.com writes:

> I was wondering if someone could suggest me how to specify the
> following ENVI information in IDL:
>
> map info = {Geographic Lat/Lon, 1.0000, 1.0000, -130.54072891,
> 40.00000000, 4.8112599312e-003, 4.8112599312e-003, WGS-84,
> units=Degrees}
>
> I need to create lats and lons grids for the "Geographic Lat/Lon"
> projection and they must give me the same geolocation for each pixel
> as ENVI does. I am using IDL 6.3

I am WAY out on a limb here (too many margaritas, probably),
but I'm going to guess that this structure tells you that
the "tie-point" associated with the (1,1) pixel (upper-left
pixel in ENVI, I guess) is at (-130.540, 40) in lon/lat,
and that each pixel is scaled at 4.811e-3 in X and Y.
So, starting at the tie point, each pixel has a longitude
of :

lons = -130.540 * Indgen(ysize) * 4.811e-3
lats = 40.00 * Indgen(xsize) * 4.811e-3

You can make arrays of the appropriate size by matrix
multiplication. Units are in degrees, I would guess.

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.")
Re: Geographic Lat/Lon [message #59896 is a reply to message #59895] Fri, 11 April 2008 14:39 Go to previous message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
robinson.inj@gmail.com wrote:
> On Apr 11, 1:13 pm, d.po...@gmail.com wrote:
>> On Apr 11, 7:14 pm, robinson....@gmail.com wrote:
>>
>>> Dear all,
>>> I was wondering if someone could suggest me how to specify the
>>> following ENVI information in IDL:
>>> map info = {Geographic Lat/Lon, 1.0000, 1.0000, -130.54072891,
>>> 40.00000000, 4.8112599312e-003, 4.8112599312e-003, WGS-84,
>>> units=Degrees}
>>> I need to create lats and lons grids for the "Geographic Lat/Lon"
>>> projection and they must give me the same geolocation for each pixel
>>> as ENVI does. I am using IDL 6.3
>>> Thanks
>>> Robinson
>> call envi_convert_file_coordinates, fid, X,Y, lat,long (with NO
>> keyword), which will change your lat-long to the corresponding pixel
>> row
>> and column on your image.
>
> Thanks. But I need to use just IDL no ENVI procedures :-(

what do you want to do exactly?

If you are creating an image, you can just put the map info into the
header file... Make sure to properly write the number of col and rows,
add the map info, and your output will be automagically georeferenced!

Jean
Re: Geographic Lat/Lon [message #59898 is a reply to message #59896] Fri, 11 April 2008 14:20 Go to previous message
robinson.inj is currently offline  robinson.inj
Messages: 32
Registered: August 2007
Member
On Apr 11, 1:13 pm, d.po...@gmail.com wrote:
> On Apr 11, 7:14 pm, robinson....@gmail.com wrote:
>
>> Dear all,
>
>> I was wondering if someone could suggest me how to specify the
>> following ENVI information in IDL:
>
>> map info = {Geographic Lat/Lon, 1.0000, 1.0000, -130.54072891,
>> 40.00000000, 4.8112599312e-003, 4.8112599312e-003, WGS-84,
>> units=Degrees}
>
>> I need to create lats and lons grids for the "Geographic Lat/Lon"
>> projection and they must give me the same geolocation for each pixel
>> as ENVI does. I am using IDL 6.3
>
>> Thanks
>> Robinson
>
> call envi_convert_file_coordinates, fid, X,Y, lat,long (with NO
> keyword), which will change your lat-long to the corresponding pixel
> row
> and column on your image.

Thanks. But I need to use just IDL no ENVI procedures :-(
Re: Geographic Lat/Lon [message #59902 is a reply to message #59898] Fri, 11 April 2008 11:13 Go to previous message
d.poreh is currently offline  d.poreh
Messages: 406
Registered: October 2007
Senior Member
On Apr 11, 7:14 pm, robinson....@gmail.com wrote:
> Dear all,
>
> I was wondering if someone could suggest me how to specify the
> following ENVI information in IDL:
>
> map info = {Geographic Lat/Lon, 1.0000, 1.0000, -130.54072891,
> 40.00000000, 4.8112599312e-003, 4.8112599312e-003, WGS-84,
> units=Degrees}
>
> I need to create lats and lons grids for the "Geographic Lat/Lon"
> projection and they must give me the same geolocation for each pixel
> as ENVI does. I am using IDL 6.3
>
> Thanks
> Robinson

call envi_convert_file_coordinates, fid, X,Y, lat,long (with NO
keyword), which will change your lat-long to the corresponding pixel
row
and column on your image.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Interpolation
Next Topic: SHADE_VOLUME and getting disconnected meshes.

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

Current Time: Wed Oct 08 15:48:31 PDT 2025

Total time taken to generate the page: 0.00688 seconds