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 | List of all members
lsst.meas.algorithms.gaussianPsfFactory.GaussianPsfFactory Class Reference
Inheritance diagram for lsst.meas.algorithms.gaussianPsfFactory.GaussianPsfFactory:

Public Member Functions

def computeSizeAndSigma
 
def validate
 
def apply
 
def makeField
 

Static Public Attributes

tuple size
 
tuple sizeFactor
 
tuple minSize
 
tuple maxSize
 
tuple defaultFwhm
 
tuple addWing
 
tuple wingFwhmFactor
 
tuple wingAmplitude
 

Detailed Description

Factory for simple Gaussian PSF models

Provides a high-level interface to DoubleGaussianPsf and SingleGaussianPsf
by specifying Gaussian PSF model width in FWHM instead of sigma,
and supporting computing kernel size as a multiple of PSF width.
This makes it suitable for tasks where PSF width is not known in advance.

Definition at line 35 of file gaussianPsfFactory.py.

Member Function Documentation

def lsst.meas.algorithms.gaussianPsfFactory.GaussianPsfFactory.apply (   self,
  fwhm = None 
)
Construct a GaussianPsf

@param[in] self: an instance of ConfigClass
@param[in] fwhm: FWHM of core of star (pixels); if None then self.defaultFwhm is used
@return a DoubleGaussianPsf if self.addWing is True, else a SingleGaussianPsf

Definition at line 132 of file gaussianPsfFactory.py.

133  def apply(self, fwhm=None):
134  """Construct a GaussianPsf
135 
136  @param[in] self: an instance of ConfigClass
137  @param[in] fwhm: FWHM of core of star (pixels); if None then self.defaultFwhm is used
138  @return a DoubleGaussianPsf if self.addWing is True, else a SingleGaussianPsf
139  """
140  kernelSize, sigma = self.computeSizeAndSigma(fwhm)
141  if self.addWing:
142  wingsSigma = sigma * self.wingFwhmFactor
143  return DoubleGaussianPsf(kernelSize, kernelSize, sigma, wingsSigma, self.wingAmplitude)
144  else:
145  return SingleGaussianPsf(kernelSize, kernelSize, sigma)
Represent a Psf as a circularly symmetrical double Gaussian.
def lsst.meas.algorithms.gaussianPsfFactory.GaussianPsfFactory.computeSizeAndSigma (   self,
  fwhm = None 
)
Compute kernel size and star width as sigma

kernel size will be odd unless minSize or maxSize is used and that value is even.

@param[in] fwhm: FWHM of core star (pixels); if None then defaultFwhm is used
@return two values:
- kernel size (width == height) in pixels
- sigma equivalent to supplied fwhm, assuming a Gaussian (pixels)

@warning assumes a valid config

Definition at line 99 of file gaussianPsfFactory.py.

