LSST Applications g04e9c324dd+8c5ae1fdc5,g0644efc3f0+366663dc37,g123d84c11c+8c5ae1fdc5,g1ec0fe41b4+6ec6b74de1,g1fd858c14a+1be88e80db,g3533f9d6cb+366663dc37,g35bb328faa+8c5ae1fdc5,g35ef7ab7cf+285dd5b202,g53246c7159+8c5ae1fdc5,g60b5630c4e+366663dc37,g663da51e9b+41529343ca,g6735e52a0d+29de3d959a,g67b6fd64d1+57193d00fb,g7605de067c+8f72e4d2dc,g78460c75b0+7e33a9eb6d,g786e29fd12+668abc6043,g844c57033c+03ddc13274,g8852436030+e345a59dd4,g89139ef638+57193d00fb,g989de1cb63+57193d00fb,g9a0bdda227+852181cf57,g9f33ca652e+a2d35689ce,ga1e959baac+5fbc491aed,ga2f891cd6c+366663dc37,gabe3b4be73+8856018cbb,gabf8522325+cc757f8247,gac2eed3f23+57193d00fb,gb1101e3267+f6b489998a,gb89ab40317+57193d00fb,gcf25f946ba+e345a59dd4,gd107969129+227687db21,gd6cbbdb0b4+8e46defd2a,gde0f65d7ad+2dad650f79,ge278dab8ac+2322f1d6ea,ge410e46f29+57193d00fb,gf30d85a44d+8e3077faf9,gf5e32f922b+8c5ae1fdc5,gff02db199a+5c78c1866e,w.2025.28
LSST Data Management Base Package
Loading...
Searching...
No Matches
lsst.pipe.tasks.postprocess.for Class Reference
Inheritance diagram for lsst.pipe.tasks.postprocess.for:

Static Public Attributes

 funcs :
 
 sourceId :
 
Index x :
 
slot_Centroid_x y :
 
slot_Centroid_y psfFlux :
 
LocalNanojansky args :
 
 psfFluxErr :
 
LocalNanojanskyErr args :
 
 flags :
 

Detailed Description

_defaultRefFlags = []
_defaultFuncs = ()

def __init__(self, handles, functors, filt=None, flags=None, refFlags=None, forcedFlags=None):
    self.handles = handles
    self.functors = functors

    self.filt = filt
    self.flags = list(flags) if flags is not None else []
    self.forcedFlags = list(forcedFlags) if forcedFlags is not None else []
    self.refFlags = list(self._defaultRefFlags)
    if refFlags is not None:
        self.refFlags += list(refFlags)

    self._df = None

@property
def defaultFuncs(self):
    funcs = dict(self._defaultFuncs)
    return funcs

@property
def func(self):
    additionalFuncs = self.defaultFuncs
    additionalFuncs.update({flag: Column(flag, dataset="forced_src") for flag in self.forcedFlags})
    additionalFuncs.update({flag: Column(flag, dataset="ref") for flag in self.refFlags})
    additionalFuncs.update({flag: Column(flag, dataset="meas") for flag in self.flags})

    if isinstance(self.functors, CompositeFunctor):
        func = self.functors
    else:
        func = CompositeFunctor(self.functors)

    func.funcDict.update(additionalFuncs)
    func.filt = self.filt

    return func

@property
def noDupCols(self):
    return [name for name, func in self.func.funcDict.items() if func.noDup]

@property
def df(self):
    if self._df is None:
        self.compute()
    return self._df

def compute(self, dropna=False, pool=None):
    # map over multiple handles
    if type(self.handles) in (list, tuple):
        if pool is None:
            dflist = [self.func(handle, dropna=dropna) for handle in self.handles]
        else:
            # TODO: Figure out why this doesn't work (pyarrow pickling
            # issues?)
            dflist = pool.map(functools.partial(self.func, dropna=dropna), self.handles)
        self._df = pd.concat(dflist)
    else:
        self._df = self.func(self.handles, dropna=dropna)

    return self._df


class TransformCatalogBaseConnections(pipeBase.PipelineTaskConnections,
                                  dimensions=()):
inputCatalog = connectionTypes.Input(
    name="",
    storageClass="DataFrame",
)
outputCatalog = connectionTypes.Output(
    name="",
    storageClass="ArrowAstropy",
)


class TransformCatalogBaseConfig(pipeBase.PipelineTaskConfig,
                             pipelineConnections=TransformCatalogBaseConnections):
functorFile = pexConfig.Field(
    dtype=str,
    doc="Path to YAML file specifying Science Data Model functors to use "
        "when copying columns and computing calibrated values.",
    default=None,
    optional=True
)
primaryKey = pexConfig.Field(
    dtype=str,
    doc="Name of column to be set as the DataFrame index. If None, the index"
        "will be named `id`",
    default=None,
    optional=True
)
columnsFromDataId = pexConfig.ListField(
    dtype=str,
    default=None,
    optional=True,
    doc="Columns to extract from the dataId",
)


class TransformCatalogBaseTask(pipeBase.PipelineTask):

Definition at line 723 of file postprocess.py.

Member Data Documentation

◆ args [1/2]

LocalNanojansky lsst.pipe.tasks.postprocess.for.args :
static

Definition at line 747 of file postprocess.py.

◆ args [2/2]

LocalNanojanskyErr lsst.pipe.tasks.postprocess.for.args :
static

Definition at line 754 of file postprocess.py.

◆ flags

lsst.pipe.tasks.postprocess.for.flags :
static

Definition at line 759 of file postprocess.py.

◆ funcs

lsst.pipe.tasks.postprocess.for.funcs :
static

Definition at line 736 of file postprocess.py.

◆ psfFlux

slot_Centroid_y lsst.pipe.tasks.postprocess.for.psfFlux :
static

Definition at line 745 of file postprocess.py.

◆ psfFluxErr

lsst.pipe.tasks.postprocess.for.psfFluxErr :
static

Definition at line 752 of file postprocess.py.

◆ sourceId

lsst.pipe.tasks.postprocess.for.sourceId :
static

Definition at line 737 of file postprocess.py.

◆ x

Index lsst.pipe.tasks.postprocess.for.x :
static

Definition at line 739 of file postprocess.py.

◆ y

slot_Centroid_x lsst.pipe.tasks.postprocess.for.y :
static

Definition at line 742 of file postprocess.py.


The documentation for this class was generated from the following file: