23 #ifndef AFW_TABLE_SortedCatalog_h_INCLUDED
24 #define AFW_TABLE_SortedCatalog_h_INCLUDED
29 namespace lsst {
namespace afw {
namespace table {
40 template <
typename RecordT>
41 class SortedCatalogT :
public CatalogT<RecordT> {
46 typedef typename Record::Table
Table;
95 template <
typename InputIterator>
97 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);
171 #endif // !AFW_TABLE_SortedCatalog_h_INCLUDED
Defines the fields and offsets for a table.
SortedCatalogT(SortedCatalogT< OtherRecordT > const &other)
Shallow copy constructor from a container containing a related record type.
const_iterator find(RecordId id) const
Return an iterator to the record with the given ID.
bool isSorted(Key< T > const &key) const
Return true if the catalog is in ascending order according to the given key.
static SortedCatalogT readFits(fits::MemFileManager &manager, int hdu=0, int flags=0)
Read a FITS binary table from a RAM file.
A custom container class for records, based on std::vector.
afw::table::Schema schema
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).
void sort()
Sort the vector in-place by ID.
SortedCatalogT(boost::shared_ptr< Table > const &table, InputIterator first, InputIterator last, bool deep=false)
Construct a vector from a table and an iterator range.
A simple struct that combines the two arguments that must be passed to most cfitsio routines and cont...
SortedCatalogT(Base const &other)
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...
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.
static SortedCatalogT readFits(std::string const &filename, int hdu=0, int flags=0)
Read a FITS binary table from a regular file.
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...
Iterator class for CatalogT.
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.
bool isSorted() const
Return true if the vector is in ascending ID order.
A multidimensional strided array.
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.
SortedCatalogT(boost::shared_ptr< Table > const &table=boost::shared_ptr< Table >())
Construct a vector from a table (or nothing).
boost::int64_t RecordId
Type used for unique IDs for records.
iterator find(RecordId id)
Return an iterator to the record with the given ID.