
This directory contains the "research" library sprlb06a
which contains other spectra not in splib06a.  This includes
spectra publiched after the sprlb06a publication (Clark et al., 2007).

Some of the spectra here are in sprlb07a

*************************************************************************

The sprlib06a file will be converted to splib06b where low channel number
spectra in sprlib06a will be cubic splined to a greater number of channels for
proper convolution to various imaging spectrometer resolutions.

TO ADD SPECTRA TO sprlb06a:

The title must have the form:

Grass_dry+0.17%Na-Mont AMX35 W1R1Ba AREF
Alunite GDS82 Na82         W5R4Nbc_ RREF  4280
         1111111111222222222233333333334
1234567890123456789012345678901234567890

AREF, RREF = columns 37-40

Spectrometer codes as in spectral library in 
    columns 30-35 for beckman, ASD and AVIRIS spectra
    columns 28-35 for Nicolet spectra.

W5R4N___ = nicolet
W1R1B_   = beckman
W1R1F_   = ASD standard resolution
W1R1H_   = ASD high resolution

where the _ are the spectral purities in each wavelength region.

R. Clark Feb 13, 2008.

************************************************************************
============================================================================

The naming convention should be the same as that used to convolved
spectral library splib06, except the "a" is set to r instead of s.
When adding a new convolved spectral library, splib06 mustr be convolved first.
See /sl1/usgs/library06.conv/AAAA.README.txt


annccyyd
            a = r for research library
            nn= library version number
            cc= output convolved spectrometer model/type
            yy= year
            d = output spectrometer version within year yy

         as = aster,
         av = aviris,  e.g. aviris 1995: av95a
         an = aviris-ng
         hd = Hydice,
         hy = HyMap
         mi = MIVIS
         nm = nims,
         pb = probe
         pf = Mars pathfinder
         tm = LandsatTM (followed by 04, 05, 07 for with TM)
         vm = vims

         gn = generic for 20, 30, 40, etc nm bandpass

         pr = PRISMA 2021 ESA Earth orbiter, e.g. s06pr01a 238 channels


         nc = nicolet, followed by wavenumber resolution, e.g 4 cm^-1
              would be nc04, 0.5 cm^1 would be nc.5

         fs00 = ASD field spectrometer 2151
         fs71 = ASD field spectrometer 717ch
         fs35 = field spectrometer 358ch
         bk1x = usgs beckman, 1x = standard resolution
         gr = gregg's resolution study,

Examples:

r06av90a           AVIRIS 1990 convolution 224 channels. (e.g. Cuprite)
r06av90b           AVIRIS 1990 convolution 208 channels

r06av91a           AVIRIS 1991 convolution 224 channels.
r06av91b           AVIRIS 1991 convolution 208 channels.

NOTE: 1992 AVIRIS had wavelength shifts that are flight spoecific.
         Some data sets may have shifts requiring non-standard wavelengths.

r06av92a           AVIRIS 1992 convolution 224 channels standard JPL waves.
r06av92b           AVIRIS 1992 convolution 197 channels standard JPL waves.
r06av92c           AVIRIS 1992 convolution 224 channels Bodie 8/20/92 waves.

r06av93a           AVIRIS 1993 convolution 224 channels. Cuprite 5/1993
r06av93b           AVIRIS 1993 convolution 198 channels. Cuprite 5/1993

r06av93c           AVIRIS 1993 convolution 224 channels. summitville 9/3/1993

r06av94a           AVIRIS 1994 convolution 224 channels. 5/1994

r06av95a           AVIRIS 1995 convolution 224 channels Alpha & Beta ver. 6/1995

r06nm95a           Galileo NIMS 1

r06av96a           AVIRIS 1996 convolution 224 channels

r06av97a           AVIRIS 1997 convolution 224 channels.

r06av98a           AVIRIS 1998 convolution 224 channels.

r06av99a           AVIRIS 1999 convolution 224 channels.

