文档库 最新最全的文档下载
当前位置:文档库 › Modtran_lab

Modtran_lab

Modtran_lab
Modtran_lab

Using MODTRAN

Predicting Sensor-Reaching Radiance?

Emmett J.Ientilucci,Ph.D.

Chester F.Carlson Center for Imaging Science

Rochester Institute of Technology

February5,2007

Abstract

The purpose of this lab is to expose the individual to the utilization of MODTRAN and ENVI https://www.wendangku.net/doc/5d6929406.html,ing GUI software,tape5input card decks will be modi?ed with an ex-

planation of relevant parameters.This card deck will be used to simulate an atmosphere over

Rochester,NY during the summertime.The actual execution of the MODTRAN code will

commence using a custom UNIX script written for the digital imaging and remote sensing

(DIRS)laboratory.This script will also,automatically,parse the MODTRAN output and

subsequently convert it to an ENVI spectral library.The output will be examined and used to

assemble a sensor-reaching radiance equation.Along the way,ENVI functions such as Spectral

Math,Spectral Resampling and the Spectral Library Viewer will be utilized.

It should be noted that this is a“live”document and is full of hyper-links to various web pages,etc.Hyper-links are in blue while section and Figure references are in red.

1What is MODTRAN?

MODTRAN is an acronym for MODerate spectral resolution atmospheric TRANsmittance algo-rithm and computer model,which is developed by the Air Force Research Labs(AFRL)in collabora-tion with Spectral Sciences,Inc(SSI).It is a computationally rigorous radiation transfer algorithm that is used to model the spectral absorption,transmission,emission and scattering characteristics of the atmosphere.This is accomplished by modeling the atmosphere as a set of homogeneous layers.The characteristics of these layers are either drawn from several internal model atmospheres (urban or rural,equatorial or arctic,etc.)or can be characterized by(user provided)radiosonde data collected about a speci?c atmosphere.

MODTRAN calculates atmospheric transmittance and radiance for frequencies from0to50,000 cm?1at moderate spectral resolution,primarily2cm?1(20cm?1in the UV).The original devel-opment of MODTRAN was driven by a need for higher spectral resolution and greater accuracy than that provided by the(much older)LOWTRAN series of band model algorithms.Except for its molecular band model parameterization,MODTRAN adopts all the LOWTRAN7capabilities,?This is version1.0of this document.Next version will include section on how to run MODTRAN without the use of CIS scripts.

1

including spherical refractive geometry,solar and lunar source functions,and scattering(Rayleigh, Mie,single and multiple),and default pro?les(gases,aerosols,clouds,fogs,and rain).MODTRAN version4,for example,has been available to the public since January2000and remains the state-of-the-art atmospheric band model radiation transport model.Further information can be found on the CIS Wiki MODTRAN FAQ.

2Objective

The intent of this exercise is to familiarize an individual with the atmospheric propagation code, MODTRAN.The overall goal will be to simulate what the sensor-reaching would be(using MOD-TRAN)as seen by JPL’s hyperspectral sensor,AVIRIS.We will assume the sensor is?ying over Rochester,NY in the summertime.Other details,such as time of day,day of year,etc.,are given in the problem formulation below.The individual will also gain experience using some of ENVI’s spectral tools.These include use of the spectral library viewer,spectral library resampling,and spectral math functionality.

2.1Resources

This lab will be performed in a UNIX environment,since that is where all the programs and tools are installed.As an overview you will be using the following programs and scripts to complete the exercise.

tape5edit You will need to edit the input?le(card deck)to MODTRAN.This input?le is usually called the tape5?le.It can be edited using the program tape5_edit which lives in/dirs/pkg/dirsig/bin.You can type/dirs/pkg/dirsig/bin/tape5_edit from your current working directory to run it.

tape5edit Help Files A series of MS PowerPoint slides have been created to further describe the entries in the tape5?le.These can be found at https://www.wendangku.net/doc/5d6929406.html,/class/simg762/Lab3.

Additionally,a detailed description of each entry in the card deck can be found on the CIS Wiki site HERE.

MODTRAN Script The actual UNIX script to run MODTRAN and compute an ENVI spectral library can be downloaded HERE.You will need the Makefile,the IDL.pro?le,and the default tape5?le.Additional help can be found on the CIS Wiki HERE

Imagery and Re?ectance You will need a spectral re?ectance?le in addition to a small cube of AVIRIS hyperspectral imagery.These can be obtained HERE.

3Using MODTRAN to Simulate the Atmosphere

3.1MODTRAN Input:The Card Deck

MODTRAN uses a single ASCII?le as input called.This?le is called a“card deck”.Historically, inputs were read from punch cards back in the day when computers used such cards for data entry. The name is simply a carry over.An example of such a card deck can be seen below.

2

Figure1:Screen shot of the tape5edit program.

TS22210000001000.000 1.00

T8T0360.000000.80T F F0.000

11000010.0000.0000.0000.0000.079

20.5330.079180.0000.0000.0000.00000.000

121400

43.26077.6100.0000.00015.6700.0000.0000.000

0.380 2.5100.0100.010RM MR A

This card deck?le contains all the parameters necessary to model a particular atmosphere given a spectral range and viewing geometry.Unfortunately,this?le has strict formatting rules,which can make card deck editing and manipulation somewhat cumbersome.A detailed description of each entry in the card deck can be found on the CIS Wiki site HERE.

To create a card deck,one can simply open a new ASCII?le and?ll in the appropriate infor-mation.As previously mentioned,however,this can be complicated due to formatting issues.To make this process more intuitive,a graphical user interface(GUI)has been designed as a front end to the card deck.This program,which runs on the CIS UNIX systems,is called tape5_edit.See Sec.2.1on how to start it.

3.2Using the tape5Editor

The tape5_edit program is a graphical user interface(GUI)that can be used to aid in creating and/or modifying a tape5(card deck)?le.A screen grab of the editor can be seen in Figure1.

The tape5?le actually contains a sequence of six or more“cards”(input lines).For exam-ple,card1,which is the?rst line in the ASCII?le,contains information about the band model, speed,multiple scattering,etc.while card4speci?es the spectral range,frequency/wavelength

3

increments,and spectral degradation of the outputs using a slit function.

For this exercise you will want to simulate an atmosphere in Rochester(Lat=43.26,Long= 77.61),where the altitude,relative to sea level is260feet(GNDALT),the sensor is imaging at an altitude of67,365feet(H1)(i.e.,AVIRIS nominal operational altitude),the“?nal altitude”(H2) is260feet and the sensor angle is such that it is pointing down(i.e.,initial zenith angle=180 degrees(ANGLE)).Additionally,you will assume the collection occurred on May5,1999at12:40 EDT.Remember that there is a4hour di?erence to GMT(i.e.,at this time of the year,EDT versus EST),which you then need to convert to decimal time.Finally,you will want to generate radiance spectra from0.380μm to2.510μm in0.010μm increments with a slit function full width half max(FWHM)of0.010μm.To aid you in altering the default card deck(provided),you should be changing the following MODTRAN parameters:

?GNDALT

?H1,H2,ANGLE

?IDAY

?PARM1,PARM2,TIME

?V1,V2,DV,FWHM

All of the other input parameters can remain their default values.Save the tape5?le in your working directory.

3.3MODTRAN Output:Tape Files

Before you run MODTRAN,we should talk about what to expect from the program at completion. MODTRAN produces several output“tape”?les.These are called tape?les for historical reason since the output was recorded to several tapes to be disseminated at a later date.These?les contain information such as the sun location,meteorological descriptions,and concentrations of aerosols.Additionally,they contain the spectral behavior of the atmosphere which is typically found in parameters such as transmission,scattered radiance,etc.

The“tape7”?le,in particular,contains useful information for our purposes of modeling the sensor-reaching radiance.A detailed description of the various columns in the tape7?le can be found on the CIS Wiki HERE.At this point one would usually import this?le into a spreadsheet for further analysis and plotting.In this lab we will use the script provided to accomplish this.Feel free to examine the other output tape?les using the following command:

At your command prompt type:

>more mytape.txt

where‘my tape’is the name of the tape?le you wish to examine.Once the?le opens,you can scroll through a page at a time by hitting the space bar,or exit out of the view by hitting the“q”(for quit)key.

4

3.4Running MODTRAN using CIS Scripts

After editing and setting up your tape5?le,you are ready to run MODTRAN.Important:Be

sure you save your output?le with the name“tape5”.Not tape5_test or tape5_aviris,just

tape5.

For this exercise,and subsequent tasks in the remote sensing group,there are UNIX scripts that

not only run MODTRAN,but parse its output into a format that is easily understood.That is,

the scripts run MODTRAN and reformat the output into an ENVI spectral library(.sli)format to

be subsequently viewed in ENVI.

To utilize the script,you need to?rst obtain the all the necessary?les.These can be obtained HERE.You will need to download the Makefile,the IDL code make_modtran_envi_spectral_library.pro, and the example tape5?le.In general,we only want to run MODTRAN“locally”and only concern

ourself with the3previously stated?les.Additional help can be found on the CIS Wiki HERE.

To start MODTRAN,type the follow command at which time you will get the following logs:

terra>make local

make-e link

rm-f DATA

ln-s/dirs/lib/Mod4v1r1DATA

time nice/dirs/bin/Mod4v1r1.exe

After MODTRAN completes its run(which can take up to30+minutes,depending on the speed

of your machine)you should have a tape7?le in the form of an ENVI spectral library,as can be

