LSST Applications  21.0.0-147-g0e635eb1+1acddb5be5,22.0.0+052faf71bd,22.0.0+1ea9a8b2b2,22.0.0+6312710a6c,22.0.0+729191ecac,22.0.0+7589c3a021,22.0.0+9f079a9461,22.0.1-1-g7d6de66+b8044ec9de,22.0.1-1-g87000a6+536b1ee016,22.0.1-1-g8e32f31+6312710a6c,22.0.1-10-gd060f87+016f7cdc03,22.0.1-12-g9c3108e+df145f6f68,22.0.1-16-g314fa6d+c825727ab8,22.0.1-19-g93a5c75+d23f2fb6d8,22.0.1-19-gb93eaa13+aab3ef7709,22.0.1-2-g8ef0a89+b8044ec9de,22.0.1-2-g92698f7+9f079a9461,22.0.1-2-ga9b0f51+052faf71bd,22.0.1-2-gac51dbf+052faf71bd,22.0.1-2-gb66926d+6312710a6c,22.0.1-2-gcb770ba+09e3807989,22.0.1-20-g32debb5+b8044ec9de,22.0.1-23-gc2439a9a+fb0756638e,22.0.1-3-g496fd5d+09117f784f,22.0.1-3-g59f966b+1e6ba2c031,22.0.1-3-g849a1b8+f8b568069f,22.0.1-3-gaaec9c0+c5c846a8b1,22.0.1-32-g5ddfab5d3+60ce4897b0,22.0.1-4-g037fbe1+64e601228d,22.0.1-4-g8623105+b8044ec9de,22.0.1-5-g096abc9+d18c45d440,22.0.1-5-g15c806e+57f5c03693,22.0.1-7-gba73697+57f5c03693,master-g6e05de7fdc+c1283a92b8,master-g72cdda8301+729191ecac,w.2021.39
LSST Data Management Base Package
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lsst.meas.base.diaCalculationPlugins.HTMIndexDiaPosition Class Reference
Inheritance diagram for lsst.meas.base.diaCalculationPlugins.HTMIndexDiaPosition:
lsst.meas.base.diaCalculation.DiaObjectCalculationPlugin lsst.meas.base.catalogCalculation.CatalogCalculationPlugin lsst.meas.base.pluginsBase.BasePlugin

Public Member Functions

def __init__ (self, config, name, metadata)
 
def getExecutionOrder (cls)
 
def calculate (self, diaObjects, diaObjectId, **kwargs)
 
def calculate (self, diaObject, diaSources, filterDiaFluxes=None, filterName=None, **kwargs)
 
def calculate (self, cat, **kwargs)
 
def fail (self, diaObject, columns, error=None)
 
def fail (self, measRecord, error=None)
 
def getLogName (self)
 

Static Public Member Functions

def getTransformClass ()
 

Public Attributes

 pixelator
 
 config
 
 name
 
 logName
 

Static Public Attributes

 ConfigClass = HTMIndexDiaPositionConfig
 
string plugType = 'single'
 
list inputCols = ["ra", "decl"]
 
list outputCols = ["pixelId"]
 
bool needsFilter = False
 
 registry = PluginRegistry(DiaObjectCalculationPluginConfig)
 
float FLUX_MOMENTS_CALCULATED = 5.0
 
float CENTROID_ORDER = 0.0
 
float SHAPE_ORDER = 1.0
 
float FLUX_ORDER = 2.0
 
float APCORR_ORDER = 3.0
 
float DEFAULT_CATALOGCALCULATION = 4.0
 

Detailed Description

Compute the mean position of a DiaObject given a set of DiaSources.

Definition at line 148 of file diaCalculationPlugins.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.meas.base.diaCalculationPlugins.HTMIndexDiaPosition.__init__ (   self,
  config,
  name,
  metadata 
)

Reimplemented from lsst.meas.base.diaCalculation.DiaObjectCalculationPlugin.

Definition at line 159 of file diaCalculationPlugins.py.

