LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Friends | List of all members
lsst::meas::modelfit::Mixture Class Reference

#include <Mixture.h>

Inheritance diagram for lsst::meas::modelfit::Mixture:
lsst::afw::table::io::PersistableFacade< Mixture > lsst::afw::table::io::Persistable

Public Types

typedef MixtureComponent Component
 
typedef MixtureUpdateRestriction UpdateRestriction
 
typedef std::vector< ComponentComponentList
 
typedef ComponentList::iterator iterator
 
typedef ComponentList::const_iterator const_iterator
 

Public Member Functions

iterator begin ()
 Iterator and indexed access to components. More...
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
Componentoperator[] (std::size_t i)
 
Component const & operator[] (std::size_t i) const
 
std::size_t size () const
 Return the number of components. More...
 
virtual int getComponentCount () const
 Return the number of components. More...
 
std::shared_ptr< Mixtureproject (int dim) const
 Project the distribution onto the given dimensions (marginalize over all others) More...
 
std::shared_ptr< Mixtureproject (int dim1, int dim2) const
 Project the distribution onto the given dimensions (marginalize over all others) More...
 
int getDimension () const
 Return the number of dimensions. More...
 
void normalize ()
 Iterate over all components, rescaling their weights so they sum to one. More...
 
void shift (int dim, Scalar offset)
 Shift the mixture in the given dimension, adding the given offset to all mu vectors. More...
 
std::size_t clip (Scalar threshold=0.0)
 Iterate over all components, removing those with weight less than or equal to threshold. More...
 
Scalar getDegreesOfFreedom () const
 Get the number of degrees of freedom in the component Student's T distributions (inf=Gaussian) More...
 
void setDegreesOfFreedom (Scalar df=std::numeric_limits< Scalar >::infinity())
 Set the number of degrees of freedom in the component Student's T distributions (inf=Gaussian) More...
 
template<typename Derived >
Scalar evaluate (Component const &component, Eigen::MatrixBase< Derived > const &x) const
 Evaluate the probability density at the given point for the given component distribution. More...
 
template<typename Derived >
Scalar evaluate (Eigen::MatrixBase< Derived > const &x) const
 Evaluate the mixture distribution probability density function (PDF) at the given points. More...
 
void evaluate (ndarray::Array< Scalar const, 2, 1 > const &x, ndarray::Array< Scalar, 1, 0 > const &p) const
 Evaluate the distribution probability density function (PDF) at the given points. More...
 
void evaluateComponents (ndarray::Array< Scalar const, 2, 1 > const &x, ndarray::Array< Scalar, 2, 1 > const &p) const
 Evaluate the contributions of each component to the full probability at the given points. More...
 
void evaluateDerivatives (ndarray::Array< Scalar const, 1, 1 > const &x, ndarray::Array< Scalar, 1, 1 > const &gradient, ndarray::Array< Scalar, 2, 1 > const &hessian) const
 Evaluate the derivative of the distribution at the given point. More...
 
void evaluateDerivatives (Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > &x, Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > &gradient, Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > &hessian) const
 Evaluate the derivative of the distribution at the given point. More...
 
void evaluateDerivatives (Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > &x, Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > &gradient) const
 Evaluate the derivative of the distribution at the given point. More...
 
void draw (afw::math::Random &rng, ndarray::Array< Scalar, 2, 1 > const &x) const
 Draw random variates from the distribution. More...
 
void updateEM (ndarray::Array< Scalar const, 2, 1 > const &x, ndarray::Array< Scalar const, 1, 0 > const &w, Scalar tau1=0.0, Scalar tau2=0.5)
 Perform an Expectation-Maximization step, updating the component parameters to match the given weighted samples. More...
 
void updateEM (ndarray::Array< Scalar const, 2, 1 > const &x, ndarray::Array< Scalar const, 1, 0 > const &w, UpdateRestriction const &restriction, Scalar tau1=0.0, Scalar tau2=0.5)
 Perform an Expectation-Maximization step, updating the component parameters to match the given weighted samples. More...
 
void updateEM (ndarray::Array< Scalar const, 2, 1 > const &x, UpdateRestriction const &restriction, Scalar tau1=0.0, Scalar tau2=0.5)
 Perform an Expectation-Maximization step, updating the component parameters to match the given unweighted samples. More...
 
virtual std::shared_ptr< Mixtureclone () const
 Polymorphic deep copy. More...
 
 Mixture (int dim, ComponentList &components, Scalar df=std::numeric_limits< Scalar >::infinity())
 Construct a mixture model. More...
 
virtual bool isPersistable () const noexcept override
 Return true if this particular object can be persisted using afw::table::io. More...
 
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...
 

Static Public Member Functions

static std::shared_ptr< MixturereadFits (fits::Fits &fitsfile)
 Read an object from an already open FITS object. More...
 
static std::shared_ptr< MixturereadFits (std::string const &fileName, int hdu=fits::DEFAULT_HDU)
 Read an object from a regular FITS file. More...
 
static std::shared_ptr< MixturereadFits (fits::MemFileManager &manager, int hdu=fits::DEFAULT_HDU)
 Read an object from a FITS file in memory. More...
 
static std::shared_ptr< MixturedynamicCast (std::shared_ptr< Persistable > const &ptr)
 Dynamically cast a shared_ptr. More...
 

Protected Types

using OutputArchiveHandle = io::OutputArchiveHandle
 

Protected Member Functions

std::string getPythonModule () const override
 Return the fully-qualified Python module that should be imported to guarantee that its factory is registered. More...
 
std::string getPersistenceName () const override
 Return the unique name used to persist this object and look up its factory. More...
 
void write (OutputArchiveHandle &handle) const override
 Write the object to one or more catalogs. More...
 

Friends

std::ostreamoperator<< (std::ostream &os, Mixture const &self)
 

Detailed Description

Definition at line 128 of file Mixture.h.

Member Typedef Documentation

◆ Component

Definition at line 131 of file Mixture.h.

◆ ComponentList

Definition at line 133 of file Mixture.h.

◆ const_iterator

typedef ComponentList::const_iterator lsst::meas::modelfit::Mixture::const_iterator

Definition at line 135 of file Mixture.h.

◆ iterator

typedef ComponentList::iterator lsst::meas::modelfit::Mixture::iterator

Definition at line 134 of file Mixture.h.

◆ OutputArchiveHandle

using lsst::afw::table::io::Persistable::OutputArchiveHandle = io::OutputArchiveHandle
protectedinherited

Definition at line 108 of file Persistable.h.

◆ UpdateRestriction

Definition at line 132 of file Mixture.h.

Constructor & Destructor Documentation

◆ Mixture()

lsst::meas::modelfit::Mixture::Mixture ( int  dim,
ComponentList components,
Scalar  df = std::numeric_limitsScalar >::infinity() 
)
explicit

Construct a mixture model.

Parameters
[in]dimDimensionality of the distribution
[in]dfNumber of degrees of freedom for component Student's T distributions (inf=Gaussian)
[in]componentsList of components; will be emptied on return.

The components will be automatically normalized after construction.

Member Function Documentation

◆ begin() [1/2]

iterator lsst::meas::modelfit::Mixture::begin ( )
inline

Iterator and indexed access to components.

While mutable iterators and accessors are provided, any modifications to the component weights should be followed by a call to normalize(), as other member functions will not work properly if the mixture is not normalized.

Definition at line 146 of file Mixture.h.

146 { return _components.begin(); }
T begin(T... args)

◆ begin() [2/2]

const_iterator lsst::meas::modelfit::Mixture::begin ( ) const
inline

Definition at line 149 of file Mixture.h.

149 { return _components.begin(); }

◆ clip()

std::size_t lsst::meas::modelfit::Mixture::clip ( Scalar  threshold = 0.0)

