CustomFunctor¶
- class lsst.pipe.tasks.functors.CustomFunctor(expr, **kwargs)¶
Bases:
Functor
Arbitrary computation on a catalog
Column names (and thus the columns to be loaded from catalog) are found by finding all words and trying to ignore all “math-y” words.
- Parameters:
- exprstr
Expression to evaluate, to be parsed and executed by
mag_aware_eval
.
Attributes Summary
Columns required to perform calculation
Full name of functor (suitable for figure labels)
Short name of functor (suitable for column name/dict key)
Methods Summary
__call__
(data[, dropna])Call self as a function.
difference
(data1, data2, **kwargs)Computes difference between functor called on two different ParquetTable objects
fail
(df)multilevelColumns
(data[, columnIndex, ...])Returns columns needed by functor from multilevel dataset
Attributes Documentation
- columns¶
- name¶
- noDup¶
- shortname¶
Short name of functor (suitable for column name/dict key)
Methods Documentation
- __call__(data, dropna=False)¶
Call self as a function.
- difference(data1, data2, **kwargs)¶
Computes difference between functor called on two different ParquetTable objects
- fail(df)¶
- multilevelColumns(data, columnIndex=None, returnTuple=False)¶
Returns columns needed by functor from multilevel dataset
To access tables with multilevel column structure, the
MultilevelParquetTable
orDeferredDatasetHandle
need to be passed either a list of tuples or a dictionary.- Parameters:
- datavarious
The data as either
MultilevelParquetTable
,DeferredDatasetHandle
, orInMemoryDatasetHandle
.- columnIndex (optional): pandas `Index` object
either passed or read in from
DeferredDatasetHandle
.- `returnTuple`
bool
If true, then return a list of tuples rather than the column dictionary specification. This is set to
True
byCompositeFunctor
in order to be able to combine columns from the various component functors.