LSSTApplications
10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
|
Functions | |
def | Schema_extract |
def | BaseRecord_extract |
def | BaseColumnView_extract |
def lsst.afw.table._syntax.BaseColumnView_extract | ( | self, | |
patterns, | |||
kwds | |||
) |
Extract a dictionary of {<name>: <column-array>} 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. Note that extract("*", copy=True) provides an easy way to transform a row-major ColumnView into a possibly more efficient set of contiguous NumPy arrays. This routines unpacks Flag columns into full boolean arrays and covariances into dense (i.e. non-triangular packed) arrays with dimension (N,M,M), where N is the number of records and M is the dimension of the covariance matrix. Fields with named subfields (e.g. points) are always split into separate dictionary items, as is done in BaseRecord.extract(..., split=True). String fields are silently ignored. Additional optional arguments may be passed as keywords: items ------ 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. where ------ Any expression that can be passed as indices to a NumPy array, including slices, boolean arrays, and index arrays, that will be used to index each column array. This is applied before arrays are copied when copy is True, so if the indexing results in an implicit copy no unnecessary second copy is performed. copy ------- If True, the returned arrays will be contiguous copies rather than strided views into the catalog. This ensures that the lifetime of the catalog is not tied to the lifetime of a particular catalog, and it also may improve the performance if the array is used repeatedly. Default is False. regex ------ 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 -------- A replacement string (see re.MatchObject.expand) used to set the dictionary keys of any fields matched by regex. ordered----- 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 136 of file _syntax.py.
def lsst.afw.table._syntax.BaseRecord_extract | ( | self, | |
patterns, | |||
kwds | |||
) |
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. Additional optional arguments may be passed as keywords: items ------ 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 ------ If True, fields with named subfields (e.g. points) will be split into separate items in the dict; instead of {"point": lsst.afw.geom.Point2I(2,3)}, for instance, you'd get {"point.x": 2, "point.y": 3}. Default is False. regex ------ 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 -------- A replacement string (see re.MatchObject.expand) used to set the dictionary keys of any fields matched by regex. ordered----- 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 87 of file _syntax.py.
def lsst.afw.table._syntax.Schema_extract | ( | self, | |
patterns, | |||
kwds | |||
) |
Extract a dictionary of {<name>: <schema-item>} 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. Additional optional arguments may be passed as keywords: regex ------ 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 -------- A replacement string template (see re.MatchObject.expand) used to set the dictionary keys of any fields matched by regex. The field name in the SchemaItem is not modified. ordered----- If True, a collections.OrderedDict will be returned instead of a standard dict, with the order corresponding to the definition order of the Schema.
Definition at line 35 of file _syntax.py.