LSST Applications g04e9c324dd+8c5ae1fdc5,g0644efc3f0+7e72ced385,g123d84c11c+8c5ae1fdc5,g1ec0fe41b4+6ec6b74de1,g1fd858c14a+1d778e1869,g3533f9d6cb+7e72ced385,g35bb328faa+8c5ae1fdc5,g35ef7ab7cf+460d7c47aa,g53246c7159+8c5ae1fdc5,g60b5630c4e+7e72ced385,g60c8b41c57+095f713f68,g663da51e9b+6aff55297d,g6735e52a0d+29de3d959a,g67b6fd64d1+57193d00fb,g7605de067c+eb240d2b47,g78460c75b0+7e33a9eb6d,g786e29fd12+668abc6043,g844c57033c+03ddc13274,g8852436030+670976b475,g89139ef638+57193d00fb,g989de1cb63+57193d00fb,g9f33ca652e+a4f2b81461,ga1e959baac+5fbc491aed,ga2f891cd6c+7e72ced385,gabe3b4be73+8856018cbb,gabf8522325+cc757f8247,gac2eed3f23+57193d00fb,gb1101e3267+3b5d6a3d0b,gb89ab40317+57193d00fb,gcf25f946ba+670976b475,gd107969129+b3ac407438,gd6cbbdb0b4+8e46defd2a,gde0f65d7ad+eb00ebb37f,ge278dab8ac+2322f1d6ea,ge410e46f29+57193d00fb,gf30d85a44d+9b77053554,gf5e32f922b+8c5ae1fdc5,gff02db199a+bb6b2c7d57,w.2025.28
LSST Data Management Base Package
Loading...
Searching...
No Matches
lsst.pipe.tasks.functors.LocalPhotometry Class Reference
Inheritance diagram for lsst.pipe.tasks.functors.LocalPhotometry:
lsst.pipe.tasks.functors.Functor lsst.pipe.tasks.functors.LocalDipoleMeanFlux lsst.pipe.tasks.functors.LocalNanojansky lsst.pipe.tasks.functors.LocalNanojanskyErr lsst.pipe.tasks.functors.LocalDipoleDiffFlux lsst.pipe.tasks.functors.LocalDipoleDiffFluxErr lsst.pipe.tasks.functors.LocalDipoleMeanFluxErr

Public Member Functions

 __init__ (self, instFluxCol, instFluxErrCol, photoCalibCol, photoCalibErrCol=None, **kwargs)
 
 instFluxToNanojansky (self, instFlux, localCalib)
 
 instFluxErrToNanojanskyErr (self, instFlux, instFluxErr, localCalib, localCalibErr=None)
 
 instFluxToMagnitude (self, instFlux, localCalib)
 
 instFluxErrToMagnitudeErr (self, instFlux, instFluxErr, localCalib, localCalibErr=None)
 
 name (self)
 
 noDup (self)
 
 columns (self)
 
 multilevelColumns (self, data, columnIndex=None, returnTuple=False)
 
 __call__ (self, data, dropna=False)
 
 difference (self, data1, data2, **kwargs)
 
 fail (self, df)
 
 shortname (self)
 

Public Attributes

 instFluxCol = instFluxCol
 
 instFluxErrCol = instFluxErrCol
 
 photoCalibCol = photoCalibCol
 
 filt = filt
 
str dataset = dataset if dataset is not None else self._defaultDataset
 
 log = logging.getLogger(type(self).__name__)
 
 name
 

Static Public Attributes

tuple logNJanskyToAB = (1 * u.nJy).to_value(u.ABmag)
 

Protected Member Functions

 _get_data_columnLevels (self, data, columnIndex=None)
 
 _get_data_columnLevelNames (self, data, columnIndex=None)
 
 _colsFromDict (self, colDict, columnIndex=None)
 
 _func (self, df, dropna=True)
 
 _get_columnIndex (self, data)
 
 _get_data (self, data)
 
 _setLevels (self, df)
 
 _dropna (self, vals)
 

Protected Attributes

 _noDup = noDup
 

Static Protected Attributes

str _defaultDataset = 'ref'
 
tuple _dfLevels = ('column',)
 
bool _defaultNoDup = False
 

Detailed Description

