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 | Static Private Attributes | List of all members
lsst.pipe.tasks.scaleZeroPoint.SpatialScaleZeroPointTask Class Reference
Inheritance diagram for lsst.pipe.tasks.scaleZeroPoint.SpatialScaleZeroPointTask:
lsst.pipe.tasks.scaleZeroPoint.ScaleZeroPointTask

Public Member Functions

def __init__
 
def run
 
def computeImageScaler
 
- Public Member Functions inherited from lsst.pipe.tasks.scaleZeroPoint.ScaleZeroPointTask
def __init__
 
def run
 
def computeImageScaler
 
def getCalib
 
def scaleFromCalib
 
def scaleFromFluxMag0
 

Static Public Attributes

 ConfigClass = SpatialScaleZeroPointConfig
 
- Static Public Attributes inherited from lsst.pipe.tasks.scaleZeroPoint.ScaleZeroPointTask
 ConfigClass = ScaleZeroPointConfig
 

Static Private Attributes

string _DefaultName = "scaleZeroPoint"
 

Detailed Description

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

Definition at line 217 of file scaleZeroPoint.py.

Constructor & Destructor Documentation

def lsst.pipe.tasks.scaleZeroPoint.SpatialScaleZeroPointTask.__init__ (   self,
  args,
  kwargs 
)

Definition at line 223 of file scaleZeroPoint.py.

224  def __init__(self, *args, **kwargs):
225  ScaleZeroPointTask.__init__(self, *args, **kwargs)
226  self.makeSubtask("selectFluxMag0")

Member Function Documentation

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

@param[in] exposure: exposure for which scaling is desired. Only wcs and bbox are used.
@param[in] dataRef: dataRef of exposure
            dataRef.dataId used to retrieve all applicable fluxMag0's from a database.
@return a SpatialImageScaler

Definition at line 243 of file scaleZeroPoint.py.

244  def computeImageScaler(self, exposure, dataRef):
245  """Compute image scaling object for a given exposure.
246 
247  @param[in] exposure: exposure for which scaling is desired. Only wcs and bbox are used.
248  @param[in] dataRef: dataRef of exposure
249  dataRef.dataId used to retrieve all applicable fluxMag0's from a database.
250  @return a SpatialImageScaler
251  """
252 
253  wcs = exposure.getWcs()
254 
255  fluxMagInfoList = self.selectFluxMag0.run(dataRef.dataId).fluxMagInfoList
256 
257  xList = []
258  yList = []
259  scaleList = []
260 
261  for fluxMagInfo in fluxMagInfoList:
262  # find center of field in tract coordinates
263  if not fluxMagInfo.coordList:
264  raise RuntimeError("no x,y data for fluxMagInfo")
265  ctr = afwGeom.Extent2D()
266  for coord in fluxMagInfo.coordList:
267  #accumulate x, y
268  ctr += afwGeom.Extent2D(wcs.skyToPixel(coord))
269  #and find average x, y as the center of the chip
270  ctr = afwGeom.Point2D(ctr / len(fluxMagInfo.coordList))
271  xList.append(ctr.getX())
272  yList.append(ctr.getY())
273  scaleList.append(self.scaleFromFluxMag0(fluxMagInfo.fluxMag0).scale)
274 
275  self.log.info("Found %d flux scales for interpolation: %s"% (len(scaleList),
276  ["%0.4f"%(s) for s in scaleList]))
277  return SpatialImageScaler(
278  interpStyle = self.config.interpStyle,
279  xList = xList,
280  yList = yList,
281  scaleList = scaleList,
282  )
def lsst.pipe.tasks.scaleZeroPoint.SpatialScaleZeroPointTask.run (   self,
  exposure,
  dataRef 
)
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

@return a pipeBase.Struct containing:
- imageScaler: the image scaling object used to scale exposure

Definition at line 227 of file scaleZeroPoint.py.

228  def run(self, exposure, dataRef):
229  """Scale the specified exposure to the desired photometric zeropoint
230 
231  @param[in,out] exposure: exposure to scale; masked image is scaled in place
232  @param[in] dataRef: dataRef for exposure
233 
234  @return a pipeBase.Struct containing:
235  - imageScaler: the image scaling object used to scale exposure
236  """
237  imageScaler = self.computeImageScaler(exposure=exposure, dataRef=dataRef)
238  mi = exposure.getMaskedImage()
239  imageScaler.scaleMaskedImage(mi)
240  return pipeBase.Struct(
241  imageScaler = imageScaler,
242  )

Member Data Documentation

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

Definition at line 221 of file scaleZeroPoint.py.

lsst.pipe.tasks.scaleZeroPoint.SpatialScaleZeroPointTask.ConfigClass = SpatialScaleZeroPointConfig
static

Definition at line 220 of file scaleZeroPoint.py.


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