LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
Public Member Functions | Public Attributes | List of all members
lsst.meas.deblender.plugins.DeblenderPlugin Class Reference

Public Member Functions

def __init__ (self, func, onReset=None, maxIterations=50, **kwargs)
 
def run (self, debResult, log)
 
def __str__ (self)
 
def __repr__ (self)
 

Public Attributes

 func
 
 kwargs
 
 onReset
 
 maxIterations
 
 iterations
 

Detailed Description

Class to define plugins for the deblender.

The new deblender executes a series of plugins specified by the user.
Each plugin defines the function to be executed, the keyword arguments
required by the function, and whether or not certain portions of the
deblender might need to be rerun as a result of the function.

Definition at line 68 of file plugins.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.meas.deblender.plugins.DeblenderPlugin.__init__ (   self,
  func,
  onReset = None,
  maxIterations = 50,
**  kwargs 
)
Initialize a deblender plugin

Parameters
----------
func: `function`
    Function to run when the plugin is executed.
    The function should always take
    `debResult`, a `DeblenderResult` that stores the deblender result,
    and `log`, an `lsst.log`, as the first two arguments, as well as
    any additional keyword arguments (that must
    be specified in ``kwargs``). The function should also return
    ``modified``, a `bool` that tells the deblender whether
    or not any templates have been modified by the function.
    If ``modified==True``, the deblender will go back to step
    ``onReset``, unless the has already been run ``maxIterations``.
onReset: `int`
    Index of the deblender plugin to return to if ``func`` modifies
    any templates. The default is ``None``, which does not re-run
    any plugins.
maxIterations: `int`
    Maximum number of times the deblender will reset when
    the current plugin
    returns ``True``.

Definition at line 76 of file plugins.py.

76  def __init__(self, func, onReset=None, maxIterations=50, **kwargs):
77  """Initialize a deblender plugin
78 
79  Parameters
80  ----------
81  func: `function`
82  Function to run when the plugin is executed.
83  The function should always take
84  `debResult`, a `DeblenderResult` that stores the deblender result,
85  and `log`, an `lsst.log`, as the first two arguments, as well as
86  any additional keyword arguments (that must
87  be specified in ``kwargs``). The function should also return
88  ``modified``, a `bool` that tells the deblender whether
89  or not any templates have been modified by the function.
90  If ``modified==True``, the deblender will go back to step
91  ``onReset``, unless the has already been run ``maxIterations``.
92  onReset: `int`
93  Index of the deblender plugin to return to if ``func`` modifies
94  any templates. The default is ``None``, which does not re-run
95  any plugins.
96  maxIterations: `int`
97  Maximum number of times the deblender will reset when
98  the current plugin
99  returns ``True``.
100  """
101  self.func = func
102  self.kwargs = kwargs
103  self.onReset = onReset
104  self.maxIterations = maxIterations
105  self.kwargs = kwargs
106  self.iterations = 0
107 

Member Function Documentation

◆ __repr__()

def lsst.meas.deblender.plugins.DeblenderPlugin.__repr__ (   self)

Definition at line 125 of file plugins.py.

125  def __repr__(self):
126  return self.__str__()
127 
128 

◆ __str__()

def lsst.meas.deblender.plugins.DeblenderPlugin.__str__ (   self)

Definition at line 122 of file plugins.py.

122  def __str__(self):
123  return ("<Deblender Plugin: func={0}, kwargs={1}".format(self.func.__name__, self.kwargs))
124 
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:174

◆ run()

def lsst.meas.deblender.plugins.DeblenderPlugin.run (   self,
  debResult,
  log 
)
Execute the current plugin

Once the plugin has finished, check to see if part of the deblender
must be executed again.

Definition at line 108 of file plugins.py.

108  def run(self, debResult, log):
109  """Execute the current plugin
110 
111  Once the plugin has finished, check to see if part of the deblender
112  must be executed again.
113  """
114  log.trace("Executing %s", self.func.__name__)
115  reset = self.func(debResult, log, **self.kwargs)
116  if reset:
117  self.iterations += 1
118  if self.iterations < self.maxIterations:
119  return self.onReset
120  return None
121 
def run(self, coaddExposures, bbox, wcs)
Definition: getTemplate.py:603

Member Data Documentation

◆ func

lsst.meas.deblender.plugins.DeblenderPlugin.func

Definition at line 101 of file plugins.py.

◆ iterations

lsst.meas.deblender.plugins.DeblenderPlugin.iterations

Definition at line 106 of file plugins.py.

◆ kwargs

lsst.meas.deblender.plugins.DeblenderPlugin.kwargs

Definition at line 102 of file plugins.py.

◆ maxIterations

lsst.meas.deblender.plugins.DeblenderPlugin.maxIterations

Definition at line 104 of file plugins.py.

◆ onReset

lsst.meas.deblender.plugins.DeblenderPlugin.onReset

Definition at line 103 of file plugins.py.


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