GLOBAL VARIABLES AND THEIR DESCRIPTIONS
INTEGER
ERRNO Error number for error control (1=at least one invalid input)
FILEMODE Switch to determine whether to output to file(1) or memory(0)
FPIN File pointer for input file (used in conjunction with C)
FPOCUB File pointer for output cube file (used in conjunction with C)
FPOH2O File pointer for water vapour file (used in conjunction with C)
HDREC Header size of AVIRIS Data File
IAER Aerosol Model Number (0-3)
ICH4 switch for including ch4 in transmission calculations (0,1)
ICO switch for including co in transmission calculations (0,1)
ICO2 switch for including co2 in transmission calculations (0,1)
IDAY # of days that have passed during the year
IDY day
IED1 ending wavelength index for 3-channel ratioing, window 1
IED1P14 ending wavelength index for 1.14 um water vapour band
IED2 ending wavelength index for 3-channel ratioing, window 2
IED3 ending wavelength index for 3-channel ratioing, window 3
IED4 ending wavelength index for 3-channel ratioing, window 4
IEDCAL
IEDP94 ending wavelength index for 0.94 um water vapour band
IEND
IEND2
IH hour
IH2OLQ Flag for including liquid water vapour in calculations
IH2OVP switch for including h2o in transmission calculations (0,1)
IM minute
IMN month
IN2O switch for including n2o in transmission calculations (0,1)
IO2 switch for including o2 in transmission calculations (0,1)
IO3 switch for including o3 in transmission calculations (0,1)
IS seconds
IST1 starting wavelength index for 3-channel ratioing, window 1
IST1P14 starting wavelength index for 1.14 um water vapour band
IST2 starting wavelength index for 3-channel ratioing, window 2
IST3 starting wavelength index for 3-channel ratioing, window 3
IST4 starting wavelength index for 3-channel ratioing, window 4
ISTART
ISTRT2
ISTCAL
ISTP94 starting wavelength index for 0.94 um water vapour band
IYR year
JA output parameter from a table searching routine
MODEL Atmospheric Model Number (1-7)
NOBS # of observations in wavelength file
NATOT # of channels for AVIRIS grating Spectrometer A
NB # OF boundaries in atmospheric model
NB1 # of points to average for 1st window (0.94um channel)
NB2 # of points to average for 2nd window (0.94um channel)
NBP94 # of points to average for absorption feature
NB3 # of points to average for 3rd window (1.14um channel)
NB4 # of points to average for 4th window (1.14um channel)
NB1P14 # of points to average for absorption feature
NBANDS # of bands in AVIRIS Data File
NBTOT # of channels for AVIRIS grating Spectrometer B
NCTOT # of channels for AVIRIS grating Spectrometer C
NCV
NCV2
NCVHAF
NCVHF2
NCVTOT
NCVTT2
NDTOT # of channels for AVIRIS grating Spectrometer D
NGASTT total number of gases
NH2O number of water vapour values
NL NL=NB-1
NLINES # of lines in AVIRIS Data File
NO3PT # of ozone absolute coefficients points
NPSHIF # of points between 0.4 and 0.6 um
NSAMPS # of samples in AVIRIS Data File
REFIMG Memory file pointer for reflectance image
SORDER Storage order of AVIRIS DATA (0=BSQ, 1=BIP, 2=BIL)
WVIMG Memory file pointer for water vapour image
REAL
BUFA intermediate parameter for calculating water vapour spectra
BUFB intermediate parameters for calculating water vapour spectra
CLMVAP Column water vapour amount in cm
DLT Spectral Resolution (nm)
DLT2 Resolution of output spectra (0-100 nm)
DLTNEW Spectral Resolution (um) [DLT/1000]
DP
DWAVLN interval (or point spacing) of band model parameters
FINST2
FINSTR Gaussian instrumental function for each AVIRIS channel
FWHM(512) FWHM array for storing FWHM values for each channel
GCH4 Geometric Factor for Methane
GCO Geometric Factor for Carbon Monoxide
GCO2 Geometric Factor for Carbon Dioxide
GGEOM Geometric Factors for Gases
GGH20(60) Geometric Factors for water vapour
GN2O Geometric Factors for Nitrous Oxide
GO2 Geometric Factor of Oxygen
GO3 Geometric Factor of Ozone
H(15) Atmospheric Model Altitude (km) for each boundary
HSURF Mean surface elevation of image [0 – H(max)]
OBSPHI Observational Azimuth Angle
OBSZNI Observational Zenith Angle
P(15) Atmospheric Model Pressure (atm) for each boundary
PM
Q # of molecules about the surface at 1 atm (molecules/cm^2)
R094 channel ratio for .94 um region *
R114 channel ratio for 1.14 um region *
RLQAMT liquid water amount (cm)
SCALEF scaling factor for output reflectance values [1-32000]
SOLAZ Solar Azimuth Angle
SOLZNI Solar Zenith Angle
T(15) Atmospheric Model Temperature (Kelvin) for each boundary
TAER55 Aerosol Optical Depth at 0.55um for 5S model
TM(15) Median Temperature between Atmospheric Model Boundaries
TOTLO3 Total OZONE in sun-surface ray path
TPVMR(6,41) 2D array of values for six standard atmospheric models
TRAN Transmittances of different gases
TRNCAL atmospheric transmittance spectra
TRNSTD Transmittances used in internal calculations
V Visibility
VAPTT geometrically adjusted water vapour total
VEND ending wavelengths in internal calculations.
VMIN minimum wavelength to calculate atmospheric transmissions
VMR(15) Atmospheric Model Volume Mixing Ratio (ppm of each layer)
VMRM(15)
VRTO3 Column ozone amount (0.1 – 0.6)
VSTART starting wavelengths in internal calculations
WAVAVR(512) wavelengths of the AVIRIS channel centers (um)
WAVSTD(1050) Wavelengths used in internal calculations
WNDOW1 Midpoint of first window (0.94um channel) [0.6-2.5]
WNDOW2 Midpoint of second window (0.94um channel) [0.6-2.5]
WP94C Midpoint of water vapour absorption feature [0.6-2.5]
WNDOW3 Midpoint of third window (1.14um channel) [0.6-2.5]
WNDOW4 Midpoint of fourth window (1.14um channel) [0.6-2.5]
W1P14C Midpoint of 1.14um absorption feature [0.6-2.5]
WT1 Relative weight for window1
WT2 Relative weight for window2
WT3 Relative weight for window3
WT4 Relative weight for window4
XLATD Latitude, degrees
XLATM Latitude, minutes
XLATS Latitude, seconds
XLONGD Longitude, degrees
XLONGM Longitude, minutes
XLONGS Longitude, seconds
YY
CHARACTER*1
LATHEM Latitude, hemisphere
LNGHEM Longitude, hemisphere
CHARACTER*80
FINAV AVIRIS Data File Name
FOCUB Output reflectance cube file name
FOH2O output water vapour filename (512byte header,1band,BSQ)
GLOBAL PARAMETER LISTS
IN FORTRAN
AH2O_INIT1: AH2O
APH2O_INIT1: APH2O
BH2O_INIT1: BH2O
BPH2O_INIT1: BPH2O
CHNLRATIO1: R094,R114
ERRORS: ERRNO
GEOMETRY1: SOLZNI,SOLAZ,OBSZNI,OBSPHI,IDAY
GEOMETRY2: GCO2,GO3,GN2O,GCO,GCH4,GO2,GGH2O,TOTLO3,GGEOM
GETINPUT1: IH2OVP,ICO2,IO3,IN2O,ICO,ICH4,IO2
GETINPUT3: H,T,P,VMR,NB,NL,MODEL,IAER,V,TAER55,VRTO3
GETINPUT4: WAVAVR,FWHM
GETINPUT5: NOBS,HSURF,DLT,DLT2
GETINPUT6: WNDOW1,WNDOW2,WP94C,WNDOW3,WNDOW4,W1P14C
GETINPUT7: NB1,NB2,NBP94,NB3,NB4,NB1P14
GETINPUT8: IMN,IDY,IYR,IH,IM,IS
GETINPUT9: XLATD,XLATM,XLATS,LATHEM
GETINPUT10: XLONGD,XLONGM,XLONGS,LNGHEM
GETINPUT11: HDREC,NSAMPS,NLINES,NBANDS,SORDER
GETINPUT12: SCALEF
INIT_SPECCAL1: WAVSTD,TRNSTD
INIT_SPECCAL2: NPSHIF,FINSTR,DWAVLN
INIT_SPECCAL3: IH2OLQ,RLQAMT,NGASTT,NH2O,VSTART,VEND
INIT_SPECCAL4: NO3PT,NCV,NCVHAF,NCVTOT,VMIN,ISTART,IEND
INIT_SPECCAL5: ISTCAL,IEDCAL,DP,PM,TM,VMRM
INIT_SPECCAL6: IST1,IED1,IST2,IED2,ISTP94,IEDP94
INIT_SPECCAL7: IST3,IED3,IST4,IED4,IST1P14,IED1P14
INIT_SPECCAL8: WT1,WT2,WT3,WT4,JA
INIT_SPECCAL9: TRAN,BUFA,BUFB
INIT_SPECCAL10: NCV2,NCVHF2,NCVTT2,ISTRT2,IEND2,FINST2
INIT_SPECCAL11: NATOT,NBTOT,NCTOT,NDTOT
MODEL_ADJ1: CLMVAP,Q
O3CF_INIT1: O3CF
OUTPUT_MODE: FILEMODE
PROCCUBE1: YY
SODLT_INIT1: SODLT
SOGAM_INIT1: SOGAM
SOLAR_IRR1: YIRR
TPVMR_INIT1: TPVMR
TRAN_TABLE1: GH2O,VAPTOT,R0P94,R1P14,TRNTBL
TRANCAL1: TRNCAL,VAPTT
WAVLN_INIT1: WAVLN
USE WITH C PROGRAMS FOR CUBE I/O
OUTCUBE: FPOCUB,FOCUB,REFIMG
INCUBE: FPIN,FINAV
OUTH2OVAP: FPOH2O,FOH2O,WVIMG
MAIN PROGRAM
CALL GET_INPUT: obtain information needed to process the AVIRIS data
IF NO ERRORS OCCUR in obtaining information
CALL MODEL_ADJ: resets the bottom boundary of the input model if the
surface elevation is greater than 0, and calculates
the column water vapour amount in the selected model.
CALL GEOMETRY: calculates the solar and the observational geometric
factors.
CALL SSSSS: predicts the satellite signal from 0.25-4.0 um assuming
cloudy atmospheric effects (gaseous absorption by water vapour,
carbon dioxide, oxygen and ozone; scattering by molecules and
aerosols are taken into account). Inhomogeneous ground
condition may be considered.
CALL INIT_SPECCAL: Initialises global data for spectrum calculations
CALL SOLAR_IRR: Obtain solar irradiances above the atmosphere corresponding
to the measurement time and geographic location.
CALL TRAN_TABLE: Generates a table consisting of 60 atmospheric
transmittance spectra at the AVIRIS solar and
observational geometry and with 60 column water vapour
values. This table also include the total amounts of
column water vapour used in the calculations, and the
3-channel ratios calculated from the window and absorption
channels in and around the 0.94 and 1.14um water vapour
bands
CALL PROCESS_CUBE: Processes an input cube one spectral slice at a time to
derive surface reflectance for each spectrum and
calculate the column water vapour amount for each pixel.
The derived surface reflectance values are written to
an output image file with the same dimensions as the
input image, and the column water vapour amounts are
written to a separate file as a single channel image.
ENDIF
END PROGRAM
GET_INPUT
LOCAL VARIABLES
INTEGER
ANS Verifier to read next line of input
DIMS(4) Values read from AVIRIS Data file when file first opened
Header size, samples, lines, bands
ST_ORDER Storage order read from AVIRIS Data file when file first opened
CHARACTER*80
FINPWV Wavelength file name
FTPVMR Atmospheric Model File name
FOUT1 Filename for output table, atmos. trans. spectra
LOGICAL
GOOD_DATA Logical telling whether data was correctly read in
REAL
X Channel Number
********************************************************************************
INITIALIZE GOOD_DATA
READ in MONTH, DAY, YEAR, HOUR, MINUTE, SECOND
VERIFY
READ LATITUDE
VERIFY
READ LONGITUDE
VERIFY
READ Spectral Resolution
IF Spectral Resolution > 0
IF NOT Valid Value (8-100)
Report Bad Data
ELSE
Initialise FWHM Array
ENDIF
ENDIF
READ Wavelength File Name
OPEN File
VERIFY OPEN
ELSE
READ DATA from file
CLOSE File
ENDIF
Determine of channel ratio should be read
VERIFY READ
IF READ
READ 0.94um Channel Ratio Parameters
VERIFY
READ 1.14um Channel Ratio Parameters
VERIFY
ELSE
INITIALIZE DEFAULT atmospheric window and wv absorption regions
ENDIF
READ atmospheric model to use
VERIFY READ
IF MODEL = 7 (user-defined) THEN
READ Atmospheric Model File name
OPEN Atmospheric Model File
READ Atmospheric Model File
ELSE
Initialise Model Parameters (NB,H,P,T,VMR) from predefined atmos. model array
ENDIF
Determine which gases to include in calculations
VERIFY READ
READ Total Column Ozone Amount
VERIFY READ
READ Aerosol Model and Visibility
VERIFY READ
IF no aerosol THEN
V = -1 (set for 5s modeling program)
no optical depth
ELSE
VERIFY Visibility
ENDIF
IF no visibility THEN
READ aerosol optical depth
VERIFY READ
ENDIF
READ mean surface elevation
VERIFY READ
READ file name of AVIRIS Data
CALL OPENINFILE(IRET,DIMS,ST_ORDER)
VERIFY OPEN
Determine if cube dimensions should be read in
VERIFY READ
IF read in cube dimensions THEN
READ Header size, samples, lines, bands, and storage order
VERIFY READ
ELSE
USE values read from the file itself
ENDIF
READ Output reflectance cube file name
CALL OPENOUTFILE(IRET,512,NSAMPS,NLINES,NBANDS,SORDER)
VERIFY OPEN
READ Resolution of output spectra
VERIFY READ
READ scaling factor for output reflectance values
VERIFY READ
READ output water vapour file name
CALL OPENVAPFILE(IRET,512,NSAMPS,NLINES,1,0)
READ filename for output table
OPEN output table file
VERIFY OPEN
IF no good data THEN
ERRNO = 1
ELSE
ERRNO = 0
ENDIF
RETURN
MODEL_ADJ
Local Variables
INTEGER
K Index of HSURF in H
REAL
SL Slant path length
DSLODH =dSL/dH
RE Radius of Earth (m)
TSURF Surface Temperature at H(K) (Linearly interpolated)
VMRS Volume Mixing Ratio at H(K) (Linearly interpolated)
PSURF Surface Pressure at H(K) (Exponentially interpolated)
********************************************************************************
Set RE=6380
Set Q=2.152E25
Convert VMR from ppm unit to absolute unit by x 1.E-6
IF Surface Elevation > 0 THEN
Determine location of HSURF in H
Calculate change in model height
Calculate Change in height from surface elevation and location in H
Linearly Interpolate surface temp (TSURF) and VMR (VMRS)
Exponentially Interpolate for surface pressure (PSURF)
Reset Number of boundaries
Reset NL
Re-assign values from bottom up
Zero out pressures and VMRS of top atmospheric layers
ENDIF
Calculate Column water vapour amount by boundary and add up
RETURN
GEOMETRY
LOCAL VARIABLES
REAL
VAPVRT(60)
MD(12) Starting day of the year for the month (ie, June=151)
XLAT Latitude in Decimal Degrees
XLATR Latitude in Radians
XLONG Longitude in Decimal Degrees
XLONGR Longitude in Radians
XH Hours in real
XM Minutes in real
XS Seconds in real
TT Reference Time
DEC Declination of the Sun at time TT
HAZ Hour Angle minus Reference Time
EL Elevation
********************************************************************************
Convert Time of observation to distance in radians rotated by earth
Convert Latitude and Longitude into Radians
Assign Hemisphere to Lat and Long (S=-1;E=-1)
CALL SUNCOR(IDY,IMN,IYR,TT,DEC,HAZ)
CALL HAZEL(HAZ+TT-XLONGR,DEC,SOLAZ,EL,XLATR)
VERIFY ELEVATION
CONVERT Solar Azimuth to Radians
SET observation zenith and azimuth angles to 0; observations are straight down
CALCULATE solar zenith Angle
CALCULATE Gas Geometric Factor
CALCULATE individual Gas Geometric Factors
CALCULATE Total OZONE, ignore the 25 km ozone peak (AVIRIS flies below this)
CALCULATE the 60 water vapour geometry factors
CALCULATE # of days passed during the year the AVIRIS image was taken
RETURN
INIT_SPECCAL
LOCAL VARIABLES
REAL
FACDLT Factor to multiply DLT by to determine the range used in the
Gaussian function calculation for smoothing spectra
CONST1
CONST2 total area of Gaussian curve
DT small diff. between boundary layer temp and median temp (=TM-T)
DWVAVR Approximate wavelength spacing of AVIRIS data
RNCV
WAVCV
********************************************************************************
CALL WAVLN_INIT
SET the Number of column water vapour values
INDICATE if liquid water should be considered in the calculations
SET number of ozone data points
SET constants
CALCULATE FINSTR
DERIVE parameters and arrays to smooth output surface reflectance spectra
SET number of channels of the 4 AVIRIS spectrometers to be used in removing
null AVIRIS radiance values in the overlap portions
SET wv windows to closest AVIRIS wavelength
SET starting and ending wavelength indexes
CALCULATE weights for window and absorption channels
INITIALIZE JA for searching water vapour table (TRNTBL)
INITIALIZE WAVSTD (.4-3.0225)
INITIALIZE TRANSMITTANCE TABLE
INITIALIZE VMRM TABLE
CALCULATE median values between the atmos. model boundaries.
START TRANSMITTANCE CALCULATIONS LOOP
IF GAS NOT USED ASSIGN 1’s to transmittance table for that gas
CALCULATE transmittance of each gas separately
ASSIGN transmittance to transmittance table
END LOOP
SOLOR_IRR
REAL
E(1050) Solar Irradiances starting at 0.34
WL Wavelength spectrum
E_SM(1050) Smoothing Irradiance Array
********************************************************************************
ASSIGN solar irradiances to array E
GENERATE wavelength spectrum (0.3475-2.66 um)
INITIALIZE Smoothing Irradiance Array
INTERPOLATE values of Smoothing Irradiance Array to AVIRIS wavelengths
CORRECT for Sun-Earth distance
TRAN_TABLE
LOCAL VARIABLES
********************************************************************************
CALCULATE the geometrically adjusted water vapour amount, the channel ratios,
and the transmittance spectrum
CALL TRANCAL
WRITE calculated values to file
PROCESS_CUBE
c each slice is one line
c each line has nsamples
c each sample has nbands
DO for all lines
Read in spectral slice
CALL REFLDRV to create a surface reflectance spectrum
REPLACE reflectance values with the newly found true surface reflectance
STORE water vapour amounts
WRITE slice to output file
END DO
WRITE the water vapour image to file
Leave a Reply