Iterate over all components, removing those with weight less than or equal to threshold.

The weights will be normalized if any are removed.

Returns
the number of components removed.

◆ clone()

virtual std::shared_ptr<Mixture> lsst::meas::modelfit::Mixture::clone ( ) const
virtual

Polymorphic deep copy.

◆ draw()

void lsst::meas::modelfit::Mixture::draw ( afw::math::Random rng,
ndarray::Array< Scalar, 2, 1 > const &  x 
) const

Draw random variates from the distribution.

Parameters
[in,out]rngrandom number generator
[out]xarray of points, shape=(numSamples, dim)

◆ dynamicCast()

Dynamically cast a shared_ptr.

Dynamically cast a shared pointer and raise on failure.

You must provide an explicit template instantiation in the .cc file for each class that inherits from PersistableFacade. Designed to work around RTTI issues on macOS with hidden symbols;

Exceptions
lsst::pex::exceptions::LogicErrorif the cast fails

param[in] ptr The pointer to be cast.

Returns
The cast pointer.
Exceptions
lsst::pex::exceptions::TypeErrorIf the dynamic cast fails.

Definition at line 218 of file Persistable.cc.

18  {
19  auto result = std::dynamic_pointer_cast<T>(ptr);
20  if (!result) {
21  throw LSST_EXCEPT(pex::exceptions::TypeError, "Dynamic pointer cast failed");
22  }
23  return result;
24 }
py::object result
Definition: _schema.cc:429
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48
uint64_t * ptr
Definition: RangeSet.cc:88

◆ end() [1/2]

iterator lsst::meas::modelfit::Mixture::end ( )
inline

Definition at line 147 of file Mixture.h.

147 { return _components.end(); }
T end(T... args)

◆ end() [2/2]

const_iterator lsst::meas::modelfit::Mixture::end ( ) const
inline

Definition at line 150 of file Mixture.h.

150 { return _components.end(); }

◆ evaluate() [1/3]

template<typename Derived >
Scalar lsst::meas::modelfit::Mixture::evaluate ( Component const &  component,
Eigen::MatrixBase< Derived > const &  x 
) const
inline

Evaluate the probability density at the given point for the given component distribution.

This evaluates the probability of a single component, including the current weight of that component.

Definition at line 198 of file Mixture.h.

198  {
199  Scalar z = _computeZ(component, x);
200  return component.weight * _evaluate(z) / component._sqrtDet;
201  }
double x
double z
Definition: Match.cc:44
double Scalar
Typedefs to be used for probability and parameter values.
Definition: common.h:44

◆ evaluate() [2/3]

template<typename Derived >
Scalar lsst::meas::modelfit::Mixture::evaluate ( Eigen::MatrixBase< Derived > const &  x) const
inline

Evaluate the mixture distribution probability density function (PDF) at the given points.

Parameters
[in]xpoint to evaluate, as an Eigen expression, shape=(dim,)

Definition at line 209 of file Mixture.h.

209  {
210  Scalar p = 0.0;
211  for (const_iterator i = begin(); i != end(); ++i) {
212  p += evaluate(*i, x);
213  }
214  return p;
215  }
Scalar evaluate(Component const &component, Eigen::MatrixBase< Derived > const &x) const
Evaluate the probability density at the given point for the given component distribution.
Definition: Mixture.h:198
ComponentList::const_iterator const_iterator
Definition: Mixture.h:135
iterator begin()
Iterator and indexed access to components.
Definition: Mixture.h:146

◆ evaluate() [3/3]

void lsst::meas::modelfit::Mixture::evaluate ( ndarray::Array< Scalar const, 2, 1 > const &  x,
ndarray::Array< Scalar, 1, 0 > const &  p 
) const

Evaluate the distribution probability density function (PDF) at the given points.

Parameters
[in]xarray of points, shape=(numSamples, dim)
[out]parray of probability values, shape=(numSamples,)

◆ evaluateComponents()

void lsst::meas::modelfit::Mixture::evaluateComponents ( ndarray::Array< Scalar const, 2, 1 > const &  x,
ndarray::Array< Scalar, 2, 1 > const &  p 
) const

Evaluate the contributions of each component to the full probability at the given points.

Parameters
[in]xpoints to evaluate at, with number of columns equal to the number of dimensions
[in]parray to fill, with number of columns equal to the number of components

◆ evaluateDerivatives() [1/3]

void lsst::meas::modelfit::Mixture::evaluateDerivatives ( Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > &  x,
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > &  gradient 
) const

Evaluate the derivative of the distribution at the given point.

Parameters
[in]xpoint to evaluate the derivative, with size equal to the number of dimensions
[in]gradient1st derivative array to fill

◆ evaluateDerivatives() [2/3]

void lsst::meas::modelfit::Mixture::evaluateDerivatives ( Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > &  x,
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > &  gradient,
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > &  hessian 
) const

Evaluate the derivative of the distribution at the given point.

Parameters
[in]xpoint to evaluate the derivative, with size equal to the number of dimensions
[in]gradient1st derivative array to fill
[in]hessian2nd derivative array to fill

◆ evaluateDerivatives() [3/3]

void lsst::meas::modelfit::Mixture::evaluateDerivatives ( ndarray::Array< Scalar const, 1, 1 > const &  x,
ndarray::Array< Scalar, 1, 1 > const &  gradient,
ndarray::Array< Scalar, 2, 1 > const &  hessian 
) const

Evaluate the derivative of the distribution at the given point.

Parameters
[in]xpoint to evaluate the derivative, with size equal to the number of dimensions
[in]gradient1st derivative array to fill
[in]hessian2nd derivative array to fill

◆ getComponentCount()

virtual int lsst::meas::modelfit::Mixture::getComponentCount ( ) const
inlinevirtual

Return the number of components.

Definition at line 160 of file Mixture.h.

160 { return size(); }
std::size_t size() const
Return the number of components.
Definition: Mixture.h:157

◆ getDegreesOfFreedom()

Scalar lsst::meas::modelfit::Mixture::getDegreesOfFreedom ( ) const
inline

Get the number of degrees of freedom in the component Student's T distributions (inf=Gaussian)

Definition at line 187 of file Mixture.h.

187 { return _df; }

◆ getDimension()

int lsst::meas::modelfit::Mixture::getDimension ( ) const
inline

Return the number of dimensions.

Definition at line 169 of file Mixture.h.

169 { return _dim; }

◆ getPersistenceName()

std::string lsst::meas::modelfit::Mixture::getPersistenceName ( ) const
overrideprotectedvirtual

Return the unique name used to persist this object and look up its factory.

Must be less than ArchiveIndexSchema::MAX_NAME_LENGTH characters.

Reimplemented from lsst::afw::table::io::Persistable.

◆ getPythonModule()

std::string lsst::meas::modelfit::Mixture::getPythonModule ( ) const
inlineoverrideprotectedvirtual

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 from lsst::afw::table::io::Persistable.

Definition at line 368 of file Mixture.h.

368 { return "lsst.meas.modelfit"; }

◆ isPersistable()

virtual bool lsst::meas::modelfit::Mixture::isPersistable ( ) const
inlineoverridevirtualnoexcept

Return true if this particular object can be persisted using afw::table::io.

Reimplemented from lsst::afw::table::io::Persistable.

Definition at line 364 of file Mixture.h.

364 { return true; }

◆ normalize()

void lsst::meas::modelfit::Mixture::normalize ( )

Iterate over all components, rescaling their weights so they sum to one.

◆ operator[]() [1/2]

Component& lsst::meas::modelfit::Mixture::operator[] ( std::size_t  i)
inline

Definition at line 152 of file Mixture.h.

152 { return _components[i]; }

◆ operator[]() [2/2]

Component const& lsst::meas::modelfit::Mixture::operator[] ( std::size_t  i) const
inline

