LSSTApplications
10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
|
Public Member Functions | |
def | build |
Construct a GroupView from a concatenated catalog. More... | |
def | __init__ |
def | __len__ |
def | __iter__ |
def | __getitem__ |
def | where |
def | aggregate |
Run an aggregate function on each group, returning an array with one element for each group. More... | |
def | apply |
Run a non-aggregate function on each group, returning an array with one element for each record. More... | |
Public Attributes | |
schema | |
ids | |
groups | |
count | |
A mapping (i.e. dict-like object) that provides convenient operations on the concatenated catalogs returned by a MultiMatch object. A GroupView provides access to a catalog of grouped objects, in which the grouping is indicated by a field for which all records in a group have the same value. Once constructed, it allows operations similar to those supported by SQL "GROUP BY", such as filtering and aggregate calculation.
Definition at line 123 of file multiMatch.py.
def lsst.afw.table.multiMatch.GroupView.__init__ | ( | self, | |
schema, | |||
ids, | |||
groups | |||
) |
Direct constructor; most users should call build() instead. This constructor takes the constituent arrays of the object directly, to allow multiple methods for construction.
Definition at line 149 of file multiMatch.py.
def lsst.afw.table.multiMatch.GroupView.__getitem__ | ( | self, | |
key | |||
) |
Return the catalog subset that corresponds to an group field value
Definition at line 168 of file multiMatch.py.
def lsst.afw.table.multiMatch.GroupView.__iter__ | ( | self | ) |
Iterate over group field values
Definition at line 164 of file multiMatch.py.
def lsst.afw.table.multiMatch.GroupView.__len__ | ( | self | ) |
Return the number of groups
Definition at line 160 of file multiMatch.py.
def lsst.afw.table.multiMatch.GroupView.aggregate | ( | self, | |
function, | |||
field = None , |
|||
dtype = float |
|||
) |
Run an aggregate function on each group, returning an array with one element for each group.
[in] | function | Callable object that computes the aggregate value. If field is None, called with the entire subset catalog as an argument. If field is not None, called with an array view into that field. |
[in] | field | A string name or Key object that indicates a single field the aggregate is computed over. |
[in] | dtype | Data type for the output array. |
Definition at line 187 of file multiMatch.py.
def lsst.afw.table.multiMatch.GroupView.apply | ( | self, | |
function, | |||
field = None , |
|||
dtype = float |
|||
) |
Run a non-aggregate function on each group, returning an array with one element for each record.
[in] | function | Callable object that computes the aggregate value. If field is None, called with the entire subset catalog as an argument. If field is not None, called with an array view into that field. |
[in] | field | A string name or Key object that indicates a single field the aggregate is computed over. |
[in] | dtype | Data type for the output array. |
Definition at line 207 of file multiMatch.py.
def lsst.afw.table.multiMatch.GroupView.build | ( | cls, | |
catalog, | |||
groupField = "object" |
|||
) |
Construct a GroupView from a concatenated catalog.
[in] | catalog | Input catalog, containing records grouped by a field in which all records in the same group have the same value. Must be sorted by the group field. |
[in] | groupField | Name or Key for the field that indicates groups. |
Definition at line 133 of file multiMatch.py.
def lsst.afw.table.multiMatch.GroupView.where | ( | self, | |
predicate | |||
) |
Return a new GroupView that contains only groups for which the given predicate function returns True. The predicate function is called once for each group, and passed a single argument: the subset catalog for that group.
Definition at line 175 of file multiMatch.py.
lsst.afw.table.multiMatch.GroupView.count |
Definition at line 158 of file multiMatch.py.
lsst.afw.table.multiMatch.GroupView.groups |
Definition at line 157 of file multiMatch.py.
lsst.afw.table.multiMatch.GroupView.ids |
Definition at line 156 of file multiMatch.py.
lsst.afw.table.multiMatch.GroupView.schema |
Definition at line 155 of file multiMatch.py.