seen from the screen output below.You can view this tape7.scn.sli?le in ENVI.

terra>ls-F

Makefile tape6

make_modtran_envi_spectral_library.pro tape7

pltout tape7.scn

pltout.scn tape7.scn.sli

tape5tape7.scn.sli.hdr

tape5_default tape8

4Sensor-Reaching Radiance

You can now use ENVI to view some of the terms contained in the tape7output?le.Again,these

terms are described in more detail on the CIS Wiki site HERE.You can view your tape7?le using

ENVI by?rst starting typing the command:

terra>envi

This will start your ENVI session.You then need to select,from the menu bar,Spectral

/Spectral Libraries/Spectral Library Viewer.This will bring up the Spectral Library

Input File dialog box at which time you select tape7.scn.sli as your input?le.Once the?le

is loaded you will have access to all the columns of the tape7?le,as seen in Figure2.A plot

will automatically be generated and displayed once you select a parameter from the list.You can compare these results to those found on the CIS Wiki HERE.Keep in mind,your results will not

be exactly like those on the CIS Wiki,for you are using a slightly di?erent tape5?le.

5

Figure2:Screen grab of spectral library viewer in ENVI.

4.1Obtaining Terms for your Sensor-Reaching Radiance Equation

Once we have all the atmospheric components,we can assemble them to form an overall sensor-reaching radiance or“big equation”.A detail overview of this process can be found on the CIS Wiki HERE.The total sensor radiance is provided in tape7(TOTAL RAD)but it is for a uniform spectral re?ectance of1.0.We would like to alter this.

We can represent the sensor-reaching radiance equation in3distinct parts.That is,the direct term,the downwelled(di?use)term and the upwelled(path scatter or skylight)term.

L=(Dirct Reflected Radiacne)+(Diffuse Reflected Radiance)+(Path Radiance)(1) using speci?c radiometric terms we have

L=Es*cos(theta)*tau1*tau2*r/pi+Ld*tau2*r+(Lu+Ladj)(2) or

L(λ)=

E s(λ)cosθτ1(λ)

r(λ)

π

+E ds(λ)

r(λ)

π

τ2(λ)+L us(λ)+L ad j(λ)(3)

where the subscript“s”refers to solar scatter radiance.The de?nitions of these term can be found HERE.Furthermore,the previous hyper link tells us that we can extract the following terms from the tape7?le:

?Direct re?ected radiance term(DRCT RFLT),assuming r=1.0

?Di?use re?ected radiance term(GRND RFLT-DRCT RFLT),assuming r=1.0

6

4.1.1Special Case for Path Radiance

To obtain the path radiance,L u,we actually have to create another MODTRAN run where we

set earth albedo equal to0.0.This will provide us with a total radiance(TOTAL RAD)where

the ground re?ected term(GND RFLT)is zeroed out and all we are left with is the path radiance

and some adjacent radiance(L u+L ad j).More information on this can be found on the Cis Wiki HERE.

For this exercise you will have to create another directory,and copy over the Makefile,

the IDL?le,and your tape5?le.Open the tape5_edit program and change the albedo term

in card1to0.0.Then run MODTRAN like before,as explained in Sec. 3.4.This will create another tape7.scn.sli(which you might want to rename along with its corresponding header to something like tape7.scn_r0.sli and tape7.scn_r0.sli.hdr)?le where we can now extract the

path radiance from the total radiance(TOTAL RAD).

4.2Resampling

Before we can construct our sensor-reaching radiance equation,we need a valid spectral re?ectance. More than likely,the pixel of interest in a given hyperspectral image will not be a uniform,spectrally

?at,object.In this exercise we have provided the spectral re?ectance of a red painted basketball court,as measured by a hand held spectrometer.However,the number of samples that make up

the spectral re?ectance(2151bands)does not match the number of samples from our modeled spectra(214bands).Therefore we need to resample the basketball re?ectance?le to that of the MODTRAN modeled output.Open the basketball court spectrum in ENVI by selecting,from the menu bar,File/Open Image File.

Resampling can be accomplished by selecting,from the ENVI menu,Spectral/Spectral Libraries /Spectral Library Resampling.This will bring up the Spectral Resampling Input File di-

alog box(see Figure3).Select the the basketball court?le as shown in Figure3.This will bring

up the Spectral Resampling Parameters dialog box,as seen in Figure3.Select the Input Data

File option and write the result to either a File or https://www.wendangku.net/doc/5d6929406.html,stly,you will be asked to enter

the File Containing Output Wavelengths.This is the?le in which ENVI will resample the bas-ketball spectrum to.That is,resample the basketball spectrum(2151bands)to the MODTRAN output?le(214bands).Select one of your simulations which contains214bands(see Figure4).