Base class for calibrating the specified instrument flux column using
the local photometric calibration.

Parameters
----------
instFluxCol : `str`
    Name of the instrument flux column.
instFluxErrCol : `str`
    Name of the assocated error columns for ``instFluxCol``.
photoCalibCol : `str`
    Name of local calibration column.
photoCalibErrCol : `str`, optional
    Error associated with ``photoCalibCol``.  Ignored and deprecated; will
    be removed after v29.

See Also
--------
LocalNanojansky
LocalNanojanskyErr

Definition at line 1670 of file functors.py.

Constructor & Destructor Documentation

◆ __init__()

lsst.pipe.tasks.functors.LocalPhotometry.__init__ ( self,
instFluxCol,
instFluxErrCol,
photoCalibCol,
photoCalibErrCol = None,
** kwargs )

Definition at line 1693 of file functors.py.

1698 **kwargs):
1699 self.instFluxCol = instFluxCol
1700 self.instFluxErrCol = instFluxErrCol
1701 self.photoCalibCol = photoCalibCol
1702 # TODO[DM-49400]: remove this check and the argument it corresponds to.
1703 if photoCalibErrCol is not None:
1704 warnings.warn("The photoCalibErrCol argument is deprecated and will be removed after v29.",
1705 category=FutureWarning)
1706 super().__init__(**kwargs)
1707

Member Function Documentation

◆ __call__()

lsst.pipe.tasks.functors.Functor.__call__ ( self,
data,
dropna = False )
inherited

Definition at line 348 of file functors.py.

348 def __call__(self, data, dropna=False):
349 df = self._get_data(data)
350 try:
351 vals = self._func(df)
352 except Exception as e:
353 self.log.error("Exception in %s call: %s: %s", self.name, type(e).__name__, e)
354 vals = self.fail(df)
355 if dropna:
356 vals = self._dropna(vals)
357
358 return vals
359

◆ _colsFromDict()

lsst.pipe.tasks.functors.Functor._colsFromDict ( self,
colDict,
columnIndex = None )
protectedinherited
Converts dictionary column specficiation to a list of columns.

Definition at line 218 of file functors.py.

218 def _colsFromDict(self, colDict, columnIndex=None):
219 """Converts dictionary column specficiation to a list of columns."""
220 new_colDict = {}
221 columnLevels = self._get_data_columnLevels(None, columnIndex=columnIndex)
222
223 for i, lev in enumerate(columnLevels):
224 if lev in colDict:
225 if isinstance(colDict[lev], str):
226 new_colDict[lev] = [colDict[lev]]
227 else:
228 new_colDict[lev] = colDict[lev]
229 else:
230 new_colDict[lev] = columnIndex.levels[i]
231
232 levelCols = [new_colDict[lev] for lev in columnLevels]
233 cols = list(product(*levelCols))
234 colsAvailable = [col for col in cols if col in columnIndex]
235 return colsAvailable
236

◆ _dropna()

lsst.pipe.tasks.functors.Functor._dropna ( self,
vals )
protectedinherited

Definition at line 345 of file functors.py.

345 def _dropna(self, vals):
346 return vals.dropna()
347

◆ _func()

lsst.pipe.tasks.functors.Functor._func ( self,
df,
dropna = True )
protectedinherited

Reimplemented in lsst.pipe.tasks.functors.Color, lsst.pipe.tasks.functors.Column, lsst.pipe.tasks.functors.ComputePixelScale, lsst.pipe.tasks.functors.ConvertDetectorAngleToPositionAngle, lsst.pipe.tasks.functors.ConvertPixelSqToArcsecondsSq, lsst.pipe.tasks.functors.ConvertPixelToArcseconds, lsst.pipe.tasks.functors.CoordColumn, lsst.pipe.tasks.functors.CustomFunctor, lsst.pipe.tasks.functors.DeconvolvedMoments, lsst.pipe.tasks.functors.E1, lsst.pipe.tasks.functors.E2, lsst.pipe.tasks.functors.Ebv, lsst.pipe.tasks.functors.HsmFwhm, lsst.pipe.tasks.functors.HsmTraceSize, lsst.pipe.tasks.functors.HtmIndex20, lsst.pipe.tasks.functors.Index, lsst.pipe.tasks.functors.LocalDipoleDiffFlux, lsst.pipe.tasks.functors.LocalDipoleDiffFluxErr, lsst.pipe.tasks.functors.LocalDipoleMeanFlux, lsst.pipe.tasks.functors.LocalDipoleMeanFluxErr, lsst.pipe.tasks.functors.LocalNanojansky, lsst.pipe.tasks.functors.LocalNanojanskyErr, lsst.pipe.tasks.functors.Mag, lsst.pipe.tasks.functors.MagDiff, lsst.pipe.tasks.functors.MagErr, lsst.pipe.tasks.functors.MomentsIuuSky, lsst.pipe.tasks.functors.MomentsIuvSky, lsst.pipe.tasks.functors.MomentsIvvSky, lsst.pipe.tasks.functors.MultibandSinglePrecisionFloatColumn, lsst.pipe.tasks.functors.NanoJansky, lsst.pipe.tasks.functors.NanoJanskyErr, lsst.pipe.tasks.functors.PositionAngleFromMoments, lsst.pipe.tasks.functors.PsfHsmTraceSizeDiff, lsst.pipe.tasks.functors.PsfSdssTraceSizeDiff, lsst.pipe.tasks.functors.RADecCovColumn, lsst.pipe.tasks.functors.RadiusFromQuadrupole, lsst.pipe.tasks.functors.ReferenceBand, lsst.pipe.tasks.functors.SdssTraceSize, lsst.pipe.tasks.functors.SemimajorAxisFromMoments, lsst.pipe.tasks.functors.SemiminorAxisFromMoments, and lsst.pipe.tasks.functors.SinglePrecisionFloatColumn.

Definition at line 291 of file functors.py.

291 def _func(self, df, dropna=True):
292 raise NotImplementedError('Must define calculation on DataFrame')
293

◆ _get_columnIndex()

lsst.pipe.tasks.functors.Functor._get_columnIndex ( self,
data )
protectedinherited
Return columnIndex.

Definition at line 294 of file functors.py.

294 def _get_columnIndex(self, data):
295 """Return columnIndex."""
296
297 if isinstance(data, (DeferredDatasetHandle, InMemoryDatasetHandle)):
298 return data.get(component="columns")
299 else:
300 return None
301

◆ _get_data()

lsst.pipe.tasks.functors.Functor._get_data ( self,
data )
protectedinherited
Retrieve DataFrame necessary for calculation.

The data argument can be a `~pandas.DataFrame`, a
`~lsst.daf.butler.DeferredDatasetHandle`, or
an `~lsst.pipe.base.InMemoryDatasetHandle`.

Returns a DataFrame upon which `self._func` can act.

Definition at line 302 of file functors.py.

302 def _get_data(self, data):
303 """Retrieve DataFrame necessary for calculation.
304
305 The data argument can be a `~pandas.DataFrame`, a
306 `~lsst.daf.butler.DeferredDatasetHandle`, or
307 an `~lsst.pipe.base.InMemoryDatasetHandle`.
308
309 Returns a DataFrame upon which `self._func` can act.
310 """
311 # We wrap a DataFrame in a handle here to take advantage of the
312 # DataFrame delegate DataFrame column wrangling abilities.
313 if isinstance(data, pd.DataFrame):
314 _data = InMemoryDatasetHandle(data, storageClass="DataFrame")
315 elif isinstance(data, (DeferredDatasetHandle, InMemoryDatasetHandle)):
316 _data = data
317 else:
318 raise RuntimeError(f"Unexpected type provided for data. Got {get_full_type_name(data)}.")
319
320 # First thing to do: check to see if the data source has a multilevel
321 # column index or not.
322 columnIndex = self._get_columnIndex(_data)
323 is_multiLevel = isinstance(columnIndex, pd.MultiIndex)
324
325 # Get proper columns specification for this functor.
326 if is_multiLevel:
327 columns = self.multilevelColumns(_data, columnIndex=columnIndex)
328 else:
329 columns = self.columns
330
331 # Load in-memory DataFrame with appropriate columns the gen3 way.
332 df = _data.get(parameters={"columns": columns})
333
334 # Drop unnecessary column levels.
335 if is_multiLevel:
336 df = self._setLevels(df)
337
338 return df
339

◆ _get_data_columnLevelNames()

lsst.pipe.tasks.functors.Functor._get_data_columnLevelNames ( self,
data,
columnIndex = None )
protectedinherited
Gets the content of each of the column levels for a multilevel
table.

Definition at line 204 of file functors.py.

204 def _get_data_columnLevelNames(self, data, columnIndex=None):
205 """Gets the content of each of the column levels for a multilevel
206 table.
207 """
208 if columnIndex is None:
209 columnIndex = data.get(component="columns")
210
211 columnLevels = columnIndex.names
212 columnLevelNames = {
213 level: list(np.unique(np.array([c for c in columnIndex])[:, i]))
214 for i, level in enumerate(columnLevels)
215 }
216 return columnLevelNames
217

◆ _get_data_columnLevels()

lsst.pipe.tasks.functors.Functor._get_data_columnLevels ( self,
data,
columnIndex = None )
protectedinherited
Gets the names of the column index levels.

This should only be called in the context of a multilevel table.

Parameters
----------
data : various
    The data to be read, can be a
    `~lsst.daf.butler.DeferredDatasetHandle` or
    `~lsst.pipe.base.InMemoryDatasetHandle`.
columnIndex (optional): pandas `~pandas.Index` object
    If not passed, then it is read from the
    `~lsst.daf.butler.DeferredDatasetHandle`
    for `~lsst.pipe.base.InMemoryDatasetHandle`.

Definition at line 184 of file functors.py.

184 def _get_data_columnLevels(self, data, columnIndex=None):
185 """Gets the names of the column index levels.
186
187 This should only be called in the context of a multilevel table.
188
189 Parameters
190 ----------
191 data : various
192 The data to be read, can be a
193 `~lsst.daf.butler.DeferredDatasetHandle` or
194 `~lsst.pipe.base.InMemoryDatasetHandle`.
195 columnIndex (optional): pandas `~pandas.Index` object
196 If not passed, then it is read from the
197 `~lsst.daf.butler.DeferredDatasetHandle`
198 for `~lsst.pipe.base.InMemoryDatasetHandle`.
199 """
200 if columnIndex is None:
201 columnIndex = data.get(component="columns")
202 return columnIndex.names
203

◆ _setLevels()

lsst.pipe.tasks.functors.Functor._setLevels ( self,
df )
protectedinherited

Definition at line 340 of file functors.py.

340 def _setLevels(self, df):
341 levelsToDrop = [n for n in df.columns.names if n not in self._dfLevels]
342 df.columns = df.columns.droplevel(levelsToDrop)
343 return df
344

◆ columns()

◆ difference()

lsst.pipe.tasks.functors.Functor.difference ( self,
data1,
data2,
** kwargs )
inherited
Computes difference between functor called on two different
DataFrame/Handle objects.

Definition at line 360 of file functors.py.

360 def difference(self, data1, data2, **kwargs):
361 """Computes difference between functor called on two different
362 DataFrame/Handle objects.
363 """
364 return self(data1, **kwargs) - self(data2, **kwargs)
365

◆ fail()

lsst.pipe.tasks.functors.Functor.fail ( self,
df )
inherited

Definition at line 366 of file functors.py.

366 def fail(self, df):
367 return pd.Series(np.full(len(df), np.nan), index=df.index)
368

◆ instFluxErrToMagnitudeErr()

lsst.pipe.tasks.functors.LocalPhotometry.instFluxErrToMagnitudeErr ( self,
instFlux,
instFluxErr,
localCalib,
localCalibErr = None )
Convert instrument flux err to nanojanskys.

Parameters
----------
instFlux : `~numpy.ndarray` or `~pandas.Series`
    Array of instrument flux measurements.
instFluxErr : `~numpy.ndarray` or `~pandas.Series`
    Errors on associated ``instFlux`` values.
localCalib : `~numpy.ndarray` or `~pandas.Series`
    Array of local photometric calibration estimates.
localCalibErr : `~numpy.ndarray` or `~pandas.Series`, optional
    Errors on associated ``localCalib`` values.  Ignored and deprecated;
    will be removed after v29.

