lsst.afw  14.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
lsst.afw.table.multiMatch.GroupView Class Reference
Inheritance diagram for lsst.afw.table.multiMatch.GroupView:

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
 

Detailed Description

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 141 of file multiMatch.py.

Constructor & Destructor Documentation

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 169 of file multiMatch.py.

Member Function Documentation

def lsst.afw.table.multiMatch.GroupView.__getitem__ (   self,
  key 
)
Return the catalog subset that corresponds to an group field value

Definition at line 188 of file multiMatch.py.

def lsst.afw.table.multiMatch.GroupView.__iter__ (   self)
Iterate over group field values

Definition at line 184 of file multiMatch.py.

def lsst.afw.table.multiMatch.GroupView.__len__ (   self)
Return the number of groups

Definition at line 180 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.

Parameters
[in]functionCallable 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]fieldA string name or Key object that indicates a single field the aggregate is computed over.
[in]dtypeData type for the output array.

Definition at line 207 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.

Parameters
[in]functionCallable 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]fieldA string name or Key object that indicates a single field the aggregate is computed over.
[in]dtypeData type for the output array.

Definition at line 229 of file multiMatch.py.

def lsst.afw.table.multiMatch.GroupView.build (   cls,
  catalog,
  groupField = "object" 
)

Construct a GroupView from a concatenated catalog.

Parameters
[in]cls(Class; omit this argument, but Doxygen wants it mentioned)
[in]catalogInput 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]groupFieldName or Key for the field that indicates groups.

Definition at line 151 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 195 of file multiMatch.py.

Member Data Documentation

lsst.afw.table.multiMatch.GroupView.count

Definition at line 178 of file multiMatch.py.

lsst.afw.table.multiMatch.GroupView.groups

Definition at line 177 of file multiMatch.py.

lsst.afw.table.multiMatch.GroupView.ids

Definition at line 176 of file multiMatch.py.

lsst.afw.table.multiMatch.GroupView.schema

Definition at line 175 of file multiMatch.py.


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