LSST Applications g0fba68d861+849f694866,g1fd858c14a+7a7b9dd5ed,g2c84ff76c0+5cb23283cf,g30358e5240+f0e04ebe90,g35bb328faa+fcb1d3bbc8,g436fd98eb5+bdc6fcdd04,g4af146b050+742274f7cd,g4d2262a081+9d5bd0394b,g4e0f332c67+cb09b8a5b6,g53246c7159+fcb1d3bbc8,g5a012ec0e7+477f9c599b,g60b5630c4e+bdc6fcdd04,g67b6fd64d1+2218407a0c,g78460c75b0+2f9a1b4bcd,g786e29fd12+cf7ec2a62a,g7b71ed6315+fcb1d3bbc8,g87b7deb4dc+777438113c,g8852436030+ebf28f0d95,g89139ef638+2218407a0c,g9125e01d80+fcb1d3bbc8,g989de1cb63+2218407a0c,g9f33ca652e+42fb53f4c8,g9f7030ddb1+11b9b6f027,ga2b97cdc51+bdc6fcdd04,gab72ac2889+bdc6fcdd04,gabe3b4be73+1e0a283bba,gabf8522325+3210f02652,gb1101e3267+9c79701da9,gb58c049af0+f03b321e39,gb89ab40317+2218407a0c,gcf25f946ba+ebf28f0d95,gd6cbbdb0b4+e8f9c9c900,gd9a9a58781+fcb1d3bbc8,gde0f65d7ad+47bbabaf80,gded526ad44+8c3210761e,ge278dab8ac+3ef3db156b,ge410e46f29+2218407a0c,gf67bdafdda+2218407a0c,v29.0.0.rc3
LSST Data Management Base Package
|
Classes | |
class | NumberDeblendedSourcesMetricConnections |
Variables | |
sources : `lsst.afw.table.SourceCatalog` | |
result : `lsst.pipe.base.Struct` | |
catalog : `lsst.afw.table.SourceCatalog` | |
selection : `numpy.ndarray` [`bool`], (N,) | |
filtered : `numpy.ndarray` [`bool`], (N,) | |
lsst.pipe.tasks.metrics.catalog : `lsst.afw.table.SourceCatalog` |
# Use deblend_parentNChild rather than detect_fromBlend because the # latter need not be defined in post-deblending catalogs. if "deblend_parentNChild" not in sources.schema or "deblend_nChild" not in sources.schema: raise NoWorkFound("Nothing to do: no deblending performed.") else: try: children = ((sources["deblend_parentNChild"] > 1) # deblend child & (sources["deblend_nChild"] == 0) # not deblended ) children = _filterSkySources(sources, children) except LookupError as e: # Probably "parent"; all other columns already checked raise MetricComputationError("Invalid input catalog") from e else: nChildren = np.count_nonzero(children) return Struct(measurement=Measurement(self.config.metricName, nChildren * u.dimensionless_unscaled)) def _filterSkySources(catalog, selection):
Definition at line 203 of file metrics.py.
lsst.pipe.tasks.metrics.filtered : `numpy.ndarray` [`bool`], (N,) |
Definition at line 211 of file metrics.py.
lsst.pipe.tasks.metrics.result : `lsst.pipe.base.Struct` |
Definition at line 84 of file metrics.py.
lsst.pipe.tasks.metrics.selection : `numpy.ndarray` [`bool`], (N,) |
Definition at line 205 of file metrics.py.
lsst.pipe.tasks.metrics.sources : `lsst.afw.table.SourceCatalog` |
_DefaultName = "numDeblendedSciSources" ConfigClass = NumberDeblendedSourcesMetricConfig def run(self, sources):
if "deblend_nChild" not in sources.schema: raise NoWorkFound("Nothing to do: no deblending performed.") else: try: deblended = ((sources["parent"] == 0) # top-level source & (sources["deblend_nChild"] > 0) # deblended ) deblended = _filterSkySources(sources, deblended) except LookupError as e: # Probably "parent"; all other columns already checked raise MetricComputationError("Invalid input catalog") from e else: nDeblended = np.count_nonzero(deblended) return Struct(measurement=Measurement(self.config.metricName, nDeblended * u.dimensionless_unscaled)) class NumberDeblendChildSourcesMetricConnections( MetricConnections, defaultTemplates={"package": "pipe_tasks", "metric": "numDeblendChildSciSources"}, dimensions={"instrument", "visit", "detector"}, ): sources = connectionTypes.Input( doc="The catalog of science sources.", name="src", storageClass="SourceCatalog", dimensions={"instrument", "visit", "detector"}, ) class NumberDeblendChildSourcesMetricConfig( MetricConfig, pipelineConnections=NumberDeblendChildSourcesMetricConnections): pass class NumberDeblendChildSourcesMetricTask(MetricTask):
_DefaultName = "numDeblendChildSciSources" ConfigClass = NumberDeblendChildSourcesMetricConfig def run(self, sources):
Definition at line 79 of file metrics.py.