**The MISR_ENVI Tool**

**Overview**

The misr_envi tool makes available in ENVI the data from a MISR Level
1B2 radiance file in the original stacked block grid format. The data
are automatically geolocated and the band information is correctly
interpreted, improving the way ENVI understands such files and presents
their contents. The tool can be used with ENVI version 4.0 and higher.

The package allows the user to specify a MISR file to work with and to
select a set of contiguous blocks of interest within the file. For each
of the four MISR wavelength bands, the selected blocks are appended
together, applying the horizontal block offsets in the process so the
blocks retain the proper spatial orientation. The block group is
geolocated using projection information read from the file and
calculated for the specified start block. The bands are then added to
the ENVI Available Bands List. If the MISR Ancillary Geographic Product
(AGP) file for the corresponding path is available, that file can be
opened and the latitude, longitude and elevation fields will be added to
the Available Bands List. However, the AGP file is not required and the
software can be used without it.

Background information about the MISR stacked block grid file format and
MISR geolocation can be found in Appendix A of the MISR Data Products
Specification document, available online from the Documentation section
of the NASA Langley Atmospheric Sciences Data Center MISR data sets web
page:

http://eosweb.larc.nasa.gov/PRODOCS/misr/table_misr.html

Assistance with this software package may be obtained by contacting:

NASA Langley Atmospheric Sciences Data Center

User and Data Services

MS 157D, 2 S. Wright Street

Hampton, VA 23681-2199

e-mail: larc@eos.nasa.gov

phone : 757-864-8656

fax : 757-864-8807

**Installation**

1\) Extracting the files from the delivery package.

The read software is packaged as a tar file, misr_envi.tar, which can be
opened on both Unix and Windows systems. The tar file contains the IDL
source code file misr_envi.pro, supporting source code programs, a file
of MISR map projection data, and a sample ENVI menu file with a MISR
L1B2 option added.

On Unix systems, use the tar command below to extract the files. The
files will be written into the current directory on your system.

tar xvf misr_envi.tar

On Windows systems, a package such as WinZip for extracting from zipped
files will also extract from tar files. Use the package\'s extract
capability to put the package files into a directory on

your system.

If you are unable to work with the tar file package, the files may be
downloaded separately from the MISR tools area on the web page,

http://eosweb.larc.nasa.gov/PRODOCS/misr/misr_envi.html

2\) Copying the files to the appropriate locations in the ENVI directory
structure.

Copy all of the IDL program files (files with names that end in .pro) to
the ENVI save_add directory. As an example, on a PC with the latest
version of ENVI installed in the standard path, the location of the
save_add directory would be

C:\\RSI\\IDL60\\products\\envi40\\save_add

In the ENVI map_proj directory, edit the map_proj.txt file by adding the
lines from the supplied misr_map_proj.txt to the bottom of the
map_proj.txt file. NOTE: It is always a good idea to save a copy of the
original file before editing! The distribution package also contains a
version of map_proj.txt with the MISR projection information already
included, so this file may be copied into the map_proj directory in lieu
of editing the original map_proj.txt file if you have not made any other
changes to your map_proj.txt file. The map_proj.txt file did not change
between ENVI versions 4.0 and 4.1.

Optional: To access this tool via the ENVI menu, if you have not
otherwise modified the ENVI menu, copy the appropriate envi.men file
supplied in this package to the ENVI menu directory. Use
envi.men4.0wMISR if you are running ENVI 4.0, or envi.men.4.1wMISR if
you are running ENVI 4.1, renaming the file to envi.men. Or, if you have
made modifications to the default ENVI menu, you can edit that file to
add a selection that will run this program. As an example, to add MISR
L1B2 as a choice under the File -\> Open External File -\> EOS menu
structure, edit your existing envi.men file and change the menu section
that begins with 2 {EOS} as shown below, adding the line that begins
with 3 {MISR L1B2}:

2 {EOS}

3 {ASTER 1A/1B} {open aster} {envi_menu_event}

3 {MISR L1B2} {not used} {misr_envi}

3 {MODIS 1B} {open modis} {envi_menu_event}