Definition at line 153 of file Mixture.h.

153 { return _components[i]; }

◆ project() [1/2]

std::shared_ptr<Mixture> lsst::meas::modelfit::Mixture::project ( int  dim) const

Project the distribution onto the given dimensions (marginalize over all others)

◆ project() [2/2]

std::shared_ptr<Mixture> lsst::meas::modelfit::Mixture::project ( int  dim1,
int  dim2 
) const

Project the distribution onto the given dimensions (marginalize over all others)

◆ readFits() [1/3]

static std::shared_ptr<Mixture > lsst::afw::table::io::PersistableFacade< Mixture >::readFits ( fits::Fits fitsfile)
inlinestaticinherited

Read an object from an already open FITS object.

Parameters
[in]fitsfileFITS object to read from, already positioned at the desired HDU.

Definition at line 183 of file Persistable.h.

183  {
184  return dynamicCast(Persistable::_readFits(fitsfile));
185  }
static std::shared_ptr< Mixture > dynamicCast(std::shared_ptr< Persistable > const &ptr)
Dynamically cast a shared_ptr.
Definition: Persistable.cc:18

◆ readFits() [2/3]

static std::shared_ptr<Mixture > lsst::afw::table::io::PersistableFacade< Mixture >::readFits ( fits::MemFileManager manager,
int  hdu = fits::DEFAULT_HDU 
)
inlinestaticinherited

Read an object from a FITS file in memory.

Parameters
[in]managerManager for the memory to read from.
[in]hduHDU to read, where 0 is the primary. The special value of afw::fits::DEFAULT_HDU skips the primary HDU if it is empty.

Definition at line 205 of file Persistable.h.

205  {
206  return dynamicCast(Persistable::_readFits(manager, hdu));
207  }

◆ readFits() [3/3]

static std::shared_ptr<Mixture > lsst::afw::table::io::PersistableFacade< Mixture >::readFits ( std::string const &  fileName,
int  hdu = fits::DEFAULT_HDU 
)
inlinestaticinherited

Read an object from a regular FITS file.

Parameters
[in]fileNameName of the file to read.
[in]hduHDU to read, where 0 is the primary. The special value of afw::fits::DEFAULT_HDU skips the primary HDU if it is empty.

Definition at line 194 of file Persistable.h.

194  {
195  return dynamicCast(Persistable::_readFits(fileName, hdu));
196  }

◆ setDegreesOfFreedom()

void lsst::meas::modelfit::Mixture::setDegreesOfFreedom ( Scalar  df = std::numeric_limitsScalar >::infinity())

Set the number of degrees of freedom in the component Student's T distributions (inf=Gaussian)

◆ shift()

void lsst::meas::modelfit::Mixture::shift ( int  dim,
Scalar  offset 
)

Shift the mixture in the given dimension, adding the given offset to all mu vectors.

◆ size()

std::size_t lsst::meas::modelfit::Mixture::size ( ) const
inline

Return the number of components.

Definition at line 157 of file Mixture.h.

157 { return _components.size(); }
T size(T... args)

◆ updateEM() [1/3]

void lsst::meas::modelfit::Mixture::updateEM ( ndarray::Array< Scalar const, 2, 1 > const &  x,
ndarray::Array< Scalar const, 1, 0 > const &  w,
Scalar  tau1 = 0.0,
Scalar  tau2 = 0.5 
)

Perform an Expectation-Maximization step, updating the component parameters to match the given weighted samples.

Parameters
[in]xarray of variables, shape=(numSamples, dim)
[in]warray of weights, shape=(numSamples,)
[in]tau1damping parameter (see below)
[in]tau2damping parameter (see below)

The updates to the \(\sigma\) matrices are damped according to:

\[ \sigma_d = \alpha\sigma_1 + (1-\alpha)\sigma_0 \]

Where \(\sigma_0\) is the previous matrix, \(\sigma_1\) is the undamped update, and \(\sigma_d\) is the damped update. The parameter \(\alpha\) is set by the ratio of the determinants:

\[ r \equiv \frac{|\sigma_1|}{|\sigma_0|} \]

When \(r \ge \tau_1\), \(\alpha=1\); when \(r \lt \tau_1\), it is rolled off quadratically to \(\tau_2\).

◆ updateEM() [2/3]

void lsst::meas::modelfit::Mixture::updateEM ( ndarray::Array< Scalar const, 2, 1 > const &  x,
ndarray::Array< Scalar const, 1, 0 > const &  w,
UpdateRestriction const &  restriction,
Scalar  tau1 = 0.0,
Scalar  tau2 = 0.5 
)

Perform an Expectation-Maximization step, updating the component parameters to match the given weighted samples.

Parameters
[in]xarray of variables, shape=(numSamples, dim)
[in]warray of weights, shape=(numSamples,)
[in]restrictionFunctor used to restrict the form of the updated mu and sigma
[in]tau1damping parameter (see Mixture::updateEM)
[in]tau2damping parameter (see Mixture::updateEM)

◆ updateEM() [3/3]

void lsst::meas::modelfit::Mixture::updateEM ( ndarray::Array< Scalar const, 2, 1 > const &  x,
UpdateRestriction const &  restriction,
Scalar  tau1 = 0.0,
Scalar  tau2 = 0.5 
)

Perform an Expectation-Maximization step, updating the component parameters to match the given unweighted samples.

Parameters
[in]xarray of variables, shape=(numSamples, dim)
[in]restrictionFunctor used to restrict the form of the updated mu and sigma
[in]tau1damping parameter (see Mixture::updateEM)
[in]tau2damping parameter (see Mixture::updateEM)

◆ write()

void lsst::meas::modelfit::Mixture::write ( OutputArchiveHandle handle) const
overrideprotectedvirtual

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 from lsst::afw::table::io::Persistable.

◆ writeFits() [1/3]

void lsst::afw::table::io::Persistable::writeFits ( fits::Fits fitsfile) const
inherited

Write the object to an already-open FITS object.

Parameters
[in]fitsfileOpen FITS object to write to.

Definition at line 18 of file Persistable.cc.

18  {
19  OutputArchive archive;
20  archive.put(this);
21  archive.writeFits(fitsfile);
22 }

◆ writeFits() [2/3]

void lsst::afw::table::io::Persistable::writeFits ( fits::MemFileManager manager,
std::string const &  mode = "w" 
) const
inherited

Write the object to a FITS image in memory.

Parameters
[in]managerName of the file to write to.
[in]modeIf "w", any existing file with the given name will be overwritten. If "a", new HDUs will be appended to an existing file.

Definition at line 29 of file Persistable.cc.

29  {
30  fits::Fits fitsfile(manager, mode, fits::Fits::AUTO_CLOSE | fits::Fits::AUTO_CHECK);
31  writeFits(fitsfile);
32 }
void writeFits(std::string const &fileName, std::string const &mode="w") const
Write the object to a regular FITS file.
Definition: Persistable.cc:24

◆ writeFits() [3/3]

void lsst::afw::table::io::Persistable::writeFits ( std::string const &  fileName,
std::string const &  mode = "w" 
) const
inherited

Write the object to a regular FITS file.

Parameters
[in]fileNameName of the file to write to.
[in]modeIf "w", any existing file with the given name will be overwritten. If "a", new HDUs will be appended to an existing file.

Definition at line 24 of file Persistable.cc.

24  {
25  fits::Fits fitsfile(fileName, mode, fits::Fits::AUTO_CLOSE | fits::Fits::AUTO_CHECK);
26  writeFits(fitsfile);
27 }

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream os,
Mixture const &  self 
)
friend

Definition at line 359 of file Mixture.h.

359  {
360  self._stream(os);
361  return os;
362  }
std::ostream * os
Definition: Schema.cc:557

The documentation for this class was generated from the following file: