Description
clemhirescal is meant to radiometrically calibrate Clementine HIRES camera images to I/F by applying flat field correction and then scaling pixel values by a calibration constant, _k_, that is chosen from a lookup table based on the image filter and gain mode. The values of _k_ themselves have been empirically derived in order to scale I/F values of the HIRES camera to be consistent with the Clementine UVVIS camera.
The k values currently used by clemhirescal are taken from Tables 5 and 6 in Robinson et al. (2003), but the _k_ values in those tables only work for a tiny minority of the possible MCP gain states, and even then only apply to the A and D filters of the camera. The good news is that on page 11 of the paper, the authors state that _k_ values for arbitrary MCP gain states of the A and D filters can be derived by fitting a line to the values in Tables 5 and 6, respectively.
Just doing a quick line fit in LibreOffice Calc, the calibration function for the A filter would be
k_A = (-5.33333333333333*10^-5*MCP_gain) + 0.00937
and for the D filter,
k_D = (-9.75301204819275*10^-5*MCP_gain) + 0.0163866265
(The paper also describes how a LUT of _k_ values can be established for the B and C filters, but this would require comparing a sample of HIRES images to co-registered UVVIS images and applying equations 5 and 6 from the paper [I don't know why the authors didn't just do this in the paper]. This would require considerable effort and it would only yield a first order approximation, so maybe not worth implementing at this time.)
tl;dr
clemhirescal currently uses a LUT of k values that only supports a minority of Clementine HIRES products, but the relevant source paper makes it sound like it's easy to derive k values to support all MCP gain states, at least for the A and D filters. Adding this feature would allow users to calibrate nearly all of the Clementine HIRES images from the A and D filters without necessarily having to derive calibration factors themselves.
Acceptance Criteria
clemhirescal applies calibration function (as described on Page 11 of Robinson et al. (2003)) to Clementine HIRES images taken through the A and D filters for arbitrary MCP gain statesclemhirescal must produce rasters with pixel values +/- 1% of results obtained with ISIS 3.8.0 for images collected in the subset of MCP gain states that are currently supported (no code regression)clemhirescal source code to correctly describe how the k values are determined in the updated codeExample Data
Processing consists of running clem2isis on Clementine HIRES EDRs (such as mentioned below), followed by spiceinit and then clemhirescal.
A Filter
An example image that is currently supported is /pds_san/PDS_Archive/Clementine/cl_0051/lun224/lhxxxxxx/lhxxxxxe/lha0547e.224. When this file is passed as input, an updated version of clemhirescal should yield a raster whose pixel values are each within 1% of a raster obtained by running the current version of clemhirescal.
An example image that is not currently supported is /pds_san/PDS_Archive/Clementine/cl_0034/lun155/lhxxxxxx/lhxxxxxm/lha4988m.155. This image should yield a calibrated output raster after clemhirescal is modified to use the calibration function described in Robinson et al. (2003)
D Filter
An example image that is currently supported is /pds_san/PDS_Archive/Clementine/cl_0054/lun237/lhxxxxxx/lhxxxxxn/lhd3924n.237. When this file is passed as input, an updated version of clemhirescal should yield a raster whose pixel values are each within 1% of a raster obtained by running the current version of clemhirescal.
An example image that is not currently supported is /pds_san/PDS_Archive/Clementine/cl_0018/lun088/lhxxxxxx/lhxxxxxh/lhd3062h.088. This image should yield a calibrated output raster after clemhirescal is modified to use the calibration function described in Robinson et al. (2003)
Product Owner
@dpmayerUSGS
@jessemapel Could you add the "Products" label to this issue?
I don't have permissions to add labels
@AustinSanders I updated the original issue to include example data from the A filter
The latest test results indicate a difference of ~.58% for "D" filter (original/new implementation). Original/new implementations yield an exact match for "A" filter.
@AustinSanders The following comment block should be updated to reflect the changes in the code:
https://github.com/AustinSanders/ISIS3/commit/3e79dc7c43dc8ba74eea1d7adc6dd9abe3ba1b03#diff-4b1c297d512780bc6b6834b3bbc890adL51-L53
The updated comment should read
Compute the K value to convert to I/F. The functions for K value per MCP gain state and filter are based on Robinson, M. S., Malaret, E., and White, T. ( 2003), A radiometric calibration for the Clementine HIRES camera, J. Geophys. Res., 108, 5028, doi:10.1029/2000JE001241, E4.
The functions were determined by fitting a line to the data in Table 5 (A filter) or Table 6 (D filter) of Robinson et al., as described on page 11.
The following 2 comments can be deleted:
https://github.com/AustinSanders/ISIS3/commit/3e79dc7c43dc8ba74eea1d7adc6dd9abe3ba1b03#diff-4b1c297d512780bc6b6834b3bbc890adL58
https://github.com/AustinSanders/ISIS3/commit/3e79dc7c43dc8ba74eea1d7adc6dd9abe3ba1b03#diff-4b1c297d512780bc6b6834b3bbc890adL71
@dpmayerUSGS @AustinSanders Can specific code feedback be left on a PR? Issues are not a very good venue for this type of discussion.
:+1:
On Nov 6, 2019, at 15:05, Jesse Mapel notifications@github.com wrote:

@dpmayerUSGS @AustinSanders Can specific code feedback be left on a PR? Issues are not a very good venue for this time of discussion.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
Most helpful comment
The latest test results indicate a difference of ~.58% for "D" filter (original/new implementation). Original/new implementations yield an exact match for "A" filter.