PostprocessAnalysis¶
- class lsst.pipe.tasks.postprocess.PostprocessAnalysis(handles, functors, filt=None, flags=None, refFlags=None, forcedFlags=None)¶
Bases:
object
Calculate columns from DataFrames or handles storing DataFrames.
This object manages and organizes an arbitrary set of computations on a catalog. The catalog is defined by a
DeferredDatasetHandle
orInMemoryDatasetHandle
object (or list thereof), such as adeepCoadd_obj
dataset, and the computations are defined by a collection oflsst.pipe.tasks.functor.Functor
objects (or, equivalently, aCompositeFunctor
).After the object is initialized, accessing the
.df
attribute (which holds thepandas.DataFrame
containing the results of the calculations) triggers computation of said dataframe.One of the conveniences of using this object is the ability to define a desired common filter for all functors. This enables the same functor collection to be passed to several different
PostprocessAnalysis
objects without having to change the original functor collection, since thefilt
keyword argument of this object triggers an overwrite of thefilt
property for all functors in the collection.This object also allows a list of refFlags to be passed, and defines a set of default refFlags that are always included even if not requested.
If a list of DataFrames or Handles is passed, rather than a single one, then the calculations will be mapped over all the input catalogs. In principle, it should be straightforward to parallelize this activity, but initial tests have failed (see TODO in code comments).
- Parameters:
- handles
lsst.daf.butler.DeferredDatasetHandle
or lsst.pipe.base.InMemoryDatasetHandle
or list of these.Source catalog(s) for computation.
- functors
list
,dict
, orCompositeFunctor
Computations to do (functors that act on
handles
). If a dict, the output DataFrame will have columns keyed accordingly. If a list, the column keys will come from the.shortname
attribute of each functor.- filt
str
, optional Filter in which to calculate. If provided, this will overwrite any existing
.filt
attribute of the provided functors.- flags
list
, optional List of flags (per-band) to include in output table. Taken from the
meas
dataset if applied to a multilevel Object Table.- refFlags
list
, optional List of refFlags (only reference band) to include in output table.
- forcedFlags
list
, optional List of flags (per-band) to include in output table. Taken from the
forced_src
dataset if applied to a multilevel Object Table. Intended for flags from measurement plugins only run during multi-band forced-photometry.
- handles
Attributes Summary
Methods Summary
compute
([dropna, pool])Attributes Documentation
- defaultFuncs¶
- df¶
- func¶
- noDupCols¶
Methods Documentation
- compute(dropna=False, pool=None)¶