SourceCatalog

class lsst.afw.table.SourceCatalog

Bases: lsst.afw.table._SourceCatalogBase

Attributes Summary

columns a column view of the catalog
dtype
schema
table

Methods Summary

addNew()
append(record)
asAstropy([cls, copy, unviewable]) Return an astropy.table.Table (or subclass thereof) view into this catalog.
between(*args, **kwargs) Overloaded function.
capacity(self)
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).
equal_range(*args, **kwargs) Overloaded function.
extend(iterable[, deep, mapper]) Append all records in the given iterable to the catalog.
find(self, value, key)
getChildren(parent, *args) Return the subset of self for which the parent field equals the given value.
getColumnView()
getSchema(self)
getTable(self)
insert(key, value)
isContiguous(self)
isSorted(self, key)
lower_bound(*args, **kwargs) Overloaded function.
readFits(*args, **kwargs) Overloaded function.
reserve(self, arg0)
resize(self, arg0)
set(self, arg0, arg1)
sort(self, key)
subset(*args, **kwargs) Overloaded function.
upper_bound(*args, **kwargs) Overloaded function.
writeFits(*args, **kwargs) Overloaded function.

Attributes Documentation

columns

a column view of the catalog

dtype = 'Source'
schema
table

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.

between(*args, **kwargs)

Overloaded function.

  1. between(self: lsst.afw.table._SourceCatalogBase, arg0: int, arg1: int, arg2: lsst.afw.table.KeyI) -> slice
  2. between(self: lsst.afw.table._SourceCatalogBase, arg0: int, arg1: int, arg2: lsst.afw.table.KeyL) -> slice
  3. between(self: lsst.afw.table._SourceCatalogBase, arg0: float, arg1: float, arg2: lsst.afw.table.KeyF) -> slice
  4. between(self: lsst.afw.table._SourceCatalogBase, arg0: float, arg1: float, arg2: lsst.afw.table.KeyD) -> slice
  5. between(self: lsst.afw.table._SourceCatalogBase, arg0: lsst.geom.Angle, arg1: lsst.geom.Angle, arg2: lsst.afw.table.KeyAngle) -> slice
capacity(self: lsst.afw.table._SourceCatalogBase) → int
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).

equal_range(*args, **kwargs)

Overloaded function.

  1. equal_range(self: lsst.afw.table._SourceCatalogBase, arg0: int, arg1: lsst.afw.table.KeyI) -> slice
  2. equal_range(self: lsst.afw.table._SourceCatalogBase, arg0: int, arg1: lsst.afw.table.KeyL) -> slice
  3. equal_range(self: lsst.afw.table._SourceCatalogBase, arg0: float, arg1: lsst.afw.table.KeyF) -> slice
  4. equal_range(self: lsst.afw.table._SourceCatalogBase, arg0: float, arg1: lsst.afw.table.KeyD) -> slice
  5. equal_range(self: lsst.afw.table._SourceCatalogBase, arg0: lsst.geom.Angle, arg1: lsst.afw.table.KeyAngle) -> slice
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.

find(self: object, value: object, key: object = None) → object
getChildren(parent, *args)

Return the subset of self for which the parent field equals the given value.

In order for this method to return the correct result, it must be sorted by parent (i.e. self.isSorted(SourceTable.getParentKey()) must be True). This is naturally the case with SourceCatalogs produced by the detection and deblending tasks, but it may not be true when concatenating multiple such catalogs.

Additional Catalogs or sequences whose elements correspond in order to the records of self (i.e. zip(self, *args) is valid) will be subset using the same slice object used on self, and these subsets will be returned along with the subset of self.

Parameters:
parent : int

ID of the parent to get children for.

args : Catalog

Additional catalogs to subset for the childrens to return.

Returns:
children : iterable of SourceRecord

Children sources.

getColumnView()
getSchema(self: lsst.afw.table._SourceCatalogBase) → lsst.afw.table.Schema
getTable(self: lsst.afw.table._SourceCatalogBase) → lsst.afw.table.SourceTable
insert(key, value)
isContiguous(self: lsst.afw.table._SourceCatalogBase) → bool
isSorted(self: object, key: object = None) → object
lower_bound(*args, **kwargs)

Overloaded function.

  1. lower_bound(self: lsst.afw.table._SourceCatalogBase, arg0: int, arg1: lsst.afw.table.KeyI) -> int
  2. lower_bound(self: lsst.afw.table._SourceCatalogBase, arg0: int, arg1: lsst.afw.table.KeyL) -> int
  3. lower_bound(self: lsst.afw.table._SourceCatalogBase, arg0: float, arg1: lsst.afw.table.KeyF) -> int
  4. lower_bound(self: lsst.afw.table._SourceCatalogBase, arg0: float, arg1: lsst.afw.table.KeyD) -> int
  5. lower_bound(self: lsst.afw.table._SourceCatalogBase, arg0: lsst.geom.Angle, arg1: lsst.afw.table.KeyAngle) -> int
static readFits(*args, **kwargs)

Overloaded function.

  1. readFits(filename: str, hdu: int = -2147483648, flags: int = 0) -> lsst.afw.table.SourceCatalog
  2. readFits(manager: lsst::afw::fits::MemFileManager, hdu: int = -2147483648, flags: int = 0) -> lsst.afw.table.SourceCatalog
reserve(self: lsst.afw.table._SourceCatalogBase, arg0: int) → None
resize(self: lsst.afw.table._SourceCatalogBase, arg0: int) → None
set(self: lsst.afw.table._SourceCatalogBase, arg0: int, arg1: lsst.afw.table.SourceRecord) → None
sort(self: object, key: object = None) → object
subset(*args, **kwargs)

Overloaded function.

  1. subset(self: lsst.afw.table.SourceCatalog, arg0: numpy.ndarray) -> lsst.afw.table.SourceCatalog
  2. subset(self: lsst.afw.table.SourceCatalog, arg0: int, arg1: int, arg2: int) -> lsst.afw.table.SourceCatalog
upper_bound(*args, **kwargs)

Overloaded function.

  1. upper_bound(self: lsst.afw.table._SourceCatalogBase, arg0: int, arg1: lsst.afw.table.KeyI) -> int
  2. upper_bound(self: lsst.afw.table._SourceCatalogBase, arg0: int, arg1: lsst.afw.table.KeyL) -> int
  3. upper_bound(self: lsst.afw.table._SourceCatalogBase, arg0: float, arg1: lsst.afw.table.KeyF) -> int
  4. upper_bound(self: lsst.afw.table._SourceCatalogBase, arg0: float, arg1: lsst.afw.table.KeyD) -> int
  5. upper_bound(self: lsst.afw.table._SourceCatalogBase, arg0: lsst.geom.Angle, arg1: lsst.afw.table.KeyAngle) -> int
writeFits(*args, **kwargs)

Overloaded function.

  1. writeFits(self: lsst.afw.table._SourceCatalogBase, filename: str, mode: str = ‘w’, flags: int = 0) -> None
  2. writeFits(self: lsst.afw.table._SourceCatalogBase, manager: lsst::afw::fits::MemFileManager, mode: str = ‘w’, flags: int = 0) -> None