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

Public Member Functions

def __init__
 
def scaleMaskedImage
 
def getInterpImage
 
- Public Member Functions inherited from lsst.pipe.tasks.scaleZeroPoint.ImageScaler
def __init__
 
def scaleMaskedImage
 

Private Attributes

 _xList
 
 _yList
 
 _scaleList
 

Detailed Description

Multiplicative image scaler using interpolation over a grid of points.

Contains the x, y positions in tract coordinates and the scale factors.
Interpolates only when scaleMaskedImage() or getInterpImage() is called.

Currently the only type of 'interpolation' implemented is CONSTANT which calculates the mean.

Definition at line 52 of file scaleZeroPoint.py.

Constructor & Destructor Documentation

def lsst.pipe.tasks.scaleZeroPoint.SpatialImageScaler.__init__ (   self,
  interpStyle,
  xList,
  yList,
  scaleList 
)
Constructor

@param[in] interpStyle: interpolation style (CONSTANT is only option)
@param[in] xList: list of X pixel positions
@param[in] yList: list of Y pixel positions
@param[in] scaleList: list of multiplicative scale factors at (x,y)

@raise RuntimeError if the lists have different lengths

Definition at line 61 of file scaleZeroPoint.py.

61 
62  def __init__(self, interpStyle, xList, yList, scaleList):
63  """Constructor
64 
65  @param[in] interpStyle: interpolation style (CONSTANT is only option)
66  @param[in] xList: list of X pixel positions
67  @param[in] yList: list of Y pixel positions
68  @param[in] scaleList: list of multiplicative scale factors at (x,y)
69 
70  @raise RuntimeError if the lists have different lengths
71  """
72  if len(xList) != len(yList) or len(xList) != len(scaleList):
73  raise RuntimeError(
74  "len(xList)=%s len(yList)=%s, len(scaleList)=%s but all lists must have the same length" %
75  (len(xList), len(yList), len(scaleList)))
76 
77  #Eventually want this do be: self.interpStyle = getattr(afwMath.Interpolate2D, interpStyle)
78  self._xList = xList
79  self._yList = yList
80  self._scaleList = scaleList

Member Function Documentation

def lsst.pipe.tasks.scaleZeroPoint.SpatialImageScaler.getInterpImage (   self,
  bbox 
)
Return an image containing the scale correction with same bounding box as supplied.

@param[in] bbox: integer bounding box for image (afwGeom.Box2I)

Definition at line 89 of file scaleZeroPoint.py.

89 
90  def getInterpImage(self, bbox):
91  """Return an image containing the scale correction with same bounding box as supplied.
92 
93  @param[in] bbox: integer bounding box for image (afwGeom.Box2I)
94  """
95  npoints = len(self._xList)
96 
97  if npoints < 1:
98  raise RuntimeError("Cannot create scaling image. Found no fluxMag0s to interpolate")
99 
100  image = afwImage.ImageF(bbox, numpy.mean(self._scaleList))
101 
102  return image
103 
def lsst.pipe.tasks.scaleZeroPoint.SpatialImageScaler.scaleMaskedImage (   self,
  maskedImage 
)
Apply scale correction to the specified masked image

@param[in,out] image to scale; scale is applied in place

Definition at line 81 of file scaleZeroPoint.py.

81 
82  def scaleMaskedImage(self, maskedImage):
83  """Apply scale correction to the specified masked image
84 
85  @param[in,out] image to scale; scale is applied in place
86  """
87  scale = self.getInterpImage(maskedImage.getBBox())
88  maskedImage *= scale

Member Data Documentation

lsst.pipe.tasks.scaleZeroPoint.SpatialImageScaler._scaleList
private

Definition at line 79 of file scaleZeroPoint.py.

lsst.pipe.tasks.scaleZeroPoint.SpatialImageScaler._xList
private

Definition at line 77 of file scaleZeroPoint.py.

lsst.pipe.tasks.scaleZeroPoint.SpatialImageScaler._yList
private

Definition at line 78 of file scaleZeroPoint.py.


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