Schema¶
- class lsst.afw.table.Schema¶
- Bases: - pybind11_object- Attributes Summary - Methods Summary - addField(field[, type, doc, units, size, ...])- Add a field to the Schema. - checkUnits([parse_strict])- Check that all units in the Schema are valid Astropy unit strings. - compare(self, other[, flags])- contains(self, other[, flags])- disconnectAliases(self)- extract(*patterns, **kwargs)- Extract a dictionary of {<name>: <schema-item>} in which the field names match the given shell-style glob pattern(s). - find(self, arg0)- forEach(self, arg0)- getAliasMap(self)- getFieldCount(self)- getFlagFieldCount(self)- getNames(self[, topOnly])- getNonFlagFieldCount(self)- Return a list of field names in the order the fields were added to the Schema. - getRecordSize(self)- join(*args, **kwargs)- Overloaded function. - readFits(*args, **kwargs)- Overloaded function. - setAliasMap(self, aliases)- Attributes Documentation - EQUAL_ALIASES = 16¶
 - EQUAL_DOCS = 4¶
 - EQUAL_FIELDS = 15¶
 - EQUAL_KEYS = 1¶
 - EQUAL_NAMES = 2¶
 - EQUAL_UNITS = 8¶
 - IDENTICAL = 31¶
 - VERSION = 3¶
 - Methods Documentation - addField(field, type=None, doc='', units='', size=None, doReplace=False, parse_strict='raise')¶
- Add a field to the Schema. - Parameters:
- fieldstrorField
- The string name of the Field, or a fully-constructed Field object. If the latter, all other arguments besides doReplace are ignored. 
- typestr, optional
- The type of field to create. Valid types are the keys of the afw.table.Field dictionary. 
- docstr
- Documentation for the field. 
- unitsstr
- Units for the field, or an empty string if unitless. 
- sizeint
- Size of the field; valid for string and array fields only. 
- doReplacebool
- If a field with this name already exists, replace it instead of raising pex.exceptions.InvalidParameterError. 
- parse_strictstr
- One of ‘raise’ (default), ‘warn’, or ‘strict’, indicating how to handle unrecognized unit strings. See also astropy.units.Unit. 
 
- field
- Returns:
- result
- Result of the - Fieldaddition.
 
 
 - checkUnits(parse_strict='raise')¶
- Check that all units in the Schema are valid Astropy unit strings. - Parameters:
- parse_strictstr, optional
- One of ‘raise’ (default), ‘warn’, or ‘strict’, indicating how to handle unrecognized unit strings. See also astropy.units.Unit. 
 
- parse_strict
 
 - compare(self: lsst.afw.table.Schema, other: lsst.afw.table.Schema, flags: int = 1) int¶
 - contains(self: lsst.afw.table.Schema, other: lsst.afw.table.Schema, flags: int = 1) int¶
 - disconnectAliases(self: lsst.afw.table.Schema) None¶
 - extract(*patterns, **kwargs)¶
- 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. - Parameters:
- patternsArray of str
- List of glob patterns to use to select field names. 
- kwargsdict
- Dictionary of additional keyword arguments. May contain: - regex- stror- repattern
- 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, optional
- 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. 
 
 
- patternsArray of 
- Returns:
- ddict
- Dictionary of extracted name-schema item sets. 
 
- d
- Raises:
- ValueError
- Raised if the - subkeyword argument is invalid without the- regexargument.- Also raised if an unknown keyword argument is supplied. 
 
 
 - forEach(self: lsst.afw.table.Schema, arg0: object) None¶
 - getAliasMap(self: lsst.afw.table.Schema) lsst.afw.table.AliasMap¶
 - getFieldCount(self: lsst.afw.table.Schema) int¶
 - getFlagFieldCount(self: lsst.afw.table.Schema) int¶
 - getNames(self: lsst.afw.table.Schema, topOnly: bool = False) set[str]¶
 - getNonFlagFieldCount(self: lsst.afw.table.Schema) int¶
 - getOrderedNames()¶
- Return a list of field names in the order the fields were added to the Schema. - Returns:
- namesList
- Field names in order they were added to the Schema. 
 
- names
 
 - getRecordSize(self: lsst.afw.table.Schema) int¶
 - join(*args, **kwargs)¶
- Overloaded function. - join(self: lsst.afw.table.Schema, a: str, b: str) -> str 
- join(self: lsst.afw.table.Schema, a: str, b: str, c: str) -> str 
- join(self: lsst.afw.table.Schema, a: str, b: str, c: str, d: str) -> str 
 
 - static readFits(*args, **kwargs)¶
- Overloaded function. - readFits(filename: str, hdu: int = -2147483648) -> lsst.afw.table.Schema 
- readFits(manager: lsst::afw::fits::MemFileManager, hdu: int = -2147483648) -> lsst.afw.table.Schema 
 
 - setAliasMap(self: lsst.afw.table.Schema, aliases: lsst.afw.table.AliasMap) None¶