Solar Illumination and Sensor Viewing Angle Generation for Landsat 8 -------------------------------------------------------------------------------- (A) About A Prototype tool is available on the Landsat website at https://www.usgs.gov/land-resources/nli/landsat/solar-illumination-and-sensor-viewing-angle-coefficient-files which generates sensor viewing and solar illumination angles for Landsat 8 mission. To use the angle generation tool you must have an angle coefficient text file (*_ANG.txt) for the Level 1 product you are using. This ANG file is created at product generation time from the geometric model and grid files used to perform the geometric correction. The angle generation tool generates binary image files containing 16-bit integers representing the zenith and azimuth angle in units of degrees scaled by 100. The azimuth and zenith angles are written into the same file in band sequential order (azimuth first). Steps required for building and running the tool are provided below. (B) Prerequisite This tool is designed to be built in a GNU C/Linux environment and all steps below assume this environment. (C) Building the tool 1. The software source code is contained in a zipped tar file called L8_ANGLES_2_7_0.tgz. To extract the source files from the tar file, use the following command from within the directory where the file is located: tar xvfz L8_ANGLES_2_7_0.tgz This will create a subdirectory called l8_angles in the current working directory containing the C source code as well as a subdirectory containing the library ias_lib. 2. To build the solar and view angle generation tool, navigate to the l8_angles directory and run the command: make This command creates an executable file called either l8_angles. The main driver routine l8_angles.c and its Makefile can serve as a template for incorporating this logic into other software. (D) Testing 3. The executable should now be present in the root directory. Test the executable by running the following: ./l8_angles --help This command should return the help text associated with the tool which provides some information on the options available in the tool. The output should be as follows: Usage: l8_angles : (Required) Angle coefficient filename : (Required) The type of angles to generate VALID: (BOTH, SATELLITE, SOLAR) : (Required) Sub-sample factor used when calculating the angles (integer) -f : (Optional) Fill pixel value to use (short int) units used is degrees scaled by 100 Default: 0 Range: (-32768:32767) -b : (Optional) Band list used to calculate angles for, this defaults to all bands 1 - 11. Must be comma separated with no spaces in between. Example: 1,2,3,4,5,6,7,8,9 (E) Running the tool 4. The Landsat 8 tool has two required options and two optional ones. One required option, AngleType, is for selecting solar illumination and/or satellite viewing angles (SOLAR, SATELLITE, BOTH) with “sensor” or “solar” appearing in the filenames of the binary image files. Another required option, SubsampleFactor, is to generate angles for every Level-1 pixel or to generate a subsampled output resulting in an average angle for the imaging pixels within the subsampled area. This is specified by providing an integer subsampling factor (i.e. 1, 2, 5, etc.). The fill value (FillValue) for pixels in the angle bands which correspond to fill data within the normal image bands can optionally be set (default: 0, range: -32768:32767). Finally, the tool can be run over a selected subset of bands, BandList, (default: all). If a list is provided, it must be comma separated with no spaces (i.e. 1,2,3,4,5,6,7,9). The command line format for the tool is: file_location/l8_angles <*_ANG.txt> -f -b with and being required and and optional.