Returns
-------
calibMagErr: `~numpy.ndarray` or `~pandas.Series`
    Error on calibrated AB magnitudes.

Definition at line 1770 of file functors.py.

1770 def instFluxErrToMagnitudeErr(self, instFlux, instFluxErr, localCalib, localCalibErr=None):
1771 """Convert instrument flux err to nanojanskys.
1772
1773 Parameters
1774 ----------
1775 instFlux : `~numpy.ndarray` or `~pandas.Series`
1776 Array of instrument flux measurements.
1777 instFluxErr : `~numpy.ndarray` or `~pandas.Series`
1778 Errors on associated ``instFlux`` values.
1779 localCalib : `~numpy.ndarray` or `~pandas.Series`
1780 Array of local photometric calibration estimates.
1781 localCalibErr : `~numpy.ndarray` or `~pandas.Series`, optional
1782 Errors on associated ``localCalib`` values. Ignored and deprecated;
1783 will be removed after v29.
1784
1785 Returns
1786 -------
1787 calibMagErr: `~numpy.ndarray` or `~pandas.Series`
1788 Error on calibrated AB magnitudes.
1789 """
1790 # TODO[DM-49400]: remove this check and the argument it corresponds to.
1791 if localCalibErr is not None:
1792 warnings.warn("The localCalibErr argument is deprecated and will be removed after v29.",
1793 category=FutureWarning)
1794 err = self.instFluxErrToNanojanskyErr(instFlux, instFluxErr, localCalib)
1795 return 2.5 / np.log(10) * err / self.instFluxToNanojansky(instFlux, instFluxErr)
1796
1797

◆ instFluxErrToNanojanskyErr()

lsst.pipe.tasks.functors.LocalPhotometry.instFluxErrToNanojanskyErr ( self,
instFlux,
instFluxErr,
localCalib,
localCalibErr = None )
Convert instrument flux to nanojanskys.

Parameters
----------
instFlux : `~numpy.ndarray` or `~pandas.Series`
    Array of instrument flux measurements.  Ignored (accepted for
    backwards compatibility and consistency with magnitude-error
    calculation methods).
instFluxErr : `~numpy.ndarray` or `~pandas.Series`
    Errors on associated ``instFlux`` values.
localCalib : `~numpy.ndarray` or `~pandas.Series`
    Array of local photometric calibration estimates.
localCalibErr : `~numpy.ndarray` or `~pandas.Series`, optional
    Errors on associated ``localCalib`` values.  Ignored and deprecated;
    will be removed after v29.

Returns
-------
calibFluxErr : `~numpy.ndarray` or `~pandas.Series`
    Errors on calibrated flux measurements.

Definition at line 1725 of file functors.py.

1725 def instFluxErrToNanojanskyErr(self, instFlux, instFluxErr, localCalib, localCalibErr=None):
1726 """Convert instrument flux to nanojanskys.
1727
1728 Parameters
1729 ----------
1730 instFlux : `~numpy.ndarray` or `~pandas.Series`
1731 Array of instrument flux measurements. Ignored (accepted for
1732 backwards compatibility and consistency with magnitude-error
1733 calculation methods).
1734 instFluxErr : `~numpy.ndarray` or `~pandas.Series`
1735 Errors on associated ``instFlux`` values.
1736 localCalib : `~numpy.ndarray` or `~pandas.Series`
1737 Array of local photometric calibration estimates.
1738 localCalibErr : `~numpy.ndarray` or `~pandas.Series`, optional
1739 Errors on associated ``localCalib`` values. Ignored and deprecated;
1740 will be removed after v29.
1741
1742 Returns
1743 -------
1744 calibFluxErr : `~numpy.ndarray` or `~pandas.Series`
1745 Errors on calibrated flux measurements.
1746 """
1747 # TODO[DM-49400]: remove this check and the argument it corresponds to.
1748 if localCalibErr is not None:
1749 warnings.warn("The localCalibErr argument is deprecated and will be removed after v29.",
1750 category=FutureWarning)
1751 return instFluxErr * localCalib
1752

◆ instFluxToMagnitude()

lsst.pipe.tasks.functors.LocalPhotometry.instFluxToMagnitude ( self,
instFlux,
localCalib )
Convert instrument flux to nanojanskys.

