AUTHOR: Tim Baltzer
Reverse the effects of illumination correction applied during calibration
- The name MULLI comes from ILLUMination correction, in reverse order. - This module will be called by procedure REATMO, used to process existing composites to apply atmospheric correction with water vapor taken into effect.
While developing the software to reprocess existing composites to apply atmospheric correction with water vapor, it was realized that some of these composites were created with illumination correction applied during calibration. This illumination correction needs to be 'backed out' prior to applying atmospheric correction to the existing composites. To complicate matters, the solar zenith angle used to apply illumination correction during calibration was not the solar zenith angle at the pixel being processed, but the solar zenith angle of the nadir pixel (see AVHRRCAL). This nadir solar zenith angle is not easily resurrected (since the image is now in composite space), but must be resurrected to accurately 'back-out' the effects of illumination correction. A separate routine must be written to accomplish this, a follow-on requirement from the effort to develop software to reprocess existing composites.
- IN
- Input image. IN must specify two LAS image bands which may be of any data type. Band one must contain AVHRR channel 1 data and band two must contain AVHRR channel 2 data. The values contained within IN must represent AVHRR data calibrated with illumination correction applied, such as that produced by AVHRRCAL.
- DATEBAND
- Date band. Image containing the date band from the compositing process. This image must be the same size and in the same projection space as IN.
- DATELOG
- Date log. The log file associated with the DATEBAND image which specifies the scenes used to generate the composite. The 'short' version (see '1992p19.log' for an example), and the 'long' version (see 'us_232245.log' for an example) are supported.
- SCALE
- Scale method. Scaling method used to store IN and OUT. The data type indicated in the image's DDR will be used to determine the scaling factor and offset value to use when scaling/unscaling the data. Valid values are 'GLOBAL' and 'US'. NOTE: Since Global 1KM composites are typically calibrated without applying illumination correction, SCALE should rarely be specified as 'GLOBAL'.
- OUT
- Output image containing calibrated AVHRR channels 1 and 2 WITHOUT the effects of illumination correction. The output image is the same size, data type, and in the same projection as the input image specified by IN.
The effect of illumination correction on calibration coefficients for optical bands can be expressed as follows: C_with_illum = C_without_illum * d * d / cos z where C_with_illum = the new Calibration coefficient with illumination correction C_without_illum = the old Calibration coefficient without illumination correction d = distance between the sun and the earth z = solar zenith angle Consequently, to 'undo' the effects of illumination correction, the following equation needs to be applied: C_without_illum = C_with_illum * cos z / (d * d) Refer to the 'EQUATION.NOTES' file (in the AVHRRCAL source code directory) for more information. Also refer to the NOAA POD Section 3.3 for more information.
- will not support windowing of the composite
- Gather user specified parameters, initialize TAE
- Read DATELOG file to determine the list of scenes used to create the composite and their relationship to the DATEBAND image (much like the module REATMOINFO does. REATMOINFO is part of the REATMO module).
- Calculate the earth-sun distance for the median day within the composite.
- Open IN image and DATEBAND image for reading, OUT image for writing
- for all lines do
- Read a line of data from IN image and DATEBAND image
- for all samples do
- Convert pixel line/sample to a lat/long value
- Using the DATEBAND pixel value, determine which acquisition image the pixel came from.
- Using the AVHRR model for the appropriate acquisition image, convert the lat/long value to a line/sample value in the acquisition image.
- Using the line value from the previous step and the nadir sample (always 2048/2=1024) value, convert this line/sample to a lat/long value.
- Determine the solar zenith angle at the lat/long computed in the previous step.
- 'Back-out' the effects of illumination correction from AVHRR channel 1 and 2 data using the equation k = (cos z) / (d * d) where:
- k : multiplication factor which will reverse the effects of illumination correction
- d : distance between the sun and the earth (in astronomical units)
- z : the nadir solar zenith angle computed above
- end for samples
- Write a line of data to OUT image
- end for lines
- Close all images and quit
- Test with a US composite with illumination correction applied, and a Global 1KM composite with illumination correction applied (providing one can be found!, this is not typically done). - Calibrate an AVHRR acquisition with illumination correction applied and without illumination correction applied. Run MULLI on the calibrated image where illumination correction was applied. The resulting output image from MULLI should be very close if not exactly the same as the image calibrated without illumination correction applied. - Run the above test with the images also reprojected into composite space instead of still being in satellite space.