r06av00a           AVIRIS 2000 convolution 224 channels.

r06av01a           AVIRIS 2001 convolution 224 channels.

r06as04a           ASTER 2004 convolution of splib05a.

r06av05a           AVIRIS 2005 convolution 224 channels.

r06av10a           AVIRIS 2010 convolution 224 channels.

r06av13a           AVIRIS 2013 convolution 224 channels.
r06av17a           AVIRIS 2017 convolution 224 channels.


                   Cassini VIMS94 proposed   (in sprlib/lib02/vims)
                   Cassini VIMSIR preliminary 1 3/95
r06vm00a           Cassini VIMS thermal vac wavelengths
r06vm04a           Cassini VIMS Criuse wavelengths 2004 (thermal vac + 0.3 ch in IR)

r06as96a           ASTER96

r06mi94a           MIVIS94 (in sprlib/lib02/mivis)

r06pr01a           PRISMA 2021 ESA Earth orbiter 238 channels

r06fs35a           field spectrometer 358ch

r06ag21a           Agilent FTIR contact instrument 900 ch

r06hy94a           HYDICE94 (in sprlib/lib02/hydice)

                   1901ch resampled Beckman Resolution

r06tm05a           TM

r06pf00a           Pathfinder IMP imager  Mars


===============================================================================
sprlb06b

Making data product files Convolutions.

First you must make a higher channel interpolated library.  This
increases the trapezoidal integration in the convolution routines by
giving more bins per Beckman, AVIRIS, and high res Field spectrometer channels.
Nicolet and low resolution Fieldspectrometer data are not interpolated.
Specpr restart: v= sprlb06b  y = sprlb06a

           ./mak.sprlb06b.splin.cmds

(this takes ~4 seconds on an I7-950 cpu computer, 2022)

Next:

           cp startfiles/sprlb06b.start sprlb06b

Next start specpr (or dspecpr) with the r2 restart file and execute the
specpr command file:

           dspecpr r1.sprlb06b -gxterm2 -
           <sprlb06b.splin.cmds


##############################################################################

============================================================================
convolution of instrument libraries:

First, for each instrument make:

            *  the specpr restart file and the

            *  the specpr start file with the wavelength and resolution of the
               convolved instrument.

SIMPLE and SIMPLEST METHODS BELOW:

A specpr start file has the entries like this example for ABVIRIS 1995,
which you may create by hands below.

Or copy the start file from the main spectral library and simply change the title.
Example:
         cp /sl1/usgs/library06.conv/startfiles/s06an14b.start startfiles/r06an14b.start
         spsettitle startfiles/r06an14b.start 1 "USGS Digital Spectral Library: r06an14b "