159  def __init__(self, config, name, metadata):
160  DiaObjectCalculationPlugin.__init__(self, config, name, metadata)
161  self.pixelator = sphgeom.HtmPixelization(self.config.htmLevel)
162 

Member Function Documentation

◆ calculate() [1/3]

def lsst.meas.base.catalogCalculation.CatalogCalculationPlugin.calculate (   self,
  cat,
**  kwargs 
)
inherited
Perform the calculation specified by this plugin.

This method can either be used to operate on a single catalog record
or a whole catalog, populating it with the output defined by this
plugin.

Note that results may be added to catalog records as new columns, or
may result in changes to existing values.

Parameters
----------
cat : `lsst.afw.table.SourceCatalog` or `lsst.afw.table.SourceRecord`
    May either be a `~lsst.afw.table.SourceCatalog` or a single
    `~lsst.afw.table.SourceRecord`, depending on the plugin type. Will
    be updated in place to contain the results of plugin execution.
**kwargs
    Any additional keyword arguments that may be passed to the plugin.

Definition at line 97 of file catalogCalculation.py.

97  def calculate(self, cat, **kwargs):
98  """Perform the calculation specified by this plugin.
99 
100  This method can either be used to operate on a single catalog record
101  or a whole catalog, populating it with the output defined by this
102  plugin.
103 
104  Note that results may be added to catalog records as new columns, or
105  may result in changes to existing values.
106 
107  Parameters
108  ----------
109  cat : `lsst.afw.table.SourceCatalog` or `lsst.afw.table.SourceRecord`
110  May either be a `~lsst.afw.table.SourceCatalog` or a single
111  `~lsst.afw.table.SourceRecord`, depending on the plugin type. Will
112  be updated in place to contain the results of plugin execution.
113  **kwargs
114  Any additional keyword arguments that may be passed to the plugin.
115  """
116  raise NotImplementedError()
117 
118 

◆ calculate() [2/3]

def lsst.meas.base.diaCalculation.DiaObjectCalculationPlugin.calculate (   self,
  diaObject,
  diaSources,
  filterDiaFluxes = None,
  filterName = None,
**  kwargs 
)
inherited
Perform the calculation specified by this plugin.

This method can either be used to operate on a single catalog record
or a whole catalog, populating it with the output defined by this
plugin.

Note that results may be added to catalog records as new columns, or
may result in changes to existing values.

Parameters
----------
diaObject : `dict`
    Summary object to store values in.
diaSources : `pandas.DataFrame`
    DataFrame representing all diaSources associated with this
    diaObject.
filterDiaFluxes : `pandas.DataFrame`
    DataFrame representing diaSources associated with this
    diaObject that are observed in the band pass ``filterName``.
filterName : `str`
    Simple name of the filter for the flux being calculated.
**kwargs
    Any additional keyword arguments that may be passed to the plugin.

Reimplemented in lsst.meas.base.diaCalculationPlugins.SigmaDiaTotFlux, lsst.meas.base.diaCalculationPlugins.WeightedMeanDiaTotFlux, lsst.meas.base.diaCalculationPlugins.StetsonJDiaPsFlux, lsst.meas.base.diaCalculationPlugins.LinearFitDiaPsFlux, lsst.meas.base.diaCalculationPlugins.ErrMeanDiaPsFlux, lsst.meas.base.diaCalculationPlugins.MaxSlopeDiaPsFlux, lsst.meas.base.diaCalculationPlugins.MinMaxDiaPsFlux, lsst.meas.base.diaCalculationPlugins.SkewDiaPsFlux, lsst.meas.base.diaCalculationPlugins.MadDiaPsFlux, lsst.meas.base.diaCalculationPlugins.Chi2DiaPsFlux, lsst.meas.base.diaCalculationPlugins.SigmaDiaPsFlux, lsst.meas.base.diaCalculationPlugins.PercentileDiaPsFlux, and lsst.meas.base.diaCalculationPlugins.WeightedMeanDiaPsFlux.

Definition at line 108 of file diaCalculation.py.

113  **kwargs):
114  """Perform the calculation specified by this plugin.
115 
116  This method can either be used to operate on a single catalog record
117  or a whole catalog, populating it with the output defined by this
118  plugin.
119 
120  Note that results may be added to catalog records as new columns, or
121  may result in changes to existing values.
122 
123  Parameters
124  ----------
125  diaObject : `dict`
126  Summary object to store values in.
127  diaSources : `pandas.DataFrame`
128  DataFrame representing all diaSources associated with this
129  diaObject.
130  filterDiaFluxes : `pandas.DataFrame`
131  DataFrame representing diaSources associated with this
132  diaObject that are observed in the band pass ``filterName``.
133  filterName : `str`
134  Simple name of the filter for the flux being calculated.
135  **kwargs
136  Any additional keyword arguments that may be passed to the plugin.
137  """
138  raise NotImplementedError()
139 

◆ calculate() [3/3]

def lsst.meas.base.diaCalculationPlugins.HTMIndexDiaPosition.calculate (   self,
  diaObjects,
  diaObjectId,
**  kwargs 
)
Compute the mean position of a DiaObject given a set of DiaSources

Parameters
----------
diaObjects : `pandas.dataFrame`
    Summary objects to store values in and read ra/decl from.
diaObjectId : `int`
    Id of the diaObject to update.
**kwargs
    Any additional keyword arguments that may be passed to the plugin.

Definition at line 167 of file diaCalculationPlugins.py.

167  def calculate(self, diaObjects, diaObjectId, **kwargs):
168  """Compute the mean position of a DiaObject given a set of DiaSources
169 
170  Parameters
171  ----------
172  diaObjects : `pandas.dataFrame`
173  Summary objects to store values in and read ra/decl from.
174  diaObjectId : `int`
175  Id of the diaObject to update.
176  **kwargs
177  Any additional keyword arguments that may be passed to the plugin.
178  """
179  sphPoint = geom.SpherePoint(
180  diaObjects.at[diaObjectId, "ra"] * geom.degrees,
181  diaObjects.at[diaObjectId, "decl"] * geom.degrees)
182  diaObjects.at[diaObjectId, "pixelId"] = self.pixelator.index(
183  sphPoint.getVector())
184 
185 
Point in an unspecified spherical coordinate system.
Definition: SpherePoint.h:57

◆ fail() [1/2]

def lsst.meas.base.diaCalculation.DiaObjectCalculationPlugin.fail (   self,
  diaObject,
  columns,
  error = None 
)
inherited
Set diaObject position values to nan.

Parameters
----------
diaObject : `dict`
    Summary object to store values in.
columns : `list` of `str`
    List of string names of columns to write a the failed value.
error : `BaseException` or `None`
    Error to pass. Kept for consistency with CatologCalculationPlugin.
    Unused.

Definition at line 140 of file diaCalculation.py.

140  def fail(self, diaObject, columns, error=None):
141  """Set diaObject position values to nan.
142 
143  Parameters
144  ----------
145  diaObject : `dict`
146  Summary object to store values in.
147  columns : `list` of `str`
148  List of string names of columns to write a the failed value.
149  error : `BaseException` or `None`
150  Error to pass. Kept for consistency with CatologCalculationPlugin.
151  Unused.
152  """
153  for colName in columns:
154  diaObject[colName] = np.nan
155 
156 

◆ fail() [2/2]

def lsst.meas.base.pluginsBase.BasePlugin.fail (   self,
  measRecord,
  error = None 
)
inherited
Record a failure of the `measure` or `measureN` method.

Parameters
----------
measRecord : `lsst.afw.table.SourceRecord`
    Table record describing the source being measured.
error : `MeasurementError`, optional
    Only provided if the measurement failed due to a
    `MeasurementError` being raised; otherwise, will be `None`.

Notes
-----
When the plugin raises an exception, framework will call
`BasePlugin.fail` to allow the plugin to set its failure flag
field(s).  When `BasePlugin.measureN` raises an exception,
`BasePlugin.fail` will be called repeatedly with all the records that
were being measured.

If the exception is an `MeasurementError`, it will be passed as the
error argument; in all other cases the error argument will be `None`,
and the failure will be logged by the measurement framework as a
warning.

Reimplemented in lsst.meas.modelfit.psf.psfContinued.GeneralShapeletPsfApproxForcedPlugin, lsst.meas.modelfit.psf.psfContinued.GeneralShapeletPsfApproxSingleFramePlugin, lsst.meas.modelfit.cmodel.cmodelContinued.CModelForcedPlugin, lsst.meas.modelfit.cmodel.cmodelContinued.CModelSingleFramePlugin, lsst.meas.extensions.trailedSources.VeresPlugin.SingleFrameVeresTrailPlugin, lsst.meas.extensions.trailedSources.NaivePlugin.SingleFrameNaiveTrailPlugin, lsst.meas.base.wrappers.GenericPlugin, lsst.meas.base.wrappers.WrappedForcedPlugin, lsst.meas.base.wrappers.WrappedSingleFramePlugin, lsst.meas.base.plugins.SingleFrameSkyCoordPlugin, lsst.meas.base.plugins.SingleFramePeakCentroidPlugin, lsst.meas.base.plugins.InputCountPlugin, lsst.meas.base.plugins.VariancePlugin, lsst.meas.base.plugins.SingleFrameJacobianPlugin, lsst.meas.base.plugins.SingleFrameFPPositionPlugin, lsst.meas.base.footprintArea.CatalogCalculationFootprintAreaPlugin, lsst.meas.base.classification.CatalogCalculationClassificationPlugin, and lsst.ip.diffim.dipoleMeasurement.ClassificationDipolePlugin.

Definition at line 137 of file pluginsBase.py.

137  def fail(self, measRecord, error=None):
138  """Record a failure of the `measure` or `measureN` method.
139 
140  Parameters
141  ----------
142  measRecord : `lsst.afw.table.SourceRecord`
143  Table record describing the source being measured.
144  error : `MeasurementError`, optional
145  Only provided if the measurement failed due to a
146  `MeasurementError` being raised; otherwise, will be `None`.
147 
148  Notes
149  -----
150  When the plugin raises an exception, framework will call
151  `BasePlugin.fail` to allow the plugin to set its failure flag
152  field(s). When `BasePlugin.measureN` raises an exception,
153  `BasePlugin.fail` will be called repeatedly with all the records that
154  were being measured.
155 
156  If the exception is an `MeasurementError`, it will be passed as the
157  error argument; in all other cases the error argument will be `None`,
158  and the failure will be logged by the measurement framework as a
159  warning.
160 
161  """
162  traceback.print_exc()
163  message = ("The algorithm '%s' thinks it cannot fail, but it did; "
164  "please report this as a bug (the full traceback is above)."
165  % (self.__class__.__name__,))
166  raise NotImplementedError(message)
167 

◆ getExecutionOrder()

def lsst.meas.base.diaCalculationPlugins.HTMIndexDiaPosition.getExecutionOrder (   cls)
Used to set the relative order of plugin execution.

The values returned by `getExecutionOrder` are compared across all
plugins, and smaller numbers run first.

Notes
-----
`CatalogCalculationPlugin`\s must run with
`BasePlugin.DEFAULT_CATALOGCALCULATION` or higher.

All plugins must implement this method with an appropriate run level

Reimplemented from lsst.meas.base.catalogCalculation.CatalogCalculationPlugin.

Definition at line 164 of file diaCalculationPlugins.py.

164  def getExecutionOrder(cls):
165  return cls.FLUX_MOMENTS_CALCULATED
166 

◆ getLogName()

def lsst.meas.base.pluginsBase.BasePlugin.getLogName (   self)
inherited

Definition at line 134 of file pluginsBase.py.

134  def getLogName(self):
135  return self.logName
136 

◆ getTransformClass()

def lsst.meas.base.pluginsBase.BasePlugin.getTransformClass ( )
staticinherited
Get the measurement transformation appropriate to this plugin.

This returns a subclass of `transforms.MeasurementTransform`, which
may be instantiated with details of the algorithm configuration and
then called with information about calibration and WCS to convert from
raw measurement quantities to calibrated units. Calibrated data is
then provided in a separate output table.

