LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Public Member Functions | Static Public Attributes | Private Attributes | Static Private Attributes | List of all members
lsst.pipe.tasks.scaleZeroPoint.ScaleZeroPointTask Class Reference
Inheritance diagram for lsst.pipe.tasks.scaleZeroPoint.ScaleZeroPointTask:
lsst.pipe.tasks.scaleZeroPoint.SpatialScaleZeroPointTask

Public Member Functions

def __init__
 
def run
 
def computeImageScaler
 
def getCalib
 
def scaleFromCalib
 
def scaleFromFluxMag0
 

Static Public Attributes

 ConfigClass = ScaleZeroPointConfig
 

Private Attributes

 _calib
 

Static Private Attributes

string _DefaultName = "scaleZeroPoint"
 

Detailed Description

Compute scale factor to scale exposures to a desired photometric zero point

This simple version assumes that the zero point is spatially invariant.

Definition at line 131 of file scaleZeroPoint.py.

Constructor & Destructor Documentation

def lsst.pipe.tasks.scaleZeroPoint.ScaleZeroPointTask.__init__ (   self,
  args,
  kwargs 
)
Construct a ScaleZeroPointTask

Definition at line 139 of file scaleZeroPoint.py.

140  def __init__(self, *args, **kwargs):
141  """Construct a ScaleZeroPointTask
142  """
143  pipeBase.Task.__init__(self, *args, **kwargs)
144 
145  #flux at mag=0 is 10^(zeroPoint/2.5) because m = -2.5*log10(F/F0)
146  fluxMag0 = 10**(0.4 * self.config.zeroPoint)
147  self._calib = afwImage.Calib()
148  self._calib.setFluxMag0(fluxMag0)

Member Function Documentation

def lsst.pipe.tasks.scaleZeroPoint.ScaleZeroPointTask.computeImageScaler (   self,
  exposure,
  dataRef = None 
)
Compute image scaling object for a given exposure.

@param[in] exposure: exposure for which scaling is desired
@param[in] dataRef: dataRef for exposure.
               Not used, but in API so that users can switch between spatially variant
               and invariant tasks

Definition at line 166 of file scaleZeroPoint.py.

167  def computeImageScaler(self, exposure, dataRef=None):
168  """Compute image scaling object for a given exposure.
169 
170  @param[in] exposure: exposure for which scaling is desired
171  @param[in] dataRef: dataRef for exposure.
172  Not used, but in API so that users can switch between spatially variant
173  and invariant tasks
174  """
175  scale = self.scaleFromCalib(exposure.getCalib()).scale
176  return ImageScaler(scale)
177 
def lsst.pipe.tasks.scaleZeroPoint.ScaleZeroPointTask.getCalib (   self)
Get desired Calib

@return calibration (lsst.afw.image.Calib) with fluxMag0 set appropriately for config.zeroPoint

Definition at line 178 of file scaleZeroPoint.py.

179  def getCalib(self):
180  """Get desired Calib
181 
182  @return calibration (lsst.afw.image.Calib) with fluxMag0 set appropriately for config.zeroPoint
183  """
184  return self._calib
def lsst.pipe.tasks.scaleZeroPoint.ScaleZeroPointTask.run (   self,
  exposure,
  dataRef = None 
)
Scale the specified exposure to the desired photometric zeropoint

@param[in,out] exposure: exposure to scale; masked image is scaled in place
@param[in] dataRef: dataRef for exposure.
               Not used, but in API so that users can switch between spatially variant
               and invariant tasks
@return a pipeBase.Struct containing:
- imageScaler: the image scaling object used to scale exposure

Definition at line 149 of file scaleZeroPoint.py.

150  def run(self, exposure, dataRef=None):
151  """Scale the specified exposure to the desired photometric zeropoint
152 
153  @param[in,out] exposure: exposure to scale; masked image is scaled in place
154  @param[in] dataRef: dataRef for exposure.
155  Not used, but in API so that users can switch between spatially variant
156  and invariant tasks
157  @return a pipeBase.Struct containing:
158  - imageScaler: the image scaling object used to scale exposure
159  """
160  imageScaler = self.computeImageScaler(exposure=exposure, dataRef=dataRef)
161  mi = exposure.getMaskedImage()
162  imageScaler.scaleMaskedImage(mi)
163  return pipeBase.Struct(
164  imageScaler = imageScaler,
165  )
def lsst.pipe.tasks.scaleZeroPoint.ScaleZeroPointTask.scaleFromCalib (   self,
  calib 
)
Compute the scale for the specified Calib

Compute scale, such that if pixelCalib describes the photometric zeropoint of a pixel
then the following scales that pixel to the photometric zeropoint specified by config.zeroPoint:
    scale = computeScale(pixelCalib)
    pixel *= scale

@return a pipeBase.Struct containing:
- scale, as described above.

@note: returns a struct to leave room for scaleErr in a future implementation.

Definition at line 185 of file scaleZeroPoint.py.

186  def scaleFromCalib(self, calib):
187  """Compute the scale for the specified Calib
188 
189  Compute scale, such that if pixelCalib describes the photometric zeropoint of a pixel
190  then the following scales that pixel to the photometric zeropoint specified by config.zeroPoint:
191  scale = computeScale(pixelCalib)
192  pixel *= scale
193 
194  @return a pipeBase.Struct containing:
195  - scale, as described above.
196 
197  @note: returns a struct to leave room for scaleErr in a future implementation.
198  """
199  fluxAtZeroPoint = calib.getFlux(self.config.zeroPoint)
200  return pipeBase.Struct(
201  scale = 1.0 / fluxAtZeroPoint,
202  )
def lsst.pipe.tasks.scaleZeroPoint.ScaleZeroPointTask.scaleFromFluxMag0 (   self,
  fluxMag0 
)
Compute the scale for the specified fluxMag0

This is a wrapper around scaleFromCalib, which see for more information

@param[in] fluxMag0
@return a pipeBase.Struct containing:
- scale, as described in scaleFromCalib.

Definition at line 203 of file scaleZeroPoint.py.

204  def scaleFromFluxMag0(self, fluxMag0):
205  """Compute the scale for the specified fluxMag0
206 
207  This is a wrapper around scaleFromCalib, which see for more information
208 
209  @param[in] fluxMag0
210  @return a pipeBase.Struct containing:
211  - scale, as described in scaleFromCalib.
212  """
213  calib = afwImage.Calib()
214  calib.setFluxMag0(fluxMag0)
215  return self.scaleFromCalib(calib)
216 

Member Data Documentation

lsst.pipe.tasks.scaleZeroPoint.ScaleZeroPointTask._calib
private

Definition at line 146 of file scaleZeroPoint.py.

string lsst.pipe.tasks.scaleZeroPoint.ScaleZeroPointTask._DefaultName = "scaleZeroPoint"
staticprivate

Definition at line 137 of file scaleZeroPoint.py.

lsst.pipe.tasks.scaleZeroPoint.ScaleZeroPointTask.ConfigClass = ScaleZeroPointConfig
static

Definition at line 136 of file scaleZeroPoint.py.


The documentation for this class was generated from the following file: