22__all__ = [
"PhotoCalib"]
28from astropy
import units
32from ._imageLib
import PhotoCalib
42 """Get the local calibration values (nJy/counts) for numpy arrays (pixels).
47 Array of x values (pixels).
49 Array of y values (pixels).
53 localCalibration : `np.ndarray` (N,)
54 Array of local calibration values (nJy/counts).
57 return np.full(len(x), self.getCalibrationMean())
59 bf = self.computeScaledCalibration()
60 return self.getCalibrationMean()*bf.evaluate(x, y)
63 """Convert instFlux (counts) to magnitudes for numpy arrays (pixels).
67 instFluxes : `np.ndarray` (N,)
68 Array of instFluxes to convert (counts).
70 Array of x values (pixels).
72 Array of y values (pixels).
76 magnitudes : `astropy.units.Magnitude` (N,)
77 Array of AB magnitudes.
80 nanoJansky = (instFluxes*scale)*units.nJy
82 return nanoJansky.to(units.ABmag)
85 """Convert magnitudes to instFlux (counts) for numpy arrays (pixels).
89 magnitudes : `np.ndarray` or `astropy.units.Magnitude` (N,)
90 Array of AB magnitudes.
92 Array of x values (pixels).
94 Array of y values (pixels).
98 instFluxes : `np.ndarray` (N,)
99 Array of instFluxes (counts).
103 if not isinstance(magnitudes, units.Magnitude):
104 _magnitudes = magnitudes*units.ABmag
106 _magnitudes = magnitudes
108 nanoJansky = _magnitudes.to(units.nJy).value
110 return nanoJansky/scale
115 """Return a flux calibrated image, with pixel values in nJy.
117 Mask pixels are propagated directly from the input image.
121 maskedImage : `lsst.afw.image.MaskedImage`
122 The masked image to calibrate.
123 includeScaleUncertainty : `bool`, optional
124 Deprecated and ignored; will be removed after v29.
128 calibrated : `lsst.afw.image.MaskedImage`
129 The calibrated masked image.
131 if includeScaleUncertainty
is not _UnsetEnum.UNSET:
133 "The 'includeScaleUncertainty' argument to calibrateImage is deprecated and does "
134 "nothing. It will be removed after v29.",
135 category=FutureWarning
137 return self._calibrateImage(maskedImage)
142 """Return a un-calibrated image, with pixel values in ADU (or whatever
143 the original input to this photoCalib was).
145 Mask pixels are propagated directly from the input image.
149 maskedImage : `lsst.afw.image.MaskedImage`
150 The masked image with pixel units of nJy to uncalibrate.
151 includeScaleUncertainty : `bool`, optional
152 Deprecated and ignored; will be removed after v29.
155 uncalibrated : `lsst.afw.image.MaskedImage`
156 The uncalibrated masked image.
158 if includeScaleUncertainty
is not _UnsetEnum.UNSET:
160 "The 'includeScaleUncertainty' argument to uncalibrateImage is deprecated and does "
161 "nothing. It will be removed after v29.",
162 category=FutureWarning
164 return self._uncalibrateImage(maskedImage)
uncalibrateImage(self, maskedImage, includeScaleUncertainty=_UnsetEnum.UNSET)
instFluxToMagnitudeArray(self, instFluxes, x, y)
getLocalCalibrationArray(self, x, y)
magnitudeToInstFluxArray(self, magnitudes, x, y)
calibrateImage(self, maskedImage, includeScaleUncertainty=_UnsetEnum.UNSET)