One of your data points may be out of the range of the input resampling range.Therefore you may receive a warning about this.We can ignore the warning for this exercise.You can then view the resampled spectrum using the spectral library viewer in ENVI.

4.3Assembling Sensor-Reaching Radiance Terms in ENVI:Spectral Math

Once you have the desired re?ectance and all the sensor-reaching radiance terms at your disposal,

you can assemble them into a single spectrum that represents the spectral radiance as seen by

the sensor,for the conditions,parameters and re?ectance set forth in the example.This can be accomplished by using ENVI’s spectral math feature.The ENVI on-line help provides an excellent explanation on how to use the spectral math feature.However,we will repeat some of the process here.

To start we will formulate the sensor-reaching radiance equation as follows:

L=(GRND_RFLT)r+(TOTAL_RAD_r0)(4)

7

Figure3:Screen grab of‘Spectral Resampling Input File’and‘Spectral Resampling Parameters’dialog box in ENVI.

Figure4:Screen grab of‘File Containing Output Wavelength’dialog box in ENVI.

8

Figure5:Screen grab of‘Spectral Math’and‘Spectral Pairing’dialog boxs in ENVI. where GRND RFLT is the ground re?ectanced radiance(with r=0)as previously explained,‘r’is the basketball spectral re?ectance(resampled),and TOTAL RAD r0is the total sensor reaching radiance where the earth albedo is0.0(i.e.,path radiance).We can assemble this in ENVI by selecting,from the?le menu,Basic Tools/Spectral Math.This brings up the Spectral Math dialog box.We then enter the expression(s1*s2)+s3,as seen in Figure5,followed by OK.This brings up the Variable to Spectra Pairing dialog box,where we map each variable to a spectrum.You must have each spectrum(GND RFLT,TOTAL RAD,and COUDRT1.110nohead re?um.txt) open in a separate‘Spectral Library Plot’in order for it to show up in the‘Available Spectra List’. At this point you can pair the variables with the appropriate spectra and click OK.This brings up the?nal sensor-reaching radiance estimate,which can be seen in Figure6.

4.4Applying A VIRIS Sensor Response

The last thing we would like to do is convolve or resample our sensor-reaching radiance estimate so that it has the same band centers as the AVIRIS sensor.This can be done very easily in ENVI. All you need is some AVIRIS imagery(with the full width half max(FWHM)information in the header)and the spectral curve you wish to resample.The process is exactly the same as previously explain in Sec.4.2.

First we need to save our(s1*s2)+s3results as a spectral library.This can be done by selecting,from the Spectral Math Result window,File/Save Plot As.../Spectral Library. Highlight the plot you wish to save and select OK.You can then name this?le(e.g.,s1\_s2\_s3.sli) and save it to the hard drive.

Now you need to open the AVIRIS data cube provided(aviris_roch_220bnd_Wcmsrum.img). Then select,from the ENVI?le menu,Spectral/Spectral Library Resampling.This brings up the Spectral Resampling Input File dialog box,as before in Sec. 4.2.We will be resam-

9

Figure6:Result of assembling the sensor-reaching radiance equation with a spectral re?ectance.

(a)Shows the spectrum with214MODTRAN bands while(b)shows the spectrum convolved with the AVIRIS sensor response and reduced to152bands(i.e.,water vapor regions removed).

pling the derived sensor-reaching radiance equation(s1\_s2\_s3.sli).So select s1\_s2\_s3.sli and hit OK.For the‘Spectral Resampling Parameters’dialog box,select‘Input Data File’and a name for the output?le(e.g.,s1\_s2\_s3\_resamp.sli).Finally select the?le that con-tains the band centers you want to resample to.In our case this will be the AVIRIS image (aviris_roch_220bnd_Wcmsrum.img).Select this?le followed by OK.As a side note,the orig-inal AVIRIS sensor has224bands(0.4μm to2.5μm).Our sample data has a few of the channels truncated due to low SNR thus leaving220bands.Furthermore,the data cube has many of the water absorption bands marked as‘ignore’.This is actually called a‘bad bands list’in ENVI,where the location of the bad bands are stored in the image header?le.Therefore,the?nal resampled sensor-reaching radiance will only have152band due to these omitted water bands.

Lastly,the results of the sensor respampling will appear in the‘Available Bands List’.You can view the resampled result by‘right’clicking on the s1\_s2\_s3\_resamp.sli?lename which brings up the Spectral Library Viewer.Your?nal sensor-resampled result should look similar to that shown in Figure6(b).

5Report Details

For this exercise you need to hand in your tape5?le along with(labeled)spectral plots of the direct term,di?use term and path radiance term.In addition,include(labeled)spectral plots of your sensor-reaching radiance with and with out the sensor response.

So that your report does not look like two pages of plots,include a brief write-up/explanation of what you did and how you did it.That is,explain some of the process and results you are handing in.

10

相关文档