spprint startfiles/r06an14b.start
     1  USGS Digital Spectral Library: r06an14b    410 Characters of TEXT
     2  Convolved AVIRIS-NG 2014b library          147 Characters of TEXT
     3  ****************************************    41 Characters of TEXT
     4  ****************************************    41 Characters of TEXT
     5  ..                                          41 Characters of TEXT
     6  Wavelengths in microns 425ch AVIRISNG14b   425  00:00:00.00  11/27/2019      6     12
     8  ..                                          41 Characters of TEXT
     9  ..                                          41 Characters of TEXT
    10  ..                                          41 Characters of TEXT
    11  ..                                          41 Characters of TEXT
    12  Resolution in microns 425ch AVIRISNG14b    425  00:00:00.00  11/27/2019      6     12
    14  ..                                          41 Characters of TEXT
    15  ..                                          41 Characters of TEXT
    16  ..                                          41 Characters of TEXT
    17  ..                                          41 Characters of TEXT
    18  Data value = channel number (425 ch)       425  00:00:00.00  11/24/****      6      0
    20  ..                                          41 Characters of TEXT
    21  ..                                          41 Characters of TEXT
    22  ..                                          41 Characters of TEXT
    23  ..                                          41 Characters of TEXT
    24  ..                                          41 Characters of TEXT
    25  ..                                          41 Characters of TEXT
    26  ..                                          41 Characters of TEXT
    27  ..                                          41 Characters of TEXT
    28  ..                                          41 Characters of TEXT
    29  ..                                          41 Characters of TEXT


SIMPLE METHOD:

Copy start file and restart file from the convolved splib06, /sl1/usgs/library06.conv, directory.

The file startfiles/r06av95a.start gets copied to this directory with the name r06av95a

Example: make the r06pr01a  PRISMA 2021 ESA Earth orbiter 238 channels

   r06pr01a:   (note the name change from s06* to r06*):

            cp /sl1/usgs/library06.conv/startfiles/s06pr01a.start startfiles/r06pr01a.start
            spsettitle startfiles/r06pr01a.start 1 'USGS Digital Spectral Library: r06pr01a '
            spsetwave startfiles/r06pr01a.start 6  6 12
            spsetwave startfiles/r06pr01a.start 12 6 12
            spprint startfiles/r06pr01a.start

            cp /sl1/usgs/library06.conv/restartfiles/r.s06pr01a restartfiles/r.r06pr01a
 
          edit:
            vi restartfiles/r.r06pr01a
                  change the line ivfl=s06pr01a  to ivfl=r06pr01a
                  change the line iyfl=splib06b  to iyfl=sprlb06b

                  change the line isavt=      s06pr01a    to isavt=      r06pr01a 
                  change the line inmy=       splib06b    to inmy=       sprlb06b 

       Now go below to the convolution commands  and copy an entry and change the copy
            to the new library name.

SIMPLEST METHOD:

     ./make.copy.and.change.s06-start-to-r06-start  s06library   r06library

   Example:

     ./make.copy.and.change.s06-start-to-r06-start  s06av01a  r06av01a


=================
Manual check:

It is very important that the:

           ".." file is in record 5,
            wavelengths in record 6,
            resolution  in record 12,

and the file be padded to record 29 so that the first convolved spectrum goes into
record 30.  This strategy ensures that spectra with channels 1 to 2171 will
have the same record numbers.  Spectra greater than 2171 channels is not yet
supported.

The spepcr restart file:

     v = the convolved instrument library (this is the output of the convolutions.
     y = sprlb06b

Restartfile example: restartfiles/r.r06av95a

##############################################################################

To convolve a library after the specpr restart and startup files are created,
run the command:


     mak.convol.library  library version channels name     resol_number


example:

     mak.convol.library  r06av95  a        224   AVIRIS95 12

creates spectral library r06av95a

starting specpr:

     dspecpr restartfiles/r1.sprlb06b -gxterm2 -


***************************************************************
***************************************************************
***********                           *************************
***********    convolution commands   *************************
***********                           *************************
***************************************************************
***************************************************************

Note: the sleep can be 0, 0.1 or 0.2  or greater to delay the plot long enough to
      see the result without taking too long of a time to complete.
      Example: 0.1 takes about 25 seconds 3/2022 148 spectra on an I9 computer
               0.2 takes  40 seconds

      Change sleep to noX for no X-window plots (and then the seconds is not needed.

Commands:

#                prog              lib     n  chan  title   fwhm
#                                                   keyword rec
#                                                           number

# AVIRIS:
            ./mak.convol.library  r06av95  a  224   AVIRIS95 12  sleep 0.1 # aviris 1995
            ./mak.convol.library  r06av97  a  224   AVIRIS97 12  sleep 0.1 # aviris 1997
            ./mak.convol.library  r06av98  a  224   AVIRIS98 12  sleep 0.1 # aviris 1998
            ./mak.convol.library  r06av99  a  224   AVIRIS99 12  sleep 0.1 # aviris 1999
            ./mak.convol.library  r06av00  a  224   AVIRIS00 12  sleep 0.1 # aviris 2000
            ./mak.convol.library  r06av01  a  224   AVIRIS01 12  sleep 0.1 # aviris 2001
            ./mak.convol.library  r06av05  a  224   AVIRIS10 12  sleep 0.1 # aviris 2005
            ./mak.convol.library  r06av06  a  224   AVIRIS10 12  sleep 0.1 # aviris 2006
            ./mak.convol.library  r06av08  a  224   AVIRIS08 12  sleep 0.1 # aviris 2008a
            ./mak.convol.library  r06av08  b  224   AVIRIS08 12  sleep 0.1 # aviris 2008b
            ./mak.convol.library  r06av10  a  224   AVIRIS10 12  sleep 0.1 # aviris 2010
            ./mak.convol.library  r06av11  a  224   AVIRIS10 12  sleep 0.1 # aviris 2011
            ./mak.convol.library  r06av12  a  224   AVIRIS12 12  sleep 0.1 # aviris 2012
            ./mak.convol.library  r06av13  a  224   AVIRIS13 12  sleep 0.1 # aviris 2013
            ./mak.convol.library  r06av14  a  224   AVIRIS14 12  sleep 0.1 # aviris 2014
            ./mak.convol.library  r06av17  a  224   AVIRIS17 12  sleep 0.1 # aviris 2017
            ./mak.convol.library  r06av18  a  224   AVIRIS18 12  sleep 0.1 # aviris 2018

# AVIRIS-NG:
            ./mak.convol.library  r06an14  a  426   AVIRNG14 12  sleep 0.1 # aviris-ng 2014
            ./mak.convol.library  r06an14  b  425   AVIRNG14 12  sleep 0.1 # aviris-ng 2014
            ./mak.convol.library  r06an21  a  425   AVIRNG21 12  sleep 0.1  # aviris-ng 2021

# EMIT:
            ./mak.convol.library  r06emit  a  288   EMIT22a  12  sleep 0.1  # EMIT before launch to Space Station
            ./mak.convol.library  r06emit  c  285   EMIT22c  12  sleep 0.1  # EMIT 022-08-13 in orbit wavelengths
 

# VIMS:
            ./mak.convol.library  r06vm07  a  352   VIMS07   12  sleep 0.1

# CRISM:
            ./mak.convol.library  r06cr08  a  438   CRISM08a 12  sleep 0.1
            ./mak.convol.library  r06cr08  b   72   CRISM08a 12  sleep 0.1  # global mode
            ./mak.convol.library  r06crj3  a  489   CRISMj3a 12  sleep 0.1  # 2012 J_MTR3 merged V+IR version a

# Moon Mineralogy Mapper:

            ./mak.convol.library  r06mm07  a  260   MMM      12  sleep 0.1 # 2007 targeted waves
            ./mak.convol.library  r06mm07  c   86   MMM      12  sleep 0.1 # 2007 global waves
            ./mak.convol.library  r06mm07  s  260   MMM      12  sleep 0.1 # 2007 synthetic test 1 waves
            ./mak.convol.library  r06mm09  c   85   MMM      12  sleep 0.1 # 2009 85 channel global waves


# PRISMA 2021 ESA Earth orbiter, e.g. s06pr01a 238 channels:

            ./mak.convol.library   r06pr01  a 238  PRISMA21a 12  sleep 0.1 # PRISMA 2021

# ASD Field spectrometer, standard waves and resolution, 2151 channels:

           ./mak.convol.library  r06fs00   a 2151  ASDfs00a  12  sleep 0.1

# FTIR instruments:

           ./mak.convol.library  r06ag21   a  900  AGFTIRa   12  sleep 0.1

# Resonon Pika IR line-scan hyperspectral camera

           ./mak.convol.library  r06pkir   a 168   PIKAIRa   12  sleep 0.1   # Resonon Pika IR 0.9 - 1.7 microns


#########################################################################

After the new library is made, check to make sure the spectra look correct.

           spprint specprfilename

         e.g.
           spprint r06pr01a
