Catalog

class lsst.afw.table.Catalog

Bases: object

Attributes Summary

TEMPLATE_DEFAULTS
TEMPLATE_PARAMS
columns a column view of the catalog

Methods Summary

addNew()
append(record)
asAstropy([cls, copy, unviewable]) Return an astropy.table.Table (or subclass thereof) view into this catalog.
cast(type_[, deep]) Return a copy of the catalog with the given type.
clear()
copy([deep]) Copy a catalog (default is not a deep copy).
extend(iterable[, deep, mapper]) Append all records in the given iterable to the catalog.
getColumnView()
insert(key, value)

Attributes Documentation

TEMPLATE_DEFAULTS = (None,)
TEMPLATE_PARAMS = ('dtype',)
columns

a column view of the catalog

Methods Documentation

addNew()
append(record)
asAstropy(cls=None, copy=False, unviewable='copy')

Return an astropy.table.Table (or subclass thereof) view into this catalog.

Parameters:
cls

Table subclass to use; None implies astropy.table.Table itself. Use astropy.table.QTable to get Quantity columns.

copy : bool, optional

If True, copy data from the LSST catalog to the astropy table. Not copying is usually faster, but can keep memory from being freed if columns are later removed from the Astropy view.

unviewable : str, optional

One of the following options (which is ignored if copy=`True` ), indicating how to handle field types (str and Flag) for which views cannot be constructed:

  • ‘copy’ (default): copy only the unviewable fields.
  • ‘raise’: raise ValueError if unviewable fields are present.
  • ‘skip’: do not include unviewable fields in the Astropy Table.
Returns:
cls : astropy.table.Table

Astropy view into the catalog.

Raises:
ValueError

Raised if the unviewable option is not a known value, or if the option is ‘raise’ and an uncopyable field is found.

cast(type_, deep=False)

Return a copy of the catalog with the given type.

Parameters:
type_

Type of catalog to return.

deep : bool, optional

If True, clone the table and deep copy all records.

Returns:
copy :

Copy of catalog with the requested type.

clear()
copy(deep=False)

Copy a catalog (default is not a deep copy).

extend(iterable, deep=False, mapper=None)

Append all records in the given iterable to the catalog.

Parameters:
iterable

Any Python iterable containing records.

deep : bool, optional

If True, the records will be deep-copied; ignored if mapper is not None (that always implies True).

mapper : lsst.afw.table.schemaMapper.SchemaMapper, optional

Used to translate records.

getColumnView()
insert(key, value)