Parameters
----------
instFlux : `~numpy.ndarray` or `~pandas.Series`
    Array of instrument flux measurements.
localCalib : `~numpy.ndarray` or `~pandas.Series`
    Array of local photometric calibration estimates.

Returns
-------
calibMag : `~numpy.ndarray` or `~pandas.Series`
    Array of calibrated AB magnitudes.

Definition at line 1753 of file functors.py.

1753 def instFluxToMagnitude(self, instFlux, localCalib):
1754 """Convert instrument flux to nanojanskys.
1755
1756 Parameters
1757 ----------
1758 instFlux : `~numpy.ndarray` or `~pandas.Series`
1759 Array of instrument flux measurements.
1760 localCalib : `~numpy.ndarray` or `~pandas.Series`
1761 Array of local photometric calibration estimates.
1762
1763 Returns
1764 -------
1765 calibMag : `~numpy.ndarray` or `~pandas.Series`
1766 Array of calibrated AB magnitudes.
1767 """
1768 return -2.5 * np.log10(self.instFluxToNanojansky(instFlux, localCalib)) + self.logNJanskyToAB
1769

◆ instFluxToNanojansky()

lsst.pipe.tasks.functors.LocalPhotometry.instFluxToNanojansky ( self,
instFlux,
localCalib )
Convert instrument flux to nanojanskys.

Parameters
----------
instFlux : `~numpy.ndarray` or `~pandas.Series`
    Array of instrument flux measurements.
localCalib : `~numpy.ndarray` or `~pandas.Series`
    Array of local photometric calibration estimates.

Returns
-------
calibFlux : `~numpy.ndarray` or `~pandas.Series`
    Array of calibrated flux measurements.

Definition at line 1708 of file functors.py.

1708 def instFluxToNanojansky(self, instFlux, localCalib):
1709 """Convert instrument flux to nanojanskys.
1710
1711 Parameters
1712 ----------
1713 instFlux : `~numpy.ndarray` or `~pandas.Series`
1714 Array of instrument flux measurements.
1715 localCalib : `~numpy.ndarray` or `~pandas.Series`
1716 Array of local photometric calibration estimates.
1717
1718 Returns
1719 -------
1720 calibFlux : `~numpy.ndarray` or `~pandas.Series`
1721 Array of calibrated flux measurements.
1722 """
1723 return instFlux * localCalib
1724

◆ multilevelColumns()

lsst.pipe.tasks.functors.Functor.multilevelColumns ( self,
data,
columnIndex = None,
returnTuple = False )
inherited
Returns columns needed by functor from multilevel dataset.

To access tables with multilevel column structure, the
`~lsst.daf.butler.DeferredDatasetHandle` or
`~lsst.pipe.base.InMemoryDatasetHandle` needs to be passed
either a list of tuples or a dictionary.

Parameters
----------
data : various
    The data as either `~lsst.daf.butler.DeferredDatasetHandle`, or
    `~lsst.pipe.base.InMemoryDatasetHandle`.
columnIndex (optional): pandas `~pandas.Index` object
    Either passed or read in from
    `~lsst.daf.butler.DeferredDatasetHandle`.
`returnTuple` : `bool`
    If true, then return a list of tuples rather than the column
    dictionary specification.
    This is set to `True` by `CompositeFunctor` in order to be able to
    combine columns from the various component functors.

Reimplemented in lsst.pipe.tasks.functors.Color, and lsst.pipe.tasks.functors.CompositeFunctor.

Definition at line 237 of file functors.py.

