LSST Applications 28.0.0,g04a91732dc+39818242a5,g07dc498a13+fb7087bc2f,g1409bbee79+fb7087bc2f,g1a7e361dbc+fb7087bc2f,g1fd858c14a+9df69a7481,g2f761dc78e+ee57be4232,g33399d78f5+cf93122263,g35bb328faa+e55fef2c71,g3bd4b5ce2c+ef8ce2d39b,g3dabb73f91+b2cce74dd5,g53246c7159+e55fef2c71,g60b5630c4e+ee57be4232,g78460c75b0+8427c4cc8f,g786e29fd12+307f82e6af,g8534526c7b+8e1c6b434f,g89139ef638+fb7087bc2f,g8b49a6ea8e+ee57be4232,g9125e01d80+e55fef2c71,g989de1cb63+fb7087bc2f,g9f33ca652e+f0b312e6e5,gaaedd4e678+fb7087bc2f,gabe3b4be73+9c0c3c7524,gb1101e3267+d435cc4fc1,gb58c049af0+28045f66fd,gca43fec769+e55fef2c71,gcb3d4e2347+ddf8d02623,gce7788e931+df5c03e1ec,gcf25f946ba+cf93122263,gd6cbbdb0b4+f6e5445f66,gdd34b64689+048800d0b1,gdd9490a0bf+839504dd15,gde0f65d7ad+4bc93f0fff,ge278dab8ac+b4c2c8faf7,geab183fbe5+ee57be4232,gec3dcf77f0+e7bc33f3ea,gecb8035dfe+1f480bec5e,gf58bf46354+e55fef2c71,gfe7187db8c+5ba3c588d8
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.