This program applies a dark, flat-field and radiometric correction for each framelet based on the
band's filter number. There is also an optional mask to replace special pixels in the calibrated image. In order to output in I/F units, the cube must have spice
data.
Correction is applied in the following order: Dark, Flat-field, Radiometric, Special pixel mask
Dark Correction:
If DarkFile parameter is set, the given file(s) will be used for calibration. If DarkFile is set to
"Default" or not set the dark files will be looked up based on the time and temperature in the WAC being calibrated.
MiddleTemperatureFpa
is used for temperature and StartTime
for time. lrowaccal will attempt
to find the 2 dark files with closest time/temperature and interpolate/extrapolate from them. The method for finding dark
files is as follows:
- Create filename template based on WAC image offset and type (UV, BW, etc). example: WAC_UV_Offset68_*C_*T_Dark.????.cub
- Look in $lro/calibration/wac_darks for matching files.
- Sort files on to factors:
- abs(dark temp - WAC temp)
- abs(dark time - WAC time)
-
Example:
WAC Temp = 23.33 and WAC Time = 314264519.932493
WAC_UV_Offset68_-10C_319412928T_Dark.0005.cub
WAC_UV_Offset68_-15C_319412928T_Dark.0005.cub
WAC_UV_Offset68_-20C_311632116T_Dark.0005.cub
WAC_UV_Offset68_-20C_319412928T_Dark.0005.cub
WAC_UV_Offset68_-25C_319412928T_Dark.0005.cub
WAC_UV_Offset68_-30C_311632116T_Dark.0005.cub
becomes
WAC_UV_Offset68_-25C_319412928T_Dark.0005.cub
WAC_UV_Offset68_-20C_311632116T_Dark.0005.cub
WAC_UV_Offset68_-20C_319412928T_Dark.0005.cub
WAC_UV_Offset68_-30C_311632116T_Dark.0005.cub
WAC_UV_Offset68_-15C_319412928T_Dark.0005.cub
WAC_UV_Offset68_-10C_319412928T_Dark.0005.cub
- Take the 2 closest tempuratures (-25C and -20C in the example).
- Select the closest time for each tempurature.
Example result:
WAC_UV_Offset68_-25C_319412928T_Dark.0005.cub
WAC_UV_Offset68_-20C_311632116T_Dark.0005.cub
-
If only one tempurature is available, the 2 times closest to the WAC time will be chosen. This will
allow WACs to always be calibrated against something, instead of just failing.
Example result:
WAC_UV_Offset68_-20C_311632116T_Dark.0005.cub
WAC_UV_Offset68_-20C_319412928T_Dark.0005.cub
Once the dark files are found, the correction is applied:
output[pixel] -= (dark1[pixel] - dark2[pixel])/(dark1Temp - dark2Temp)*(frameTemp-dark2Temp) + dark2[pixel]
where
dark1, dark2 = dark file cubes
dark1Temp, dark2Temp = temperature of dark1 file and dark2 file
frameTemp = (WAC EndTemperatureFpa - WAC BeginTemperatureFpa)/WAC NumFramelets * frame + WAC BeginTemperatureFpa
Flat-field Correction:
output[pixel] /= flatfield[pixel]
If FlatfieldFile is not set, flat-field cube is loaded from $lro/calibration/wac_flats/WAC_<wac mode>_Flatfield.????.cub
Radiometric Correction:
output[pixel] /= WAC ExposureDuration
if radiometricType == iof
output[pixel] *= solarDistance2 / iofResponsivity[band]
else
output[pixel] /= radianceResponsivity[band]
where
solarDistance is distance from the Moon to the Sun
If RadiometricFile is not set, radiometric responsivity is loaded from $lro/calibration/WAC_RadiometricResponsivity.????.pvl
Special Pixel Mask:
for each framelet in output cube
if specialPixelMask[pixel] is special
outputFramelet[pixel] = specialPixelMask[pixel]
If SpecialPixelsFile is not set, special pixel mask is loaded from $lro/calibration/wac_masks/WAC_<wac mode>_<temp>C_SpecialPixels.????.cub. temp is closest temperature to WAC MiddleTemperatureFpa.