99 
100  def computeSizeAndSigma(self, fwhm=None):
101  """Compute kernel size and star width as sigma
102 
103  kernel size will be odd unless minSize or maxSize is used and that value is even.
104 
105  @param[in] fwhm: FWHM of core star (pixels); if None then defaultFwhm is used
106  @return two values:
107  - kernel size (width == height) in pixels
108  - sigma equivalent to supplied fwhm, assuming a Gaussian (pixels)
109 
110  @warning assumes a valid config
111  """
112  if fwhm is None:
113  fwhm = self.defaultFwhm
114 
115  if self.size is not None:
116  size = self.size
117  else:
118  desSize = (int(self.sizeFactor * fwhm) // 2) * 2 + 1 # make result odd
119  if self.minSize and self.minSize > desSize:
120  size = self.minSize
121  elif self.maxSize and self.maxSize < desSize:
122  size = self.maxSize
123  else:
124  size = desSize
125 
126  return size, fwhm * SigmaPerFwhm
def lsst.meas.algorithms.gaussianPsfFactory.GaussianPsfFactory.makeField (   cls,
  doc 
)
Make an lsst.pex.config.ConfigurableField

Definition at line 147 of file gaussianPsfFactory.py.

148  def makeField(cls, doc):
149  """Make an lsst.pex.config.ConfigurableField
150  """
151  def applyWrapper(config, **kwargs):
152  """Construct a Gaussian PSF
153 
154  @param[in] config: an instance of GaussianPsfFactory
155  """
156  return config.apply(**kwargs)
157  return ConfigurableField(
158  doc = doc,
159  target = applyWrapper,
160  ConfigClass=cls
161  )
162 
def lsst.meas.algorithms.gaussianPsfFactory.GaussianPsfFactory.validate (   self)

Definition at line 127 of file gaussianPsfFactory.py.

128  def validate(self):
129  Config.validate(self)
130  if self.minSize and self.maxSize and self.minSize > self.maxSize:
131  raise RuntimeError("minSize=%s > maxSize=%s" % (self.minSize, self.maxSize))

Member Data Documentation

tuple lsst.meas.algorithms.gaussianPsfFactory.GaussianPsfFactory.addWing
static
Initial value:
1 = Field(
2  doc = "Add a Gaussian to represent wings?",
3  dtype = bool,
4  optional = False,
5  default = True,
6  )

Definition at line 78 of file gaussianPsfFactory.py.

tuple lsst.meas.algorithms.gaussianPsfFactory.GaussianPsfFactory.defaultFwhm
static
Initial value:
1 = Field(
2  doc = "Default FWHM of Gaussian model of core of star (pixels)",
3  dtype = float,
4  default = 3.0,
5  check = isPositive,
6  )

Definition at line 72 of file gaussianPsfFactory.py.

tuple lsst.meas.algorithms.gaussianPsfFactory.GaussianPsfFactory.maxSize
static
Initial value:
1 = Field(
2  doc = "Maximum kernel size if using sizeFactor (pixels); ignored if size is not None",
3  dtype = int,
4  optional = True,
5  default = None,
6  check = isPositive,
7  )

Definition at line 65 of file gaussianPsfFactory.py.

tuple lsst.meas.algorithms.gaussianPsfFactory.GaussianPsfFactory.minSize
static
Initial value:
1 = Field(
2  doc = "Minimum kernel size if using sizeFactor (pixels); ignored if size is not None",
3  dtype = int,
4  optional = True,
5  default = 5,
6  check = isPositive,
7  )

Definition at line 58 of file gaussianPsfFactory.py.

tuple lsst.meas.algorithms.gaussianPsfFactory.GaussianPsfFactory.size
static
Initial value:
1 = Field(
2  doc = "Kernel size (width and height) (pixels); if None then sizeFactor is used",
3  dtype = int,
4  optional = True,
5  default = None,
6  check = isPositive,
7  )

Definition at line 43 of file gaussianPsfFactory.py.

tuple lsst.meas.algorithms.gaussianPsfFactory.GaussianPsfFactory.sizeFactor
static
Initial value:
1 = Field(
2  doc = "Kernel size as a factor of fwhm (dimensionless); " \
3  + "size = sizeFactor * fwhm; ignored if size is not None",
4  dtype = float,
5  optional = False,
6  default = 3.0,
7  check = isPositive,
8  )

Definition at line 50 of file gaussianPsfFactory.py.

tuple lsst.meas.algorithms.gaussianPsfFactory.GaussianPsfFactory.wingAmplitude
static
Initial value:
1 = Field(
2  doc = "wing amplitude, as a multiple of core amplitude (dimensionless); ignored if addWing false",
3  dtype = float,
4  optional = False,
5  default = 0.1,
6  check = isPositive,
7  )

Definition at line 91 of file gaussianPsfFactory.py.

tuple lsst.meas.algorithms.gaussianPsfFactory.GaussianPsfFactory.wingFwhmFactor
static
Initial value:
1 = Field(
2  doc = "wing width, as a multiple of core width (dimensionless); ignored if addWing false",
3  dtype = float,
4  optional = False,
5  default = 2.5,
6  check = isPositive,
7  )

Definition at line 84 of file gaussianPsfFactory.py.


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