Linearization is performed by new functors in ip_isr:
LinearizeBaseis an abstract base class. It is called with an image and the detector information and the correction is performed in place (like all other ISR corrections in
LinearizeSquaredperforms a simple square correction:
corrImage = uncorrImage + c0*uncorrImage^2where
c0is the first coefficient in in the linearity coefficients of the amp into catalog. This is the model used by
obs_subarufor SuprimeCam and HSC.
LinearizeLookupTableuses a lookup table to determine an offset (read the code doc string for details). The lookup table is saved with the linearizer, but the linearizer also performs a sanity check against the provided detector when called.
- You can easily add other linearizers as desired.
- Each linearizer has a class variable
LinearizationType, a string whose value should be used as the linearization type in the amplifier info catalog. The linearizer checks this value when performing linearization.
All detector in a camera must use the same type of linearizer. However linearization can easily be disabled on a detector-by-detector basis by setting linearity type = lsst.afw.cameraGeom.NullLinearityType. For a camera that does not need linearization, do this for all detectors.
Linearizers are obtained from the butler, like any other calibration product.
LinearizeSquaredand other linearizers that get coefficients from the amplifier info catalog, only one instance is needed for all detectors. In that case the simplest technique is to define
bypass_linearizemethods on the camera mapper to return an instance; see the
obs_subarupackage for an example.
LinearizeLookupTableand other linearizers that store detector-specific data, the obs_ package developer must pickle one linearizer for each detector and make them available as dataset type “linearizer”.
- If the camera does not want linearization then no “linearizer” dataset type is required because
IsrTaskrealizes linearization is not wanted before it tries to unpersist the linearizer. You may leave
IsrConfig.doLinearizeset to its default value of
Truewithout significant performance penalty.