Coverage for python/lsst/pipe/tasks/interpImage.py : 92%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# # LSST Data Management System # Copyright 2008-2015 AURA/LSST. # # This product includes software developed by the # LSST Project (http://www.lsst.org/). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the LSST License Statement and # the GNU General Public License along with this program. If not, # see <https://www.lsstcorp.org/LegalNotices/>. #
"""Config for InterpImageTask """
dtype=bool, doc="Smoothly taper to the fallback value at the edge of the image?", default=True, ) dtype=str, doc="Type of statistic to calculate edge fallbackValue for interpolation", allowed={ "MEAN": "mean", "MEDIAN": "median", "MEANCLIP": "clipped mean", "USER": "user value set in fallbackUserValue config", }, default="MEDIAN", ) dtype=float, doc="If fallbackValueType is 'USER' then use this as the fallbackValue; ignored otherwise", default=0.0, ) dtype=bool, doc=("Allow negative values for egde interpolation fallbackValue? If False, set " "fallbackValue to max(fallbackValue, 0.0)"), default=False, )
self.fallbackUserValue < 0.0): "negativeFallbackAllowed is False" % self.fallbackUserValue)
"""Interpolate over bad image pixels """
"""Set the edge fallbackValue for interpolation
@param[in] mi input maksedImage on which to calculate the statistics Must be provided if fallbackValueType != "USER".
@return fallbackValue The value set/computed based on the fallbackValueType and negativeFallbackAllowed config parameters """ else: ("fallbackValueType", self.config.fallbackValueType))
"negativeFallbackAllowed is False: setting fallbackValue to 0.0")
(self.config.fallbackValueType, fallbackValue))
"""!Interpolate in place over pixels in a maskedImage marked as bad
Pixels to be interpolated are set by either a mask planeName provided by the caller OR a defects list of type measAlg.DefectListT. If both are provided an exception is raised.
Note that the interpolation code in meas_algorithms currently doesn't use the input PSF (though it's a required argument), so it's not important to set the input PSF parameters exactly. This PSF is set here as the psf attached to the "image" (i.e if the image passed in is an Exposure). Otherwise, a psf model is created using measAlg.GaussianPsfFactory with the value of fwhmPixels (the value passed in by the caller, or the default defaultFwhm set in measAlg.GaussianPsfFactory if None).
@param[in,out] image MaskedImage OR Exposure to be interpolated @param[in] planeName name of mask plane over which to interpolate If None, must provide a defects list. @param[in] fwhmPixels FWHM of core star (pixels) If None the default is used, where the default is set to the exposure psf if available @param[in] defects List of defects of type measAlg.DefectListT over which to interpolate. """
# set defectList from defects OR mask planeName provided raise ValueError("No defects or plane name provided") else: else: raise ValueError("maskedImage does not contain mask plane %s" % planeName)
# set psf from exposure if provided OR using modelPsf with fwhmPixels provided self.log.info("Setting psf for interpolation from image") (str(fwhmPixels) if fwhmPixels is not None else (str(self.config.modelPsf.defaultFwhm)) + " [default]"))
self.config.useFallbackValueAtEdge)
|