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

Home » Public Forums » archive » How to use Envi GLT when there are NaNs in the lat/lon files?
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
How to use Envi GLT when there are NaNs in the lat/lon files? [message #60278] Thu, 08 May 2008 10:10 Go to next message
envi35@yahoo.ca is currently offline  envi35@yahoo.ca
Messages: 48
Registered: March 2005
Member
Hi, I'm trying to georeference an image covering a very large area -
pixels in the ocean were given as NaN. This image was projected, but I
was not able to set up its projection in Envi based on the available
parameters. However, there are lat/lon files for all of the grid
points in the image. So I thought I could use GLT to register the
image myself. Then there are NaNs in the lat/lon files same as in the
image file. Does anybody have expereince of applying GLT from lat/lon
with missing values? Is this possible?

Thanks for any advice,

Jenny
Re: How to use Envi GLT when there are NaNs in the lat/lon files? [message #60413 is a reply to message #60278] Tue, 13 May 2008 03:55 Go to previous message
wita is currently offline  wita
Messages: 43
Registered: January 2005
Member
On May 8, 7:10 pm, Jenny <env...@yahoo.ca> wrote:
> Hi, I'm trying to georeference an image covering a very large area -
> pixels in the ocean were given as NaN. This image was projected, but I
> was not able to set up its projection in Envi based on the available
> parameters. However, there are lat/lon files for all of the grid
> points in the image. So I thought I could use GLT to register the
> image myself. Then there are NaNs in the lat/lon files same as in the
> image file. Does anybody have expereince of applying GLT from lat/lon
> with missing values? Is this possible?
>
> Thanks for any advice,
>
> Jenny



Jenny,

I've never tried to use the GLT in ENVI but my guess is that you need
to
filter out the NaN in all three images and write them to a new ENVI
image.
These images can then be used as input to the GLT module.

In pseudo code:

image = envi_get_data('imagefile')
lat = envi_get_data('latitudefile')
lon = envi_get_data('longitudefile')
; Asssuming NaN values are on the same locations in all files
index = Where(Finite(image) EQ 1, c)
IF c gt 1 THEN BEGIN
nimage = image[index]
nlat = lat[index]
nlon = lon[index]
ENDIF
writeu, nmimage
writeu, nlat
writeu, nlon
envi_setup_head, nimage, nb=1, nr=1, nc=N_Elements(image)
envi_setup_head, nlat, nb=1, nr=1, nc=N_Elements(image)
envi_setup_head, nlon, nb=1, nr=1, nc=N_Elements(image)

Then use the nimage, nlon and nlat images as input to the GLT module
as described in the ENVI manual.
ENVI's GLT module will then put the data on the right place based on
the corresponding lat/lon values.


Allard
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: How to specify xyz-coordinates of the grid for ivolume
Next Topic: Varimax Rotation

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

Current Time: Fri Oct 10 06:09:05 PDT 2025

Total time taken to generate the page: 0.39935 seconds