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
|
A base class for objects that can be persisted via afw::table::io Archive classes. More...
#include <Persistable.h>
Public Member Functions | |
void | writeFits (std::string const &fileName, std::string const &mode="w") const |
Write the object to a regular FITS file. More... | |
void | writeFits (fits::MemFileManager &manager, std::string const &mode="w") const |
Write the object to a FITS image in memory. More... | |
void | writeFits (fits::Fits &fitsfile) const |
Write the object to an already-open FITS object. More... | |
virtual bool | isPersistable () const |
Return true if this particular object can be persisted using afw::table::io. More... | |
virtual | ~Persistable () |
Protected Types | |
typedef io::OutputArchiveHandle | OutputArchiveHandle |
Protected Member Functions | |
virtual std::string | getPersistenceName () const |
Return the unique name used to persist this object and look up its factory. More... | |
virtual std::string | getPythonModule () const |
Return the fully-qualified Python module that should be imported to guarantee that its factory is registered. More... | |
virtual void | write (OutputArchiveHandle &handle) const |
Write the object to one or more catalogs. More... | |
Persistable () | |
Persistable (Persistable const &other) | |
void | operator= (Persistable const &other) |
Static Private Member Functions | |
static boost::shared_ptr < Persistable > | _readFits (std::string const &fileName, int hdu=0) |
static boost::shared_ptr < Persistable > | _readFits (fits::MemFileManager &manager, int hdu=0) |
static boost::shared_ptr < Persistable > | _readFits (fits::Fits &fitsfile) |
Friends | |
class | io::OutputArchive |
class | io::InputArchive |
template<typename T > | |
class | PersistableFacade |
A base class for objects that can be persisted via afw::table::io Archive classes.
Inheriting from Persistable provides a public API for reading/writing individual objects to FITS that is fully defined in the base class, with derived classes only needing to implement persistence to catalogs. It is expected that objects that contain multiple persistables (such as Exposures) will create their own InputArchives and OutputArchives, and use these to avoid writing the same object twice (which would otherwise be a big concern for future objects like ExposureCatalog and CoaddPsf).
Generally speaking, an abstract base class that inherits from Persistable should also inherit from PersistableFacade<Base>. A concrete class that inherits (possibly indirectly) from Persistable should inherit from PersistableFacade<Derived> (though this just provides a slightly nicer interface to users), implement isPersistable(), getPersistenceName(), and write(), and define a subclass of PersistenceFactory. Inheritance from PersistableFacade should always precede inheritance from Persistable.
Persistable has no pure virtual member functions, and instead contains a default implementation that throws LogicError when the user attempts to save an object for which persistence has not actually been implemented.
Definition at line 74 of file Persistable.h.
Definition at line 114 of file Persistable.h.
|
inlinevirtual |
Definition at line 109 of file Persistable.h.
|
inlineprotected |
Definition at line 142 of file Persistable.h.
|
inlineprotected |
Definition at line 144 of file Persistable.h.
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
protectedvirtual |
Return the unique name used to persist this object and look up its factory.
Must be less than ArchiveIndexSchema::MAX_NAME_LENGTH characters.
Reimplemented in lsst::afw::math::Chebyshev1Function2< ReturnT >, lsst::afw::math::LinearCombinationKernel, lsst::afw::math::DeltaFunctionKernel, lsst::afw::math::AnalyticKernel, lsst::afw::math::PolynomialFunction2< ReturnT >, lsst::afw::math::FixedKernel, lsst::afw::math::DoubleGaussianFunction2< ReturnT >, lsst::afw::image::Wcs, lsst::afw::detection::Footprint, lsst::afw::math::GaussianFunction2< ReturnT >, lsst::afw::geom::polygon::Polygon, lsst::afw::math::ChebyshevBoundedField, lsst::afw::image::TanWcs, lsst::meas::algorithms::CoaddPsf, lsst::afw::image::Calib, lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >, lsst::meas::algorithms::CoaddBoundedField, lsst::afw::detection::GaussianPsf, lsst::afw::image::ApCorrMap, lsst::afw::image::CoaddInputs, lsst::meas::algorithms::KernelPsf, lsst::meas::algorithms::DoubleGaussianPsf, lsst::meas::algorithms::SingleGaussianPsf, and lsst::meas::algorithms::PcaPsf.
|
protectedvirtual |
Return the fully-qualified Python module that should be imported to guarantee that its factory is registered.
Must be less than ArchiveIndexSchema::MAX_MODULE_LENGTH characters.
Will be ignored if empty.
Reimplemented in lsst::afw::math::Kernel, lsst::afw::image::Wcs, lsst::afw::detection::Footprint, lsst::afw::math::Function< ReturnT >, lsst::afw::math::Function< double >, lsst::afw::math::Function< Kernel::Pixel >, lsst::afw::math::ChebyshevBoundedField, lsst::meas::algorithms::CoaddPsf, lsst::meas::algorithms::CoaddBoundedField, lsst::afw::detection::GaussianPsf, lsst::afw::image::ApCorrMap, lsst::afw::image::CoaddInputs, and lsst::meas::algorithms::KernelPsf.
|
inlinevirtual |
Return true if this particular object can be persisted using afw::table::io.
Reimplemented in lsst::afw::math::Chebyshev1Function2< ReturnT >, lsst::afw::math::LinearCombinationKernel, lsst::afw::math::DeltaFunctionKernel, lsst::afw::math::AnalyticKernel, lsst::afw::math::PolynomialFunction2< ReturnT >, lsst::afw::math::FixedKernel, lsst::afw::math::DoubleGaussianFunction2< ReturnT >, lsst::afw::image::Wcs, lsst::afw::detection::Footprint, lsst::afw::math::GaussianFunction2< ReturnT >, lsst::afw::geom::polygon::Polygon, lsst::afw::math::ChebyshevBoundedField, lsst::afw::image::TanWcs, lsst::meas::algorithms::CoaddPsf, lsst::afw::image::Calib, lsst::afw::image::DistortedTanWcs, lsst::meas::algorithms::CoaddBoundedField, lsst::afw::detection::GaussianPsf, lsst::afw::image::CoaddInputs, lsst::afw::image::ApCorrMap, lsst::meas::algorithms::DoubleGaussianPsf, lsst::meas::algorithms::KernelPsf, and lsst::meas::algorithms::SingleGaussianPsf.
Definition at line 107 of file Persistable.h.
|
inlineprotected |
Definition at line 146 of file Persistable.h.
|
protectedvirtual |
Write the object to one or more catalogs.
The handle object passed to this function provides an interface for adding new catalogs and adding nested objects to the same archive (while checking for duplicates). See OutputArchiveHandle for more information.
Reimplemented in lsst::afw::math::Chebyshev1Function2< ReturnT >, lsst::afw::math::LinearCombinationKernel, lsst::afw::math::DeltaFunctionKernel, lsst::afw::math::AnalyticKernel, lsst::afw::math::PolynomialFunction2< ReturnT >, lsst::afw::math::FixedKernel, lsst::afw::math::DoubleGaussianFunction2< ReturnT >, lsst::afw::image::Wcs, lsst::afw::detection::Footprint, lsst::afw::math::GaussianFunction2< ReturnT >, lsst::afw::geom::polygon::Polygon, lsst::afw::math::ChebyshevBoundedField, lsst::afw::image::TanWcs, lsst::meas::algorithms::CoaddPsf, lsst::afw::image::Calib, lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >, lsst::meas::algorithms::CoaddBoundedField, lsst::afw::detection::GaussianPsf, lsst::afw::image::ApCorrMap, lsst::meas::algorithms::KernelPsf, lsst::afw::image::CoaddInputs, lsst::meas::algorithms::DoubleGaussianPsf, and lsst::meas::algorithms::SingleGaussianPsf.
void lsst::afw::table::io::Persistable::writeFits | ( | std::string const & | fileName, |
std::string const & | mode = "w" |
||
) | const |
Write the object to a regular FITS file.
[in] | fileName | Name of the file to write to. |
[in] | mode | If "w", any existing file with the given name will be overwritten. If "a", new HDUs will be appended to an existing file. |
void lsst::afw::table::io::Persistable::writeFits | ( | fits::MemFileManager & | manager, |
std::string const & | mode = "w" |
||
) | const |
Write the object to a FITS image in memory.
[in] | manager | Name of the file to write to. |
[in] | mode | If "w", any existing file with the given name will be overwritten. If "a", new HDUs will be appended to an existing file. |
void lsst::afw::table::io::Persistable::writeFits | ( | fits::Fits & | fitsfile | ) | const |
Write the object to an already-open FITS object.
[in] | fitsfile | Open FITS object to write to. |
|
friend |
Definition at line 151 of file Persistable.h.
|
friend |
Definition at line 150 of file Persistable.h.
|
friend |
Definition at line 153 of file Persistable.h.