Purpose
To implement ATREM on ENVI©, RSI.
Introduction
ATREM, version 2.0.1, models the atmosphere and removes its effect from images; thus, producing a true ground reflectance image.
The Interface
The ATREM interface for ENVI was written in IDL version 4, by Minh Huynh, Ebor Computing.
The interface includes an input screen, see Fig. A1, that allows the user to enter data for the specific image. This data then may be saved and loaded again for the next time the image is process or for modification for a different image.
When the OK button has been pressed, the input data is syntactically verified. Although the user may enter erroneous data, the verification supposes that the user knows the correct information to input. The verification checks only for syntax of the input data.
A help file, see Appendix D, was created to help the user understand exactly what each field is asking for and how to input that information.
Modification of ATREM, v.2.0.1
ATREM was modified to allow for the ENVI (version 2.6) interface to work. Modification to the ATREM code itself was kept to a minimum. By keeping the changes to a minimum, programming errors are kept to a minimum as well. These changes allow for the code to be called from the created library file from within ENVI by an IDL calling procedure.
ENVI allows the processing of images to be alloted to memory; therefore, ATREM was modified to allow for the writing of the output to memory.
Table A1 shows the variable declarations added to the ATREM source code.
Table A1: Variable and Common block declarations and location.
Common Block | Variable Names | Variable Type | Subroutines | File Name | Description |
ERRORS | ERRNO | INTEGER | ATREM2 GET_INPUT | atrem.f | Input Error Control |
OUTPUTMODE | FILEMODE | INTEGER*2 | ATREM2 PROCESS_CUBE | atrem.f | 0 For Memory, |
RD_SPECTRAL_SLICEWT_SPECTRAL_SLICE
WT_SPATIAL_SLICE |
slice_io.f | 1 For File | |||
OUTCUBE | REFIMG | INTEGER | GET_INPUT PROCESS_CUBE | atrem.f | File Pointer For |
RD_SPECTRAL_SLICEWT_SPECTRAL_SLICE
WT_SPATIAL_SLICE |
slice_io.f | Image Cube | |||
OUTH2OVAP | WVIMG | INTEGER | GET_INPUT PROCESS_CUBE | atrem.f | File Pointer For |
RD_SPECTRAL_SLICEWT_SPECTRAL_SLICE
WT_SPATIAL_SLICE |
slice_io.f | Water Vapour Image | |||
DATAFILE | CHARACTER*80 | ATREM2 GET_INPUT | atrem.f | Name Of The Input Data File | |
FILESIZE | INTEGER | ATREM2 GET_INPUT | atrem.f | Length Of Input Data Filename |
Operation of ATREM in ENVI
From the menu bar, see Fig. A2, select the LSOD menu button, and then choose ATREM from the menu presented. This will then bring up the interface window, see Fig. A1. One can load a previously saved input file, enter their own data, and save an input file for later use.
When the OK button is clicked, ATREM is called, processes the image and returns the output file to ENVI.
Figure A1: Input screen for ENVI/ATREM interface.
Figure A2: ENVI main screen with ATREM choice showing.
Current Status
ATREM is currently on the computer jock in the image2/athodey directory. The atrem folder contains the source folder for the ATREM/ENVI interface. The original directory contains the original ATREM source files and an executable named atrem.
To create the library file for ATREM for ENVI, type at the prompt % make -f atrem.mak in the C_SRC directory. To compile the ATREM for ENVI interface, goto the IDL_SRC directory, run IDL and type at the IDL prompt IDL> @compile_atrem. Then, one needs to move the ATREM_SAV.SAV file to the ENVI save_add directory. Before compiling the interface code, make sure that it points to the location of the library file containing the ATREM code.
The input screen works although when the OK button is hit, an error occurs. This will need to be fixed.
The next step I to revise the IDL code such that the program will run and create the processed image and then input the image back to ENVI and then return control to ENVI.
Leave a Reply