lsst.afw g4f66151db1+308b63831b
Public Member Functions | List of all members
lsst.afw.table._schemaMapper.SchemaMapper Class Reference

Public Member Functions

def addOutputField (self, field, type=None, doc=None, units="", size=None, doReplace=False, parse_strict="raise")
 
def addMapping (self, input, output=None, doReplace=True)
 
def __eq__ (self, other)
 
def __reduce__ (self)
 

Detailed Description

Definition at line 32 of file _schemaMapper.py.

Member Function Documentation

◆ __eq__()

def lsst.afw.table._schemaMapper.SchemaMapper.__eq__ (   self,
  other 
)
SchemaMappers are equal if their respective input and output
schemas are identical, and they have the same mappings defined.

Note: It was simpler to implement equality in python than in C++.

Definition at line 100 of file _schemaMapper.py.

◆ __reduce__()

def lsst.afw.table._schemaMapper.SchemaMapper.__reduce__ (   self)
To support pickle.

Definition at line 125 of file _schemaMapper.py.

◆ addMapping()

def lsst.afw.table._schemaMapper.SchemaMapper.addMapping (   self,
  input,
  output = None,
  doReplace = True 
)
Add a mapped field to the output schema.

Parameters
----------
input : `~lsst.afw.table.Key`
    A `Key` from the input schema whose values will be mapped to the new
    field.
output : `str` or `~lsst.afw.table.Field`
    A `Field` object that describes the new field to be added to the
    output schema, or the name of the field (with documentation and
    units copied from the input schema).  May be None to copy everything
    from the input schema.
doReplace : `bool`
    If a field with this name already exists in the output schema,
    replace it instead of raising `pex.exceptions.InvalidParameterError`.

Returns
-------
key : `~lsst.afw.table.Key`
    The key for the new mapped field.

Definition at line 70 of file _schemaMapper.py.

◆ addOutputField()

def lsst.afw.table._schemaMapper.SchemaMapper.addOutputField (   self,
  field,
  type = None,
  doc = None,
  units = "",
  size = None,
  doReplace = False,
  parse_strict = "raise" 
)
Add an un-mapped field to the output Schema.

Parameters
----------
field : `str` or `~lsst.afw.table.Field`
    The string name of the `Field`, or a fully-constructed
    `Field` object.  If the latter, all other arguments
    besides doReplace are ignored.
type : `str`
    The type of field to create.  Valid types are the keys of the
    afw.table.Field dictionary.
doc : `str`
    Documentation for the field.
unit : `str`
    Units for the field, or an empty string if unitless.
size : `int`
    Size of the field; valid for string and array fields only.
doReplace : `bool`
    If a field with this name already exists, replace it instead of
    raising pex.exceptions.InvalidParameterError.
parse_strict : `str`
    One of 'raise' (default), 'warn', or 'strict', indicating how to
    handle unrecognized unit strings.  See also astropy.units.Unit.

Returns
-------
key : `~lsst.afw.table.Key`
    The key of the field added.

Definition at line 34 of file _schemaMapper.py.


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