23 #ifndef AFW_TABLE_SortedCatalog_h_INCLUDED 24 #define AFW_TABLE_SortedCatalog_h_INCLUDED 40 template <
typename RecordT>
41 class SortedCatalogT :
public CatalogT<RecordT> {
42 typedef CatalogT<RecordT> Base;
46 typedef typename Record::Table
Table;
95 template <
typename InputIterator>
98 : Base(table, first, last, deep) {}
106 template <
typename OtherRecordT>
119 return io::FitsReader::apply<SortedCatalogT>(filename, hdu, flags);
132 return io::FitsReader::apply<SortedCatalogT>(manager, hdu, flags);
143 return io::FitsReader::apply<SortedCatalogT>(fitsfile, flags);
170 #endif // !AFW_TABLE_SortedCatalog_h_INCLUDED
Defines the fields and offsets for a table.
SortedCatalogT(std::shared_ptr< Table > const &table=std::shared_ptr< Table >())
Construct a vector from a table (or nothing).
SortedCatalogT(SortedCatalogT< OtherRecordT > const &other)
Shallow copy constructor from a container containing a related record type.
SortedCatalogT subset(std::ptrdiff_t startd, std::ptrdiff_t stopd, std::ptrdiff_t step) const
Shallow copy a subset of another SortedCatalog.
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...
afw::table::Schema schema
bool isSorted(Key< T > const &key) const
Return true if the catalog is in ascending order according to the given key.
void sort(Key< T > const &key)
Sort the catalog in-place by the field with the given key.
SortedCatalogT(Schema const &schema)
Construct a vector from a schema, creating a table with Table::make(schema).
static SortedCatalogT readFits(std::string const &filename, int hdu=INT_MIN, int flags=0)
Read a FITS binary table from a regular file.
void sort()
Sort the vector in-place by ID.
A simple struct that combines the two arguments that must be passed to most cfitsio routines and cont...
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...
SortedCatalogT(std::shared_ptr< Table > const &table, InputIterator first, InputIterator last, bool deep=false)
Construct a vector from a table and an iterator range.
SortedCatalogT(Base const &other)
A base class for image defects.
static SortedCatalogT readFits(fits::Fits &fitsfile, int flags=0)
Read a FITS binary table from a file object already at the correct extension.
Custom catalog class for record/table subclasses that are guaranteed to have an ID, and should generally be sorted by that ID.
Lifetime-management for memory that goes into FITS memory files.
Iterator class for CatalogT.
static SortedCatalogT readFits(fits::MemFileManager &manager, int hdu=INT_MIN, int flags=0)
Read a FITS binary table from a RAM file.
Base::const_iterator const_iterator
iterator find(typename Field< T >::Value const &value, Key< T > const &key)
Return an iterator to the record with the given value.
const_iterator find(RecordId id) const
Return an iterator to the record with the given ID.
iterator find(RecordId id)
Return an iterator to the record with the given ID.
bool isSorted() const
Return true if the vector is in ascending ID order.