LSST Applications g063fba187b+fee0456c91,g0f08755f38+ea96e5a5a3,g1653933729+a8ce1bb630,g168dd56ebc+a8ce1bb630,g1a2382251a+90257ff92a,g20f6ffc8e0+ea96e5a5a3,g217e2c1bcf+937a289c59,g28da252d5a+daa7da44eb,g2bbee38e9b+253935c60e,g2bc492864f+253935c60e,g3156d2b45e+6e55a43351,g32e5bea42b+31359a2a7a,g347aa1857d+253935c60e,g35bb328faa+a8ce1bb630,g3a166c0a6a+253935c60e,g3b1af351f3+a8ce1bb630,g3e281a1b8c+c5dd892a6c,g414038480c+416496e02f,g41af890bb2+afe91b1188,g599934f4f4+0db33f7991,g7af13505b9+e36de7bce6,g80478fca09+da231ba887,g82479be7b0+a4516e59e3,g858d7b2824+ea96e5a5a3,g89c8672015+f4add4ffd5,g9125e01d80+a8ce1bb630,ga5288a1d22+bc6ab8dfbd,gb58c049af0+d64f4d3760,gc28159a63d+253935c60e,gcab2d0539d+3f2b72788c,gcf0d15dbbd+4ea9c45075,gda6a2b7d83+4ea9c45075,gdaeeff99f8+1711a396fd,ge79ae78c31+253935c60e,gef2f8181fd+3031e3cf99,gf0baf85859+c1f95f4921,gfa517265be+ea96e5a5a3,gfa999e8aa5+17cd334064,w.2024.50
LSST Data Management Base Package
|
Custom catalog class for ExposureRecord/Table. More...
#include <Exposure.h>
Public Types | |
using | Record = RecordT |
using | Table = typename Record::Table |
using | iterator = typename Base::iterator |
using | const_iterator = typename Base::const_iterator |
using | ColumnView = typename Record::ColumnView |
using | reference = RecordT & |
using | pointer = std::shared_ptr<RecordT> |
using | size_type = typename Internal::size_type |
using | difference_type = typename Internal::difference_type |
Public Member Functions | |
ExposureCatalogT (std::shared_ptr< Table > const &table=std::shared_ptr< Table >()) | |
Construct a vector from a table (or nothing). | |
ExposureCatalogT (Schema const &schema) | |
Construct a vector from a schema, creating a table with Table::make(schema). | |
template<typename InputIterator > | |
ExposureCatalogT (std::shared_ptr< Table > const &table, InputIterator first, InputIterator last, bool deep=false) | |
Construct a vector from a table and an iterator range. | |
template<typename OtherRecordT > | |
ExposureCatalogT (ExposureCatalogT< OtherRecordT > const &other) | |
Shallow copy constructor from a container containing a related record type. | |
ExposureCatalogT (ExposureCatalogT const &)=default | |
ExposureCatalogT (ExposureCatalogT &&)=default | |
ExposureCatalogT & | operator= (ExposureCatalogT const &)=default |
ExposureCatalogT & | operator= (ExposureCatalogT &&)=default |
~ExposureCatalogT ()=default | |
void | writeFits (fits::Fits &fitsfile, std::shared_ptr< io::OutputArchive > archive, int flags=0) const |
Write a FITS binary table to an open file object. | |
void | writeToArchive (io::OutputArchiveHandle &handle, bool ignoreUnpersistable=true) const |
Convenience output function for Persistables that contain an ExposureCatalog. | |
ExposureCatalogT< 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. | |
ExposureCatalogT | subset (std::ptrdiff_t startd, std::ptrdiff_t stopd, std::ptrdiff_t step) const |
Shallow copy a subset of another ExposureCatalog. | |
ExposureCatalogT | subsetContaining (lsst::geom::SpherePoint const &coord, bool includeValidPolygon=false) const |
Return a shallow subset of the catalog with only those records that contain the given point. | |
ExposureCatalogT | subsetContaining (lsst::geom::Point2D const &point, geom::SkyWcs const &wcs, bool includeValidPolygon=false) const |
Return a shallow subset of the catalog with only those records that contain the given point. | |
bool | isSorted () const |
Return true if the vector is in ascending ID order. | |
template<typename T > | |
bool | isSorted (Key< T > const &key) const |
Return true if the catalog is in ascending order according to the given key. | |
template<typename Compare > | |
bool | isSorted (Compare cmp) const |
Return true if the catalog is in ascending order according to the given predicate. | |
void | sort () |
Sort the vector in-place by ID. | |
template<typename T > | |
void | sort (Key< T > const &key) |
Sort the catalog in-place by the field with the given key. | |
template<typename Compare > | |
void | sort (Compare cmp) |
Sort the catalog in-place by the field with the given predicate. | |
iterator | find (RecordId id) |
Return an iterator to the record with the given ID. | |
const_iterator | find (RecordId id) 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. | |
template<typename T > | |
const_iterator | find (typename Field< T >::Value const &value, Key< T > const &key) const |
std::shared_ptr< Table > | getTable () const |
Return the table associated with the catalog. | |
Schema | getSchema () const |
Return the schema associated with the catalog's table. | |
void | writeFits (std::string const &filename, std::string const &mode="w", int flags=0) const |
Write a FITS binary table to a regular file. | |
void | writeFits (fits::MemFileManager &manager, std::string const &mode="w", int flags=0) const |
Write a FITS binary table to a RAM file. | |
void | writeFits (fits::Fits &fitsfile, int flags=0) const |
Write a FITS binary table to an open file object. | |
ColumnView | getColumnView () const |
Return a ColumnView of this catalog's records. | |
bool | isContiguous () const |
Return true if all records are contiguous. | |
iterator | begin () |
Iterator access. | |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
const_iterator | cbegin () const |
const_iterator | cend () const |
bool | empty () const |
Return true if the catalog has no records. | |
size_type | size () const |
Return the number of elements in the catalog. | |
size_type | max_size () const |
Return the maximum number of elements allowed in a catalog. | |
size_type | capacity () const |
Return the capacity of the catalog. | |
void | reserve (size_type n) |
Increase the capacity of the catalog to the given size. | |
void | resize (size_type n) |
Change the size of the catalog, removing or adding empty records as needed. | |
reference | operator[] (size_type i) const |
Return the record at index i. | |
reference | at (size_type i) const |
Return the record at index i (throws std::out_of_range). | |
reference | front () const |
Return the first record. | |
reference | back () const |
Return the last record. | |
std::shared_ptr< RecordT > const | get (size_type i) const |
Return a pointer to the record at index i. | |
void | set (size_type i, std::shared_ptr< RecordT > const &p) |
Set the record at index i to a pointer. | |
template<typename InputIterator > | |
void | assign (InputIterator first, InputIterator last, bool deep=false) |
Replace the contents of the table with an iterator range. | |
void | push_back (Record const &r) |
Add a copy of the given record to the end of the catalog. | |
void | push_back (std::shared_ptr< RecordT > const &p) |
Add the given record to the end of the catalog without copying. | |
std::shared_ptr< RecordT > | addNew () |
Create a new record, add it to the end of the catalog, and return a pointer to it. | |
void | pop_back () |
Remove the last record in the catalog. | |
CatalogT | copy () const |
Deep-copy the catalog using a cloned table. | |
template<typename InputIterator > | |
void | insert (iterator pos, InputIterator first, InputIterator last, bool deep=false) |
Insert an iterator range into the table. | |
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. | |
iterator | insert (iterator pos, Record const &r) |
Insert a copy of the given record at the given position. | |
iterator | insert (iterator pos, std::shared_ptr< RecordT > const &p) |
Insert the given record at the given position without copying. | |
iterator | erase (iterator pos) |
Erase the record pointed to by pos, and return an iterator the next record. | |
iterator | erase (iterator first, iterator last) |
Erase the records in the range [first, last). | |
void | swap (CatalogT &other) noexcept |
Shallow swap of two catalogs. | |
void | clear () |
Remove all records from the catalog. | |
template<typename T > | |
iterator | lower_bound (typename Field< T >::Value const &value, Key< T > const &key) |
Performed binary searches on sorted fields. | |
template<typename T > | |
const_iterator | lower_bound (typename Field< T >::Value const &value, Key< T > const &key) const |
template<typename T > | |
iterator | upper_bound (typename Field< T >::Value const &value, Key< T > const &key) |
template<typename T > | |
const_iterator | upper_bound (typename Field< T >::Value const &value, Key< T > const &key) const |
template<typename T > | |
std::pair< iterator, iterator > | equal_range (typename Field< T >::Value const &value, Key< T > const &key) |
template<typename T > | |
std::pair< const_iterator, const_iterator > | equal_range (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 |
Internal & | getInternal () |
Return a reference to the internal vector-of-shared_ptr. | |
Internal const & | getInternal () const |
Static Public Member Functions | |
static ExposureCatalogT | readFits (std::string const &filename, int hdu=fits::DEFAULT_HDU, int flags=0) |
Read a FITS binary table from a regular file. | |
static ExposureCatalogT | readFits (fits::MemFileManager &manager, int hdu=fits::DEFAULT_HDU, int flags=0) |
Read a FITS binary table from a RAM file. | |
static ExposureCatalogT | readFits (fits::Fits &fitsfile, int flags=0) |
Read a FITS binary table from a file object already at the correct extension. | |
static ExposureCatalogT | readFits (fits::Fits &fitsfile, std::shared_ptr< io::InputArchive > archive, int flags=0) |
Read a FITS binary table from a file object already at the correct extension. | |
static ExposureCatalogT | readFromArchive (io::InputArchive const &archive, BaseCatalog const &catalog) |
Convenience input function for Persistables that contain an ExposureCatalog. | |
Protected Member Functions | |
ExposureCatalogT (Base const &other) | |
Custom catalog class for ExposureRecord/Table.
We don't expect to subclass ExposureRecord/Table, so unlike other Catalogs we can (and do) define some ExposureCatalogT member functions in Exposure.cc where the explicit instantiation is done.
Definition at line 310 of file Exposure.h.
|
inherited |
using lsst::afw::table::ExposureCatalogT< RecordT >::const_iterator = typename Base::const_iterator |
Definition at line 318 of file Exposure.h.
|
inherited |
using lsst::afw::table::ExposureCatalogT< RecordT >::iterator = typename Base::iterator |
Definition at line 317 of file Exposure.h.
|
inherited |
using lsst::afw::table::ExposureCatalogT< RecordT >::Record = RecordT |
Definition at line 314 of file Exposure.h.
|
inherited |
|
inherited |
using lsst::afw::table::ExposureCatalogT< RecordT >::Table = typename Record::Table |
Definition at line 315 of file Exposure.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 326 of file Exposure.h.
|
inlineexplicit |
Construct a vector from a schema, creating a table with Table::make(schema).
Definition at line 329 of file Exposure.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 342 of file Exposure.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 353 of file Exposure.h.
|
default |
|
default |
|
default |
|
inlineexplicitprotected |
Definition at line 484 of file Exposure.h.
|
inlineinherited |
|
inlineinherited |
Replace the contents of the table with an iterator range.
Delegates to insert(); look there for more information.
Definition at line 474 of file Catalog.h.
|
inlineinherited |
Return the record at index i (throws std::out_of_range).
Definition at line 454 of file Catalog.h.
|
inlineinherited |
|
inlineinherited |
Iterator access.
Definition at line 400 of file Catalog.h.
|
inlineinherited |
Definition at line 402 of file Catalog.h.
|
inlineinherited |
Return the capacity of the catalog.
This is computed as the sum of the current size and the unallocated space in the table. It does not reflect the size of the internal vector, and hence cannot be used to judge when iterators may be invalidated.
Definition at line 424 of file Catalog.h.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Deep-copy the catalog using a cloned table.
Definition at line 499 of file Catalog.h.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inherited |
|
inherited |
Definition at line 849 of file Catalog.h.
|
inherited |
|
inherited |
Definition at line 861 of file Catalog.h.
|
inlineinherited |
|
inlineinherited |
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.
|
inlineinherited |
Definition at line 78 of file SortedCatalog.h.
|
inherited |
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 622 of file Catalog.h.
|
inherited |
Definition at line 625 of file Catalog.h.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Return a ColumnView of this catalog's records.
Will throw RuntimeError if records are not contiguous.
Definition at line 381 of file Catalog.h.
|
inlineinherited |
Return a reference to the internal vector-of-shared_ptr.
While in most cases it is more convenient to use the Catalog's iterators, which dereference directly to Record objects (and hence allow iter->method() rather than (**iter).method()), direct access to the underlying vector-of-shared_ptr is provided here to allow complete use of the C++ STL. In particular, in order to use a mutating STL algorithm on a Catalog in such a way that Records are shallow-copied (i.e. shared_ptr::operator= is invoked instead of Record::operator=), those algorithms should be called on the iterators of these internal containers. When an algorithm should be called in such a way that records are deep-copied, the regular Catalog iterators should be used.
Definition at line 675 of file Catalog.h.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Insert an iterator range into the table.
InputIterator must dereference to a record reference that is convertible to the record type held by the catalog, and must be implicitly convertible to a shared_ptr to a record.
If deep is true, new records will be created by calling copyRecord on the catalog's table. If deep is false, the new records will not be copied, but they must have been created with the catalog's table (note that a table may be shared by multiple catalogs).
If InputIterator models RandomAccessIterator (according to std::iterator_traits) and deep is true, table->preallocate will be used to ensure that the resulting records are contiguous in memory and can be used with ColumnView. To ensure this is the case for other iterator types, the user must preallocate the table manually.
|
inlineinherited |
Insert a copy of the given record at the given position.
|
inlineinherited |
|
inlineinherited |
Insert a range of records into the catalog by copying them with a SchemaMapper.
Definition at line 538 of file Catalog.h.
|
inlineinherited |
|
inlineinherited |
Return true if the vector is in ascending ID order.
Definition at line 63 of file SortedCatalog.h.
|
inherited |
Return true if the catalog is in ascending order according to the given predicate.
cmp(a, b) should return true if record a is less than record b, and false otherwise.
TODO: C++11 has an is_sorted function we should use when available.
Definition at line 590 of file Catalog.h.
|
inherited |
Performed binary searches on sorted fields.
These methods perform binary searches analogous to the STL algorithms of the same name; they simply create a comparison functor using the given value and Key.
In Python, the lower_bound and upper_bound methods return the position of the result record in the catalog, and equal_range returns a Python slice object that defines the range.
Definition at line 804 of file Catalog.h.
|
inherited |
Definition at line 815 of file Catalog.h.
|
inlineinherited |
|
default |
|
default |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Add a copy of the given record to the end of the catalog.
|
inlineinherited |
|
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 412 of file Exposure.h.
|
inlinestatic |
Read a FITS binary table from a file object already at the correct extension.
This overload reads nested Persistables from the given archive instead of loading a new archive from the HDUs following the catalog.
Definition at line 422 of file Exposure.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 400 of file Exposure.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 385 of file Exposure.h.
|
static |
Convenience input function for Persistables that contain an ExposureCatalog.
Unlike the FITS read methods, this reader is not polymorphically aware - it always tries to create an ExposureTable rather than infer the type of table from the data.
Definition at line 458 of file Exposure.cc.
|
inlineinherited |
Increase the capacity of the catalog to the given size.
This can be used to guarantee that the catalog will be contiguous, but it only affects records constructed after reserve().
|
inlineinherited |
Change the size of the catalog, removing or adding empty records as needed.
Definition at line 439 of file Catalog.h.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Sort the vector in-place by ID.
Definition at line 66 of file SortedCatalog.h.
|
inherited |
Sort the catalog in-place by the field with the given predicate.
cmp(a, b) should return true if record a is less than record b, and false otherwise.
Definition at line 602 of file Catalog.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 449 of file Exposure.h.
|
inline |
Shallow copy a subset of another ExposureCatalog.
Mostly here for use from python.
Definition at line 457 of file Exposure.h.
ExposureCatalogT< RecordT > lsst::afw::table::ExposureCatalogT< RecordT >::subsetContaining | ( | lsst::geom::Point2D const & | point, |
geom::SkyWcs const & | wcs, | ||
bool | includeValidPolygon = false ) const |
Return a shallow subset of the catalog with only those records that contain the given point.
If includeValidPolygon is true we check that the point is within the validPolygon of those records which have one; if they don't, this argument is ignored.
Definition at line 485 of file Exposure.cc.
ExposureCatalogT< RecordT > lsst::afw::table::ExposureCatalogT< RecordT >::subsetContaining | ( | lsst::geom::SpherePoint const & | coord, |
bool | includeValidPolygon = false ) const |
Return a shallow subset of the catalog with only those records that contain the given point.
If includeValidPolygon is true we check that the point is within the validPolygon of those records which have one; if they don't, this argument is ignored.
Definition at line 473 of file Exposure.cc.
|
inlinenoexceptinherited |
|
inherited |
Definition at line 826 of file Catalog.h.
|
inherited |
Definition at line 837 of file Catalog.h.
|
inlineinherited |
Write a FITS binary table to an open file object.
[in,out] | fitsfile | Fits file object to write to. |
[in] | flags | Table-subclass-dependent bitflags that control the details of how to read the catalogs. See e.g. SourceFitsFlags. |
Definition at line 333 of file Catalog.h.
|
inline |
Write a FITS binary table to an open file object.
Instead of writing nested Persistables to an internal archive and appending it to the FITS file, this overload inserts nested Persistables into the given archive and does not save it, leaving it to the user to save it later.
Definition at line 370 of file Exposure.h.
|
inlineinherited |
Write a FITS binary table to a RAM file.
[in,out] | manager | Object that manages the memory to write to. |
[in] | mode | "a" to append a new HDU, "w" to overwrite any existing file. |
[in] | flags | Table-subclass-dependent bitflags that control the details of how to read the catalogs. See e.g. SourceFitsFlags. |
|
inlineinherited |
Write a FITS binary table to a regular file.
[in] | filename | Name of the file to write. |
[in] | mode | "a" to append a new HDU, "w" to overwrite any existing file. |
[in] | flags | Table-subclass-dependent bitflags that control the details of how to read the catalogs. See e.g. SourceFitsFlags. |
void lsst::afw::table::ExposureCatalogT< RecordT >::writeToArchive | ( | io::OutputArchiveHandle & | handle, |
bool | ignoreUnpersistable = true ) const |
Convenience output function for Persistables that contain an ExposureCatalog.
Unlike writeFits, this saves main catalog to one of the tables within the archive, as part of a Persistable's set of catalogs, rather than saving it to a separate HDU not managed by the archive.
Definition at line 446 of file Exposure.cc.