[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Spectral Library Resampling Help!



  "Kent Krumvieda" <kentkr@datafusion.com> wrote:
> I am trying to use ENVI's Spectral Library Resampling ability.  I
> want to resample the usgs spectral libraries to AVIRIS.  Has anyone
> ever done this?
> Can someone help me on this.

Hi Kent,

First you need the AVIRIS bandpass centre wavelengths and gaussian
FWHMs.   These are included in the third file of a standard AVIRIS
distribution tape.   (This is a binary file with 5 columns for each of
the 224 channels.   You need the first 2 columns here.   It's floating
point data, big-endian, and there's a 1000-byte header.)
You need to write a 2-column ASCII file with these data.
Here's a bit of code that should do it.

Junk=bytarr(1000)
Stuff=fltarr(5,224)
Openr,u,'third_file',/get_lun,/swap_if_little_endian
Readu,u,junk,stuff
Free_lun,u
stuff=stuff[0:1,*]*0.001	;go nm->um
openw,u,'aviris92.txt',/get_lun
printf,u,stuff
free_lun,u

Then, in ENVI, go Spectral Tools -> Spectral Libraries - > Spectral
Library Resampling.   Select the USGS speclib.   (Note, BTW, that its
wavelength units are micrometers.)   In the next dialog tell it to
resample wavelengths to "input ASCII file".   After you click OK here,
you'll get a pickfile dialog to select the ASCII file (the AVIRIS
wavelength file you made earlier), and then you'll get a little dialog
asking which column has what.   Tell it wavelengths in column 1, FWHM
in column 2.   That's about it.

The only tricky bit is matching wavelength units.   ENVI doesn't record
wavelength units anywhere so it's entirely up to you to keep track.
The simplest solution is to standardise if possible.

Good luck,
cheers
Peter Mason


Sent via Deja.com http://www.deja.com/
Before you buy.