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

Home » Public Forums » archive » Re: question: IDL for incorporating text files in hyperspectral band math
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: question: IDL for incorporating text files in hyperspectral band math [message #58789] Tue, 19 February 2008 17:44
jeffnettles4870 is currently offline  jeffnettles4870
Messages: 111
Registered: October 2006
Senior Member
On Feb 19, 6:03 pm, jo <jenn...@gmail.com> wrote:
> Hello all,
> I am a masters student working with hyperspectral imagery for benthic
> mapping. I am also a fresh beginner at IDL and have found myself at a
> wall for hyperspectral image processing in ENVI.
>
> I am trying to perform a sun glint correction of a water surface in a
> hyperspectral (AISA) image. From the DN value of each visible band in
> each pixel, I must subtract the product of a coefficient (which is
> already calculated), and the DN of a single NIR band.
>
> So again, in a single pixel: DNvis - (coefficient x DNnir) for all vis
> bands. Calculate for all pixels.
>
> Obviously the vis and NIR DN values are contained within the
> hyperspectral image, but the coefficients are stored in a text file as
> a single column containing one coefficient for each of approx 400
> bands. I know that the ENVI band math can be used for mathematics
> between 2 images of the same spatial and spectral dimension, but the
> issue is the intermediate step: getting ENVI to read the text file and
> apply one coefficient at a time to the NIR image. I need to use IDL
> for this, but have little experience with the script.
>
> Could anybody offer some direction on this issue, or maybe somebody
> has already written a simple script that they wouldn't mind sharing
> for applying a text file to an image?
>
> Thank-you in advance for your time!
> Jenn

I've tried to read in a text file in band math myself, and was equally
disappointed by the mess that results. At any rate, i have a few
questions for you:

1. Do you need to do this programmatically or could you use band/
spectral math if you could get it to work? I ask b/c:

2. It sounds like you have sort of a "spectrum of coefficients" - you
mention a single column in a text file for each band. That sounds to
me like you have one coefficient for each wavelength. If that's true,
couldn't you read your coefficients into a spectral library?

If you can turn your coefficients into a spectral library i think you
can do this with a combo of spectral math and band math.

The spectral math equation would be s1*s2 where s1 is your
coefficients "spectrum" and s2 is DNnir. Make sure you use the "map
variable to input file" option for s2. This'll give you an output
image cube.

Next you want to do band math: b1 - b2 where b1 = DNvis and b2 is the
output of spectral math above. I think that'll get you what you want
if I understand your problem correctly.

Hope that helps,
Jeff
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: boxgrid isurface
Next Topic: Re: boxgrid isurface

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

Current Time: Sat Oct 11 11:51:18 PDT 2025

Total time taken to generate the page: 0.39880 seconds