LSST Applications 27.0.0,g0265f82a02+469cd937ee,g02d81e74bb+21ad69e7e1,g1470d8bcf6+cbe83ee85a,g2079a07aa2+e67c6346a6,g212a7c68fe+04a9158687,g2305ad1205+94392ce272,g295015adf3+81dd352a9d,g2bbee38e9b+469cd937ee,g337abbeb29+469cd937ee,g3939d97d7f+72a9f7b576,g487adcacf7+71499e7cba,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+df404f777f,g5a732f18d5+be83d3ecdb,g64a986408d+21ad69e7e1,g858d7b2824+21ad69e7e1,g8a8a8dda67+a6fc98d2e7,g99cad8db69+f62e5b0af5,g9ddcbc5298+d4bad12328,ga1e77700b3+9c366c4306,ga8c6da7877+71e4819109,gb0e22166c9+25ba2f69a1,gb6a65358fc+469cd937ee,gbb8dafda3b+69d3c0e320,gc07e1c2157+a98bf949bb,gc120e1dc64+615ec43309,gc28159a63d+469cd937ee,gcf0d15dbbd+72a9f7b576,gdaeeff99f8+a38ce5ea23,ge6526c86ff+3a7c1ac5f1,ge79ae78c31+469cd937ee,gee10cc3b42+a6fc98d2e7,gf1cff7945b+21ad69e7e1,gfbcc870c63+9a11dc8c8f
LSST Data Management Base Package
|
Public Member Functions | |
__init__ (self, columnName=None, schema=None, doc=None, **kwargs) | |
run (self, sources, prior=None, expId=0) | |
select (self, numSources, expId=0) | |
applySelectionPrior (self, prior, selection) | |
markSources (self, sources, selection) | |
Public Attributes | |
columnName | |
key | |
Static Public Attributes | |
ConfigClass = ReserveSourcesConfig | |
Static Protected Attributes | |
str | _DefaultName = "reserveSources" |
Reserve sources from analysis We randomly select a fraction of sources that will be reserved from analysis. This allows evaluation of the quality of model fits using sources that were not involved in the fitting process. Parameters ---------- columnName : `str`, required Name of flag column to add; we will suffix this with "_reserved". schema : `lsst.afw.table.Schema`, required Catalog schema. doc : `str` Documentation for column to add. config : `ReserveSourcesConfig` Configuration.
Definition at line 41 of file reserveSourcesTask.py.
lsst.meas.algorithms.reserveSourcesTask.ReserveSourcesTask.__init__ | ( | self, | |
columnName = None, | |||
schema = None, | |||
doc = None, | |||
** | kwargs ) |
Definition at line 62 of file reserveSourcesTask.py.
lsst.meas.algorithms.reserveSourcesTask.ReserveSourcesTask.applySelectionPrior | ( | self, | |
prior, | |||
selection ) |
Apply selection to full catalog The `select` method makes a random selection of sources. If those sources don't represent the full population (because a sub-selection has already been made), then we need to generate a selection covering the entire population. Parameters ---------- prior : `numpy.ndarray` of type `bool` Prior selection of sources, identifying the subset from which the random selection has been made. selection : `numpy.ndarray` of type `bool` Selection of sources in subset identified by `prior`. Returns ------- full : `numpy.ndarray` of type `bool` Selection applied to full population.
Definition at line 141 of file reserveSourcesTask.py.
lsst.meas.algorithms.reserveSourcesTask.ReserveSourcesTask.markSources | ( | self, | |
sources, | |||
selection ) |
Mark sources in a list or catalog This requires iterating through the list and setting the flag in each source individually. Even if the `sources` is a `Catalog` with contiguous records, it's not currently possible to set a boolean column (DM-6981) so we need to iterate. Parameters ---------- catalog : `lsst.afw.table.Catalog` or `list` of `lsst.afw.table.Record` Catalog in which to flag selected sources. selection : `numpy.ndarray` of type `bool` Selection of sources to mark.
Definition at line 166 of file reserveSourcesTask.py.
lsst.meas.algorithms.reserveSourcesTask.ReserveSourcesTask.run | ( | self, | |
sources, | |||
prior = None, | |||
expId = 0 ) |
Select sources to be reserved Reserved sources will be flagged in the catalog, and we will return boolean arrays that identify the sources to be reserved from and used in the analysis. Typically you'll want to use the sources from the `use` array in your fitting, and use the sources from the `reserved` array as an independent test of your fitting. Parameters ---------- sources : `lsst.afw.table.Catalog` or `list` of `lsst.afw.table.Record` Sources from which to select some to be reserved. prior : `numpy.ndarray` of type `bool`, optional Prior selection of sources. Should have the same length as `sources`. If set, we will only consider for reservation sources that are flagged `True` in this array. expId : `int` Exposure identifier; used for seeding the random number generator. Returns ------- results : `lsst.pipe.base.Struct` The results in a `~lsst.pipe.base.Struct`: ``reserved`` Sources to be reserved are flagged `True` in this array. (`numpy.ndarray` of type `bool`) ``use`` Sources the user should use in analysis are flagged `True`. (`numpy.ndarray` of type `bool`)
Definition at line 69 of file reserveSourcesTask.py.
lsst.meas.algorithms.reserveSourcesTask.ReserveSourcesTask.select | ( | self, | |
numSources, | |||
expId = 0 ) |
Randomly select some sources We return a boolean array with a random selection. The fraction of sources selected is specified by the config parameter `fraction`. Parameters ---------- numSources : `int` Number of sources in catalog from which to select. expId : `int` Exposure identifier; used for seeding the random number generator. Returns ------- selection : `numpy.ndarray` of type `bool` Selected sources are flagged `True` in this array.
Definition at line 114 of file reserveSourcesTask.py.
|
staticprotected |
Definition at line 60 of file reserveSourcesTask.py.
lsst.meas.algorithms.reserveSourcesTask.ReserveSourcesTask.columnName |
Definition at line 66 of file reserveSourcesTask.py.
|
static |
Definition at line 59 of file reserveSourcesTask.py.
lsst.meas.algorithms.reserveSourcesTask.ReserveSourcesTask.key |
Definition at line 67 of file reserveSourcesTask.py.