237 def multilevelColumns(self, data, columnIndex=None, returnTuple=False):
238 """Returns columns needed by functor from multilevel dataset.
239
240 To access tables with multilevel column structure, the
241 `~lsst.daf.butler.DeferredDatasetHandle` or
242 `~lsst.pipe.base.InMemoryDatasetHandle` needs to be passed
243 either a list of tuples or a dictionary.
244
245 Parameters
246 ----------
247 data : various
248 The data as either `~lsst.daf.butler.DeferredDatasetHandle`, or
249 `~lsst.pipe.base.InMemoryDatasetHandle`.
250 columnIndex (optional): pandas `~pandas.Index` object
251 Either passed or read in from
252 `~lsst.daf.butler.DeferredDatasetHandle`.
253 `returnTuple` : `bool`
254 If true, then return a list of tuples rather than the column
255 dictionary specification.
256 This is set to `True` by `CompositeFunctor` in order to be able to
257 combine columns from the various component functors.
258
259 """
260 if not isinstance(data, (DeferredDatasetHandle, InMemoryDatasetHandle)):
261 raise RuntimeError(f"Unexpected data type. Got {get_full_type_name(data)}.")
262
263 if columnIndex is None:
264 columnIndex = data.get(component="columns")
265
266 # Confirm that the dataset has the column levels the functor is
267 # expecting it to have.
268 columnLevels = self._get_data_columnLevels(data, columnIndex)
269
270 columnDict = {'column': self.columns,
271 'dataset': self.dataset}
272 if self.filt is None:
273 columnLevelNames = self._get_data_columnLevelNames(data, columnIndex)
274 if "band" in columnLevels:
275 if self.dataset == "ref":
276 columnDict["band"] = columnLevelNames["band"][0]
277 else:
278 raise ValueError(f"'filt' not set for functor {self.name}"
279 f"(dataset {self.dataset}) "
280 "and DataFrame "
281 "contains multiple filters in column index. "
282 "Set 'filt' or set 'dataset' to 'ref'.")
283 else:
284 columnDict['band'] = self.filt
285
286 if returnTuple:
287 return self._colsFromDict(columnDict, columnIndex=columnIndex)
288 else:
289 return columnDict
290

◆ name()

◆ noDup()

lsst.pipe.tasks.functors.Functor.noDup ( self)
inherited
Do not explode by band if used on object table.

Definition at line 170 of file functors.py.

170 def noDup(self):
171 """Do not explode by band if used on object table."""
172 if self._noDup is not None:
173 return self._noDup
174 else:
175 return self._defaultNoDup
176

◆ shortname()

lsst.pipe.tasks.functors.Functor.shortname ( self)
inherited
Short name of functor (suitable for column name/dict key).

Reimplemented in lsst.pipe.tasks.functors.Color, and lsst.pipe.tasks.functors.MagDiff.

Definition at line 375 of file functors.py.

375 def shortname(self):
376 """Short name of functor (suitable for column name/dict key)."""
377 return self.name
378
379

Member Data Documentation

◆ _defaultDataset

str lsst.pipe.tasks.functors.Functor._defaultDataset = 'ref'
staticprotectedinherited

Definition at line 159 of file functors.py.

◆ _defaultNoDup

bool lsst.pipe.tasks.functors.Functor._defaultNoDup = False
staticprotectedinherited

Definition at line 161 of file functors.py.

◆ _dfLevels

tuple lsst.pipe.tasks.functors.Functor._dfLevels = ('column',)
staticprotectedinherited

Definition at line 160 of file functors.py.

◆ _noDup

lsst.pipe.tasks.functors.Functor._noDup = noDup
protectedinherited

Definition at line 166 of file functors.py.

◆ dataset

str lsst.pipe.tasks.functors.Functor.dataset = dataset if dataset is not None else self._defaultDataset
inherited

Definition at line 165 of file functors.py.

◆ filt

lsst.pipe.tasks.functors.Functor.filt = filt
inherited

◆ instFluxCol

lsst.pipe.tasks.functors.LocalPhotometry.instFluxCol = instFluxCol

Definition at line 1699 of file functors.py.

◆ instFluxErrCol

lsst.pipe.tasks.functors.LocalPhotometry.instFluxErrCol = instFluxErrCol

Definition at line 1700 of file functors.py.

◆ log

lsst.pipe.tasks.functors.Functor.log = logging.getLogger(type(self).__name__)
inherited

Definition at line 167 of file functors.py.

◆ logNJanskyToAB

tuple lsst.pipe.tasks.functors.LocalPhotometry.logNJanskyToAB = (1 * u.nJy).to_value(u.ABmag)
static

Definition at line 1691 of file functors.py.

◆ name

◆ photoCalibCol

lsst.pipe.tasks.functors.LocalPhotometry.photoCalibCol = photoCalibCol

Definition at line 1701 of file functors.py.


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