3\) Customizing the directory path

The code may be customized to begin the search for data files and AGP
files in directories of your choosing. To do this you will need to open
and edit the misr_envi.pro file. This can be done on PCs in the IDL
development environment (idlde), which is also started when ENVI is
started. On Unix systems, idlde can be run from the Unix command prompt.
Or any text editor may be used. If using the idlde, from the File menu,
choose Open. A file selection dialog box will appear. Navigate to the
ENVI save_add directory. Choose misr_envi.pro and click Open. Edit the
values of the strings assigned to the variables DATApath and AGPpath to
specify your file locations. These assignments are located near the
beginning of the program, just after the initial section of comments.
Once the changes are made, save the file (from the idlde menu bar,
select File -\> Save). If you are working in the idlde, you can compile
the program to check that the changes did not introduce any errors. From
the idlde menu, select Run -\> Compile misr_envi.pro.

**Running the Program**

There are two ways to invoke the program:

1\) If you are using a modified ENVI menu file with the added MISR L1B2
option as discussed above, the program will be invoked when that option
is selected via File -\> Open External File -\> EOS -\> MISR L1B2 as
shown below.

![](media/image1.png){width="5.995138888888889in"
height="4.889583333333333in"}

Or,

2\) The program can be run from the ENVI command line. On PCs, the ENVI
command line is found in the IDL development environment (idlde) window
that starts at the same time ENVI is started. On Unix systems, the
command line appears in the window where the command to start ENVI was
entered. At the ENVI\> prompt, type

misr_envi

and the procedure will run.

![](media/image2.png){width="4.697916666666667in"
height="2.9270833333333335in"}

A dialog box is presented for selecting a MISR Level 1B2 file. If you
have customized the program with a specified directory path as discussed
in the previous section, that directory will be the initial directory
displayed. Use the dialog box to navigate to and open a MISR L1B2 file.
Note that the program expects the MISR files to retain their original
names. If the files have been renamed on your system, the code may not
work correctly.

![](media/image3.png){width="2.4402777777777778in"
height="1.2909722222222222in"}Next, choose the block range of interest.
The initial values displayed in the dialog box for this task are the
start and end blocks for the full range of good data in the selected
file; that is, the daylight portion of the orbit. Enter the starting and
ending block numbers for your range of interest and click DONE. Clicking
the RESET button will restore the original block extent values. Note
that the more blocks selected, the more memory and CPU processing is
required when working with the data in ENVI. A tool for determining MISR
paths and blocks that fall within a latitude/longitude box of interest
is available from the Tools section of the MISR data sets web page
(http://eosweb.larc.nasa.gov/PRODOCS/misr/table_misr.html).

Once the block range has been specified, the data are read and converted
from raw values to scaled floating point radiances (the two low order
quality bits are removed and the resulting value is multiplied by the
band-appropriate scale factor). Bad radiance pixel values are set to
zero. The data are geolocated and the four wavelength bands and
associated mapping information are populated in the ENVI Available Bands
List. For off-nadir cameras, where the red band has a higher resolution
than the other three wavelength bands, the red band is resampled to
match the resolution of the other bands.

A second file selection dialog box appears for opening the AGP file. If
the code was customized to specify a default AGP directory, that will be
the initial directory presented in the dialog box. The AGP whose
satellite path number matches that of the selected MISR data file will
be displayed if it exists in that directory. Use the dialog box to
navigate to and open the AGP file, or click the Cancel button to
continue without opening the AGP file.

![](media/image4.png){width="2.1902777777777778in"
height="4.063888888888889in"}

If the AGP file is found and opened, the "AveSceneElev", "GeoLatitude",
and "GeoLongitude" parameters for the previously selected block range
are read and populated in the ENVI available bands list.

At this point, the data are geolocated and ready to use in ENVI. Note
that these data are created in ENVI in memory. They can be saved to a
file by right-clicking on the data set heading (e.g. \[Memory1\]) in the
Available Bands List and selecting \"Save Selected File to Disk\...\" A
dialog box appears for naming the output file and choosing its directory
location.