LSSTApplications
20.0.0
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 Member Functions | |
SortedCatalogT (SortedCatalogT const &)=default | |
SortedCatalogT (SortedCatalogT &&)=default | |
SortedCatalogT & | operator= (SortedCatalogT const &)=default |
SortedCatalogT & | operator= (SortedCatalogT &&)=default |
~SortedCatalogT ()=default | |
bool | isSorted () const |
Return true if the vector is in ascending ID order. More... | |
void | sort () |
Sort the vector in-place by ID. More... | |
iterator | find (RecordId id) |
Return an iterator to the record with the given ID. More... | |
const_iterator | find (RecordId id) const |
SortedCatalogT (std::shared_ptr< Table > const &table=std::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 (std::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. 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 > | |
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 |
Static Public Member Functions | |
static SortedCatalogT | readFits (std::string const &filename, int hdu=fits::DEFAULT_HDU, int flags=0) |
Read a FITS binary table from a regular file. More... | |
static SortedCatalogT | readFits (fits::MemFileManager &manager, int hdu=fits::DEFAULT_HDU, 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... | |
Protected Member Functions | |
SortedCatalogT (Base const &other) | |
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.
typedef Base::const_iterator lsst::afw::table::SortedCatalogT< RecordT >::const_iterator |
Definition at line 50 of file SortedCatalog.h.
typedef Base::iterator lsst::afw::table::SortedCatalogT< RecordT >::iterator |
Definition at line 49 of file SortedCatalog.h.
typedef RecordT lsst::afw::table::SortedCatalogT< RecordT >::Record |
Definition at line 46 of file SortedCatalog.h.
typedef Record::Table lsst::afw::table::SortedCatalogT< RecordT >::Table |
Definition at line 47 of file SortedCatalog.h.
|
default |
|
default |
|
default |
|
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 87 of file SortedCatalog.h.
|
inlineexplicit |
Construct a vector from a schema, creating a table with Table::make(schema).
Definition at line 90 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 103 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 114 of file SortedCatalog.h.
|
inlineexplicitprotected |
Definition at line 174 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 77 of file SortedCatalog.h.
|
inline |
Definition at line 78 of file SortedCatalog.h.
CatalogT< RecordT >::iterator lsst::afw::table::CatalogT< RecordT >::find | ( | typename T | ) |
Return an iterator to the record with the given value.
When the field being searched is not unique, which matching record will be returned is not defined. In these cases, lower_bound, upper_bound, or equal_range should be used instead.
In Python, this method returns a Record, not an iterator.
Returns end() if the Record cannot be found.
Definition at line 616 of file Catalog.h.
CatalogT< RecordT >::const_iterator lsst::afw::table::CatalogT< RecordT >::find | ( | typename T | ) |
Definition at line 619 of file Catalog.h.
|
inline |
bool lsst::afw::table::CatalogT< RecordT >::isSorted | ( | typename Compare | ) |
bool lsst::afw::table::CatalogT< RecordT >::isSorted | ( | typename T | ) |
|
default |
|
default |
|
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 152 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 0 is the Primary HDU). The default value of afw::fits::DEFAULT_HDU 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 140 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 0 is the Primary HDU). The default value of afw::fits::DEFAULT_HDU 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 126 of file SortedCatalog.h.
|
inline |
void lsst::afw::table::CatalogT< RecordT >::sort | ( | typename Compare | ) |
void lsst::afw::table::CatalogT< RecordT >::sort | ( | typename T | ) |
|
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 161 of file SortedCatalog.h.
|
inline |
Shallow copy a subset of another SortedCatalog.
Mostly here for use from python.
Definition at line 169 of file SortedCatalog.h.