lsst.afw  21.0.0-29-g56632e870+d45ff82f5e
Public Member Functions | List of all members
lsst.afw.table._base.BaseRecord Class Reference

Public Member Functions

def extract (self, *patterns, **kwargs)
 
def __repr__ (self)
 

Detailed Description

Definition at line 32 of file _base.py.

Member Function Documentation

◆ __repr__()

def lsst.afw.table._base.BaseRecord.__repr__ (   self)

Definition at line 84 of file _base.py.

◆ extract()

def lsst.afw.table._base.BaseRecord.extract (   self,
patterns,
**  kwargs 
)
Extract a dictionary of {<name>: <field-value>} in which the field names
match the given shell-style glob pattern(s).

Any number of glob patterns may be passed; the result will be the union of all
the result of each glob considered separately.

Parameters
----------
items : `dict`
    The result of a call to self.schema.extract(); this will be used
    instead of doing any new matching, and allows the pattern matching
    to be reused to extract values from multiple records.  This
    keyword is incompatible with any position arguments and the regex,
    sub, and ordered keyword arguments.
split : `bool`
    If `True`, fields with named subfields (e.g. points) will be split
    into separate items in the dict; instead of {"point":
    lsst.geom.Point2I(2,3)}, for instance, you'd get {"point.x":
    2, "point.y": 3}. Default is `False`.
regex : `str` or `re` pattern object
    A regular expression to be used in addition to any glob patterns
    passed as positional arguments.  Note that this will be compared
    with re.match, not re.search.
sub : `str`
    A replacement string (see `re.MatchObject.expand`) used to set the
    dictionary keys of any fields matched by regex.
ordered : `bool`
    If `True`, a `collections.OrderedDict` will be returned instead of
    a standard dict, with the order corresponding to the definition
    order of the `Schema`. Default is `False`.

Definition at line 34 of file _base.py.


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