LSSTApplications
10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
|
Custom catalog class for record/table subclasses that are guaranteed to have an ID, and should generally be sorted by that ID. More...
#include <fwd.h>
Public Types | |
typedef RecordT | Record |
typedef Record::Table | Table |
typedef Base::iterator | iterator |
typedef Base::const_iterator | const_iterator |
Public Types inherited from lsst::afw::table::CatalogT< RecordT > | |
typedef RecordT | Record |
typedef Record::Table | Table |
typedef Record::ColumnView | ColumnView |
typedef RecordT | value_type |
typedef RecordT & | reference |
typedef boost::shared_ptr < RecordT > | pointer |
typedef Internal::size_type | size_type |
typedef Internal::difference_type | difference_type |
typedef CatalogIterator < typename Internal::iterator > | iterator |
typedef CatalogIterator < typename Internal::const_iterator > | const_iterator |
Public Member Functions | |
bool | isSorted () const |
Return true if the vector is in ascending ID order. More... | |
void | sort () |
Sort the vector in-place by ID. More... | |
SortedCatalogT (boost::shared_ptr< Table > const &table=boost::shared_ptr< Table >()) | |
Construct a vector from a table (or nothing). More... | |
SortedCatalogT (Schema const &schema) | |
Construct a vector from a schema, creating a table with Table::make(schema). More... | |
template<typename InputIterator > | |
SortedCatalogT (boost::shared_ptr< Table > const &table, InputIterator first, InputIterator last, bool deep=false) | |
Construct a vector from a table and an iterator range. More... | |
template<typename OtherRecordT > | |
SortedCatalogT (SortedCatalogT< OtherRecordT > const &other) | |
Shallow copy constructor from a container containing a related record type. More... | |
SortedCatalogT< RecordT > | subset (ndarray::Array< bool const, 1 > const &mask) const |
Return the subset of a catalog corresponding to the True values of the given mask array. More... | |
SortedCatalogT | subset (std::ptrdiff_t startd, std::ptrdiff_t stopd, std::ptrdiff_t step) const |
Shallow copy a subset of another SortedCatalog. Mostly here for use from python. More... | |
iterator | find (RecordId id) |
Return an iterator to the record with the given ID. More... | |
const_iterator | find (RecordId id) const |
Return an iterator to the record with the given ID. More... | |
Public Member Functions inherited from lsst::afw::table::CatalogT< RecordT > | |
boost::shared_ptr< Table > | getTable () const |
Return the table associated with the catalog. More... | |
Schema | getSchema () const |
Return the schema associated with the catalog's table. More... | |
CatalogT (boost::shared_ptr< Table > const &table=boost::shared_ptr< Table >()) | |
Construct a catalog from a table (or nothing). More... | |
CatalogT (Schema const &schema) | |
Construct a catalog from a schema, creating a table with Table::make(schema). More... | |
template<typename InputIterator > | |
CatalogT (boost::shared_ptr< Table > const &table, InputIterator first, InputIterator last, bool deep=false) | |
Construct a catalog from a table and an iterator range. More... | |
CatalogT (CatalogT const &other) | |
Shallow copy constructor. More... | |
template<typename OtherRecordT > | |
CatalogT (CatalogT< OtherRecordT > const &other) | |
Shallow copy constructor from a container containing a related record type. More... | |
CatalogT & | operator= (CatalogT const &other) |
Shallow assigment. More... | |
CatalogT< RecordT > | subset (ndarray::Array< bool const, 1 > const &mask) const |
Return the subset of a catalog corresponding to the True values of the given mask array. More... | |
CatalogT< RecordT > | subset (std::ptrdiff_t startd, std::ptrdiff_t stopd, std::ptrdiff_t step) const |
Returns a shallow copy of a subset of this Catalog. The arguments correspond to python's slice() syntax. More... | |
void | writeFits (std::string const &filename, std::string const &mode="w", int flags=0) const |
Write a FITS binary table to a regular file. More... | |
void | writeFits (fits::MemFileManager &manager, std::string const &mode="w", int flags=0) const |
Write a FITS binary table to a RAM file. More... | |
void | writeFits (fits::Fits &fitsfile, int flags=0) const |
Write a FITS binary table to an open file object. More... | |
ColumnView | getColumnView () const |
Return a ColumnView of this catalog's records. More... | |
bool | isContiguous () const |
Return true if all records are contiguous. More... | |
bool | empty () const |
Return true if the catalog has no records. More... | |
size_type | size () const |
Return the number of elements in the catalog. More... | |
size_type | max_size () const |
Return the maximum number of elements allowed in a catalog. More... | |
size_type | capacity () const |
Return the capacity of the catalog. More... | |
void | reserve (size_type n) |
Increase the capacity of the catalog to the given size. More... | |
reference | operator[] (size_type i) const |
Return the record at index i. More... | |
reference | at (size_type i) const |
Return the record at index i (throws std::out_of_range). More... | |
reference | front () const |
Return the first record. More... | |
reference | back () const |
Return the last record. More... | |
boost::shared_ptr< RecordT > const | get (size_type i) const |
Return a pointer to the record at index i. More... | |
void | set (size_type i, boost::shared_ptr< RecordT > const &p) |
Set the record at index i to a pointer. More... | |
template<typename InputIterator > | |
void | assign (InputIterator first, InputIterator last, bool deep=false) |
Replace the contents of the table with an iterator range. More... | |
void | push_back (Record const &r) |
Add a copy of the given record to the end of the catalog. More... | |
void | push_back (boost::shared_ptr< RecordT > const &p) |
Add the given record to the end of the catalog without copying. More... | |
boost::shared_ptr< RecordT > | addNew () |
Create a new record, add it to the end of the catalog, and return a pointer to it. More... | |
void | pop_back () |
Remove the last record in the catalog. More... | |
CatalogT | copy () const |
Deep-copy the catalog using a cloned table. More... | |
template<typename InputIterator > | |
void | insert (iterator pos, InputIterator first, InputIterator last, bool deep=false) |
Insert an iterator range into the table. More... | |
template<typename InputIterator > | |
void | insert (SchemaMapper const &mapper, iterator pos, InputIterator first, InputIterator last) |
Insert a range of records into the catalog by copying them with a SchemaMapper. More... | |
iterator | insert (iterator pos, Record const &r) |
Insert a copy of the given record at the given position. More... | |
iterator | insert (iterator pos, boost::shared_ptr< RecordT > const &p) |
Insert the given record at the given position without copying. More... | |
iterator | erase (iterator pos) |
Erase the record pointed to by pos, and return an iterator the next record. More... | |
iterator | erase (iterator first, iterator last) |
Erase the records in the range [first, last). More... | |
void | swap (CatalogT &other) |
Shallow swap of two catalogs. More... | |
void | clear () |
Remove all records from the catalog. More... | |
template<typename T > | |
bool | isSorted (Key< T > const &key) const |
Return true if the catalog is in ascending order according to the given key. More... | |
template<typename Compare > | |
bool | isSorted (Compare cmp) const |
Return true if the catalog is in ascending order according to the given predicate. More... | |
template<typename T > | |
void | sort (Key< T > const &key) |
Sort the catalog in-place by the field with the given key. More... | |
template<typename Compare > | |
void | sort (Compare cmp) |
Sort the catalog in-place by the field with the given predicate. More... | |
template<typename T > | |
CatalogT< RecordT >::iterator | find (typename Field< T >::Value const &value, Key< T > const &key) |
template<typename T > | |
CatalogT< RecordT >::const_iterator | find (typename Field< T >::Value const &value, Key< T > const &key) const |
template<typename T > | |
CatalogT< RecordT >::iterator | lower_bound (typename Field< T >::Value const &value, Key< T > const &key) |
template<typename T > | |
CatalogT< RecordT >::const_iterator | lower_bound (typename Field< T >::Value const &value, Key< T > const &key) const |
template<typename T > | |
CatalogT< RecordT >::iterator | upper_bound (typename Field< T >::Value const &value, Key< T > const &key) |
template<typename T > | |
CatalogT< RecordT >::const_iterator | upper_bound (typename Field< T >::Value const &value, Key< T > const &key) const |
template<typename T > | |
std::pair< typename CatalogT < RecordT >::iterator, typename CatalogT< RecordT > ::iterator > | equal_range (typename Field< T >::Value const &value, Key< T > const &key) |
template<typename T > | |
std::pair< typename CatalogT < RecordT >::const_iterator, typename CatalogT< RecordT > ::const_iterator > | equal_range (typename Field< T >::Value const &value, Key< T > const &key) const |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
template<typename T > | |
iterator | find (typename Field< T >::Value const &value, Key< T > const &key) |
Return an iterator to the record with the given value. More... | |
template<typename T > | |
const_iterator | find (typename Field< T >::Value const &value, Key< T > const &key) const |
Return an iterator to the record with the given value. More... | |
template<typename T > | |
iterator | lower_bound (typename Field< T >::Value const &value, Key< T > const &key) |
Performed binary searches on sorted fields. More... | |
template<typename T > | |
const_iterator | lower_bound (typename Field< T >::Value const &value, Key< T > const &key) const |
Performed binary searches on sorted fields. More... | |
template<typename T > | |
iterator | upper_bound (typename Field< T >::Value const &value, Key< T > const &key) |
Performed binary searches on sorted fields. More... | |
template<typename T > | |
const_iterator | upper_bound (typename Field< T >::Value const &value, Key< T > const &key) const |
Performed binary searches on sorted fields. More... | |
template<typename T > | |
std::pair< iterator, iterator > | equal_range (typename Field< T >::Value const &value, Key< T > const &key) |
Performed binary searches on sorted fields. More... | |
template<typename T > | |
std::pair< const_iterator, const_iterator > | equal_range (typename Field< T >::Value const &value, Key< T > const &key) const |
Performed binary searches on sorted fields. More... | |
Internal & | getInternal () |
Return a reference to the internal vector-of-shared_ptr. More... | |
Internal const & | getInternal () const |
Return a reference to the internal vector-of-shared_ptr. More... | |
Static Public Member Functions | |
static SortedCatalogT | readFits (std::string const &filename, int hdu=0, int flags=0) |
Read a FITS binary table from a regular file. More... | |
static SortedCatalogT | readFits (fits::MemFileManager &manager, int hdu=0, int flags=0) |
Read a FITS binary table from a RAM file. More... | |
static SortedCatalogT | readFits (fits::Fits &fitsfile, int flags=0) |
Read a FITS binary table from a file object already at the correct extension. More... | |
Static Public Member Functions inherited from lsst::afw::table::CatalogT< RecordT > | |
static CatalogT | readFits (std::string const &filename, int hdu=0, int flags=0) |
Read a FITS binary table from a regular file. More... | |
static CatalogT | readFits (fits::MemFileManager &manager, int hdu=0, int flags=0) |
Read a FITS binary table from a RAM file. More... | |
static CatalogT | readFits (fits::Fits &fitsfile, int flags=0) |
Read a FITS binary table from a file object already at the correct extension. More... | |
Protected Member Functions | |
SortedCatalogT (Base const &other) | |
Private Types | |
typedef CatalogT< RecordT > | Base |
Custom catalog class for record/table subclasses that are guaranteed to have an ID, and should generally be sorted by that ID.
For a record/table pair to be used with SortedCatalogT, the table class must provide a static getIdKey() member function that returns the key to the ID field.
|
private |
Definition at line 42 of file SortedCatalog.h.
typedef Base::const_iterator lsst::afw::table::SortedCatalogT< RecordT >::const_iterator |
Definition at line 49 of file SortedCatalog.h.
typedef Base::iterator lsst::afw::table::SortedCatalogT< RecordT >::iterator |
Definition at line 48 of file SortedCatalog.h.
typedef RecordT lsst::afw::table::SortedCatalogT< RecordT >::Record |
Definition at line 45 of file SortedCatalog.h.
typedef Record::Table lsst::afw::table::SortedCatalogT< RecordT >::Table |
Definition at line 46 of file SortedCatalog.h.
|
inlineexplicit |
Construct a vector from a table (or nothing).
A vector with no table is considered invalid; a valid table must be assigned to it before it can be used.
Definition at line 80 of file SortedCatalog.h.
|
inlineexplicit |
Construct a vector from a schema, creating a table with Table::make(schema).
Definition at line 83 of file SortedCatalog.h.
|
inline |
Construct a vector from a table and an iterator range.
If deep is true, new records will be created using table->copyRecord before being inserted. If deep is false, records will be not be copied, but they must already be associated with the given table. The table itself is never deep-copied.
The iterator must dereference to a record reference or const reference rather than a pointer, but should be implicitly convertible to a record pointer as well (see CatalogIterator).
Definition at line 96 of file SortedCatalog.h.
|
inline |
Shallow copy constructor from a container containing a related record type.
This conversion only succeeds if OtherRecordT is convertible to RecordT and OtherTable is convertible to Table.
Definition at line 107 of file SortedCatalog.h.
|
inlineexplicitprotected |
Definition at line 164 of file SortedCatalog.h.
|
inline |
Return an iterator to the record with the given ID.
Returns end() if the Record cannot be found.
Definition at line 70 of file SortedCatalog.h.
|
inline |
Return an iterator to the record with the given ID.
Returns end() if the Record cannot be found.
Definition at line 71 of file SortedCatalog.h.
|
inline |
Return true if the vector is in ascending ID order.
Definition at line 56 of file SortedCatalog.h.
|
inlinestatic |
Read a FITS binary table from a regular file.
[in] | filename | Name of the file to read. |
[in] | hdu | Number of the "header-data unit" to read (where 1 is the Primary HDU). The default value of 0 is interpreted as "the first HDU with NAXIS != 0". |
[in] | flags | Table-subclass-dependent bitflags that control the details of how to read the catalog. See e.g. SourceFitsFlags. |
Definition at line 118 of file SortedCatalog.h.
|
inlinestatic |
Read a FITS binary table from a RAM file.
[in] | manager | Object that manages the memory to be read. |
[in] | hdu | Number of the "header-data unit" to read (where 1 is the Primary HDU). The default value of 0 is interpreted as "the first HDU with NAXIS != 0". |
[in] | flags | Table-subclass-dependent bitflags that control the details of how to read the catalog. See e.g. SourceFitsFlags. |
Definition at line 131 of file SortedCatalog.h.
|
inlinestatic |
Read a FITS binary table from a file object already at the correct extension.
[in] | fitsfile | Fits file object to read from. |
[in] | flags | Table-subclass-dependent bitflags that control the details of how to read the catalog. See e.g. SourceFitsFlags. |
Definition at line 142 of file SortedCatalog.h.
|
inline |
Sort the vector in-place by ID.
Definition at line 59 of file SortedCatalog.h.
|
inline |
Return the subset of a catalog corresponding to the True values of the given mask array.
The returned array's records are shallow copies, and hence will not in general be contiguous.
Definition at line 151 of file SortedCatalog.h.
|
inline |
Shallow copy a subset of another SortedCatalog. Mostly here for use from python.
Definition at line 159 of file SortedCatalog.h.