Notes
-----
By default, we copy everything from the input to the output without
transformation.

Reimplemented in lsst.meas.base.plugins.ForcedPeakCentroidPlugin, and lsst.meas.base.plugins.SingleFramePeakCentroidPlugin.

Definition at line 169 of file pluginsBase.py.

169  def getTransformClass():
170  """Get the measurement transformation appropriate to this plugin.
171 
172  This returns a subclass of `transforms.MeasurementTransform`, which
173  may be instantiated with details of the algorithm configuration and
174  then called with information about calibration and WCS to convert from
175  raw measurement quantities to calibrated units. Calibrated data is
176  then provided in a separate output table.
177 
178  Notes
179  -----
180  By default, we copy everything from the input to the output without
181  transformation.
182  """
183  return PassThroughTransform

Member Data Documentation

◆ APCORR_ORDER

float lsst.meas.base.pluginsBase.BasePlugin.APCORR_ORDER = 3.0
staticinherited

Definition at line 98 of file pluginsBase.py.

◆ CENTROID_ORDER

float lsst.meas.base.pluginsBase.BasePlugin.CENTROID_ORDER = 0.0
staticinherited

Definition at line 72 of file pluginsBase.py.

◆ config

lsst.meas.base.pluginsBase.BasePlugin.config
inherited

Definition at line 130 of file pluginsBase.py.

◆ ConfigClass

lsst.meas.base.diaCalculationPlugins.HTMIndexDiaPosition.ConfigClass = HTMIndexDiaPositionConfig
static

Definition at line 151 of file diaCalculationPlugins.py.

◆ DEFAULT_CATALOGCALCULATION

float lsst.meas.base.pluginsBase.BasePlugin.DEFAULT_CATALOGCALCULATION = 4.0
staticinherited

Definition at line 108 of file pluginsBase.py.

◆ FLUX_MOMENTS_CALCULATED

float lsst.meas.base.diaCalculation.DiaObjectCalculationPlugin.FLUX_MOMENTS_CALCULATED = 5.0
staticinherited

Definition at line 69 of file diaCalculation.py.

◆ FLUX_ORDER

float lsst.meas.base.pluginsBase.BasePlugin.FLUX_ORDER = 2.0
staticinherited

Definition at line 89 of file pluginsBase.py.

◆ inputCols

list lsst.meas.base.diaCalculationPlugins.HTMIndexDiaPosition.inputCols = ["ra", "decl"]
static

Definition at line 155 of file diaCalculationPlugins.py.

◆ logName

lsst.meas.base.pluginsBase.BasePlugin.logName
inherited

Definition at line 132 of file pluginsBase.py.

◆ name

lsst.meas.base.pluginsBase.BasePlugin.name
inherited

Definition at line 131 of file pluginsBase.py.

◆ needsFilter

bool lsst.meas.base.diaCalculationPlugins.HTMIndexDiaPosition.needsFilter = False
static

Definition at line 157 of file diaCalculationPlugins.py.

◆ outputCols

list lsst.meas.base.diaCalculationPlugins.HTMIndexDiaPosition.outputCols = ["pixelId"]
static

Definition at line 156 of file diaCalculationPlugins.py.

◆ pixelator

lsst.meas.base.diaCalculationPlugins.HTMIndexDiaPosition.pixelator

Definition at line 161 of file diaCalculationPlugins.py.

◆ plugType

string lsst.meas.base.diaCalculationPlugins.HTMIndexDiaPosition.plugType = 'single'
static

Definition at line 153 of file diaCalculationPlugins.py.

◆ registry

lsst.meas.base.diaCalculation.DiaObjectCalculationPlugin.registry = PluginRegistry(DiaObjectCalculationPluginConfig)
staticinherited

Definition at line 65 of file diaCalculation.py.

◆ SHAPE_ORDER

float lsst.meas.base.pluginsBase.BasePlugin.SHAPE_ORDER = 1.0
staticinherited

Definition at line 80 of file pluginsBase.py.


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