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
Classes | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
lsst::meas::algorithms::CoaddPsf Class Reference

CoaddPsf is the Psf derived to be used for non-PSF-matched Coadd images. More...

#include <CoaddPsf.h>

Inheritance diagram for lsst::meas::algorithms::CoaddPsf:
lsst::afw::table::io::PersistableFacade< CoaddPsf > lsst::meas::algorithms::ImagePsf lsst::afw::table::io::PersistableFacade< ImagePsf > lsst::afw::detection::Psf lsst::daf::base::Citizen lsst::daf::base::Persistable lsst::afw::table::io::PersistableFacade< Psf > lsst::afw::table::io::Persistable

Classes

class  Factory
 

Public Member Functions

 CoaddPsf (afw::table::ExposureCatalog const &catalog, afw::image::Wcs const &coaddWcs, std::string const &weightFieldName="weight", std::string const &warpingKernelName="lanczos3", int cacheSize=10000)
 Main constructors for CoaddPsf. More...
 
virtual boost::shared_ptr
< afw::detection::Psf
clone () const
 Polymorphic deep copy. Usually unnecessary, as Psfs are immutable. More...
 
virtual afw::geom::Point2D getAveragePosition () const
 Return the average of the positions of the stars that went into this Psf. More...
 
boost::shared_ptr
< afw::image::Wcs const > 
getCoaddWcs ()
 Return the Wcs of the coadd (defines the coordinate system of the Psf). More...
 
int getComponentCount () const
 Return the number of component Psfs in this CoaddPsf. More...
 
boost::shared_ptr
< afw::detection::Psf const > 
getPsf (int index)
 
boost::shared_ptr
< afw::image::Wcs const > 
getWcs (int index)
 
double getWeight (int index)
 
afw::table::RecordId getId (int index)
 
afw::geom::Box2I getBBox (int index)
 
boost::shared_ptr
< afw::geom::polygon::Polygon
const > 
getValidPolygon (int index)
 
virtual bool isPersistable () const
 Return true if the CoaddPsf persistable (always true). More...
 
- Public Member Functions inherited from lsst::afw::detection::Psf
virtual ~Psf ()
 
boost::shared_ptr< ImagecomputeImage (geom::Point2D position=makeNullPoint(), image::Color color=image::Color(), ImageOwnerEnum owner=COPY) const
 Return an Image of the PSF, in a form that can be compared directly with star images. More...
 
boost::shared_ptr< ImagecomputeKernelImage (geom::Point2D position=makeNullPoint(), image::Color color=image::Color(), ImageOwnerEnum owner=COPY) const
 Return an Image of the PSF, in a form suitable for convolution. More...
 
double computePeak (geom::Point2D position=makeNullPoint(), image::Color color=image::Color()) const
 Return the peak value of the PSF image. More...
 
double computeApertureFlux (double radius, geom::Point2D position=makeNullPoint(), image::Color color=image::Color()) const
 Compute the "flux" of the Psf model within a circular aperture of the given radius. More...
 
geom::ellipses::Quadrupole computeShape (geom::Point2D position=makeNullPoint(), image::Color color=image::Color()) const
 Compute the ellipse corresponding to the second moments of the Psf. More...
 
boost::shared_ptr
< math::Kernel const > 
getLocalKernel (geom::Point2D position=makeNullPoint(), image::Color color=image::Color()) const
 Return a FixedKernel corresponding to the Psf image at the given point. More...
 
image::Color getAverageColor () const
 Return the average Color of the stars used to construct the Psf. More...
 
- Public Member Functions inherited from lsst::daf::base::Citizen
 Citizen (const std::type_info &)
 
 Citizen (Citizen const &)
 
 ~Citizen ()
 
Citizenoperator= (Citizen const &)
 
std::string repr () const
 Return a string representation of a Citizen. More...
 
void markPersistent (void)
 Mark a Citizen as persistent and not destroyed until process end. More...
 
memId getId () const
 Return the Citizen's ID. More...
 
- Public Member Functions inherited from lsst::daf::base::Persistable
 Persistable (void)
 
virtual ~Persistable (void)
 
template<class Archive >
void serialize (Archive &, unsigned int const)
 
- Public Member Functions inherited from lsst::afw::table::io::Persistable
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 ~Persistable ()
 

Protected Member Functions

boost::shared_ptr
< afw::detection::Psf::Image
doComputeKernelImage (afw::geom::Point2D const &ccdXY, afw::image::Color const &color) const
 
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...
 
 CoaddPsf (afw::table::ExposureCatalog const &catalog, boost::shared_ptr< afw::image::Wcs const > coaddWcs, afw::geom::Point2D const &averagePosition, std::string const &warpingKernelName="lanczos3", int cacheSize=10000)
 
- Protected Member Functions inherited from lsst::meas::algorithms::ImagePsf
 ImagePsf (bool isFixed=false)
 
virtual double doComputeApertureFlux (double radius, afw::geom::Point2D const &position, afw::image::Color const &color) const
 
virtual
afw::geom::ellipses::Quadrupole 
doComputeShape (afw::geom::Point2D const &position, afw::image::Color const &color) const
 
- Protected Member Functions inherited from lsst::afw::detection::Psf
 Psf (bool isFixed=false)
 
- Protected Member Functions inherited from lsst::afw::table::io::Persistable
 Persistable ()
 
 Persistable (Persistable const &other)
 
void operator= (Persistable const &other)
 

Private Attributes

afw::table::ExposureCatalog _catalog
 
boost::shared_ptr
< afw::image::Wcs const > 
_coaddWcs
 
afw::table::Key< double > _weightKey
 
afw::geom::Point2D _averagePosition
 
std::string _warpingKernelName
 
boost::shared_ptr
< afw::math::WarpingControl
const > 
_warpingControl
 

Additional Inherited Members

- Public Types inherited from lsst::afw::detection::Psf
enum  ImageOwnerEnum { COPY =0, INTERNAL =1 }
 Enum passed to computeImage and computeKernelImage to determine image ownership. More...
 
typedef boost::shared_ptr< PsfPtr
 
typedef boost::shared_ptr
< const Psf
ConstPtr
 
typedef math::Kernel::Pixel Pixel
 Pixel type of Image returned by computeImage. More...
 
typedef image::Image< PixelImage
 Image type returned by computeImage. More...
 
- Public Types inherited from lsst::daf::base::Citizen
enum  { magicSentinel = 0xdeadbeef }
 
typedef unsigned long memId
 Type of the block's ID. More...
 
typedef memId(* memNewCallback )(const memId cid)
 A function used to register a callback. More...
 
typedef memId(* memCallback )(const Citizen *ptr)
 
- Public Types inherited from lsst::daf::base::Persistable
typedef boost::shared_ptr
< Persistable
Ptr
 
- Static Public Member Functions inherited from lsst::afw::table::io::PersistableFacade< CoaddPsf >
static boost::shared_ptr
< CoaddPsf > 
readFits (fits::Fits &fitsfile)
 Read an object from an already open FITS object. More...
 
static boost::shared_ptr
< CoaddPsf > 
readFits (std::string const &fileName, int hdu=0)
 Read an object from a regular FITS file. More...
 
static boost::shared_ptr
< CoaddPsf > 
readFits (fits::MemFileManager &manager, int hdu=0)
 Read an object from a FITS file in memory. More...
 
- Static Public Member Functions inherited from lsst::afw::table::io::PersistableFacade< ImagePsf >
static boost::shared_ptr
< ImagePsf > 
readFits (fits::Fits &fitsfile)
 Read an object from an already open FITS object. More...
 
static boost::shared_ptr
< ImagePsf > 
readFits (std::string const &fileName, int hdu=0)
 Read an object from a regular FITS file. More...
 
static boost::shared_ptr
< ImagePsf > 
readFits (fits::MemFileManager &manager, int hdu=0)
 Read an object from a FITS file in memory. More...
 
- Static Public Member Functions inherited from lsst::afw::detection::Psf
static boost::shared_ptr< ImagerecenterKernelImage (boost::shared_ptr< Image > im, geom::Point2D const &position, std::string const &warpAlgorithm="lanczos5", unsigned int warpBuffer=5)
 
- Static Public Member Functions inherited from lsst::daf::base::Citizen
static bool hasBeenCorrupted ()
 Check all allocated blocks for corruption. More...
 
static memId getNextMemId ()
 Return the memId of the next object to be allocated. More...
 
static int init ()
 Called once when the memory system is being initialised. More...
 
static int census (int, memId startingMemId=0)
 How many active Citizens are there? More...
 
static void census (std::ostream &stream, memId startingMemId=0)
 Print a list of all active Citizens to stream, sorted by ID. More...
 
static const std::vector
< const Citizen * > * 
census ()
 Return a (newly allocated) std::vector of active Citizens sorted by ID. More...
 
static memId setNewCallbackId (memId id)
 Call the NewCallback when block is allocated. More...
 
static memId setDeleteCallbackId (memId id)
 Call the current DeleteCallback when block is deleted. More...
 
static memNewCallback setNewCallback (memNewCallback func)
 Set the NewCallback function. More...
 
static memCallback setDeleteCallback (memCallback func)
 Set the DeleteCallback function. More...
 
static memCallback setCorruptionCallback (memCallback func)
 Set the CorruptionCallback function. More...
 
- Static Public Member Functions inherited from lsst::afw::table::io::PersistableFacade< Psf >
static boost::shared_ptr< Psf > readFits (fits::Fits &fitsfile)
 Read an object from an already open FITS object. More...
 
static boost::shared_ptr< Psf > readFits (std::string const &fileName, int hdu=0)
 Read an object from a regular FITS file. More...
 
static boost::shared_ptr< Psf > readFits (fits::MemFileManager &manager, int hdu=0)
 Read an object from a FITS file in memory. More...
 
- Protected Types inherited from lsst::afw::table::io::Persistable
typedef io::OutputArchiveHandle OutputArchiveHandle
 

Detailed Description

CoaddPsf is the Psf derived to be used for non-PSF-matched Coadd images.

It incorporates the logic of James Jee's Stackfit algorithm for estimating the Psf of coadd by coadding the images of the Psf models of each input exposure.

Definition at line 45 of file CoaddPsf.h.

Constructor & Destructor Documentation

lsst::meas::algorithms::CoaddPsf::CoaddPsf ( afw::table::ExposureCatalog const &  catalog,
afw::image::Wcs const &  coaddWcs,
std::string const &  weightFieldName = "weight",
std::string const &  warpingKernelName = "lanczos3",
int  cacheSize = 10000 
)
explicit

Main constructors for CoaddPsf.

The ExposureCatalog contains info about each visit/ccd in Coadd; this must be provided to the constructor, and cannot be changed.

Parameters
[in]catalogExposureCatalog containing the id, bbox, wcs, psf and weight for each ccd/visit. This is usually the same catalog as the "ccds" catalog in the coadd Exposure's CoaddInputs.
[in]coaddWcsWcs for the coadd.
[in]weightFieldNameField name that contains the weight of the exposure in the coadd; defaults to "weight".
[in]warpingKernelNameName of warping kernel
[in]cacheSizeWarping kernel cache size

Definition at line 142 of file CoaddPsf.cc.

148  :
149  _coaddWcs(coaddWcs.clone()),
151  _warpingControl(boost::make_shared<afw::math::WarpingControl>(warpingKernelName, "", cacheSize))
152 {
153  afw::table::SchemaMapper mapper(catalog.getSchema());
154  mapper.addMinimalSchema(afw::table::ExposureTable::makeMinimalSchema(), true);
155 
156  // copy the field "goodpix", if available, for computeAveragePosition to use
157  try {
158  afw::table::Key<int> goodPixKey = catalog.getSchema()["goodpix"]; // auto does not work
159  mapper.addMapping(goodPixKey, true);
160  } catch (pex::exceptions::NotFoundError &) {}
161 
162  // copy the field specified by weightFieldName to field "weight"
163  afw::table::Field<double> weightField = afw::table::Field<double>("weight", "Coadd weight");
164  afw::table::Key<double> weightKey = catalog.getSchema()[weightFieldName];
165  _weightKey = mapper.addMapping(weightKey, weightField);
166 
167  _catalog = afw::table::ExposureCatalog(mapper.getOutputSchema());
168  for (afw::table::ExposureCatalog::const_iterator i = catalog.begin(); i != catalog.end(); ++i) {
169  PTR(afw::table::ExposureRecord) record = _catalog.getTable()->makeRecord();
170  record->assign(*i, mapper);
171  _catalog.push_back(record);
172  }
173  _averagePosition = computeAveragePosition(_catalog, *_coaddWcs, _weightKey);
174 }
afw::geom::Point2D _averagePosition
Definition: CoaddPsf.h:186
static Schema makeMinimalSchema()
Return a minimal schema for Exposure tables and records.
Definition: Exposure.h:164
#define PTR(...)
Definition: base.h:41
boost::shared_ptr< afw::image::Wcs const > _coaddWcs
Definition: CoaddPsf.h:184
afw::table::Key< double > _weightKey
Definition: CoaddPsf.h:185
tbl::Key< int > cacheSize
Definition: CoaddPsf.cc:327
afw::table::ExposureCatalog _catalog
Definition: CoaddPsf.h:183
boost::shared_ptr< afw::math::WarpingControl const > _warpingControl
Definition: CoaddPsf.h:188
tbl::Key< std::string > warpingKernelName
Definition: CoaddPsf.cc:329
Base::const_iterator const_iterator
Definition: Exposure.h:259
ExposureCatalogT< ExposureRecord > ExposureCatalog
Definition: Exposure.h:415
tbl::Key< int > coaddWcs
lsst::meas::algorithms::CoaddPsf::CoaddPsf ( afw::table::ExposureCatalog const &  catalog,
boost::shared_ptr< afw::image::Wcs const >  coaddWcs,
afw::geom::Point2D const &  averagePosition,
std::string const &  warpingKernelName = "lanczos3",
int  cacheSize = 10000 
)
explicitprotected
Parameters
catalogUnpersisted catalog
coaddWcsWCS for the coadd
averagePositionDefault position for accessors
warpingKernelNameWarping kernel name
cacheSizeKernel cache size

Definition at line 400 of file CoaddPsf.cc.

406  :
407  _catalog(catalog), _coaddWcs(coaddWcs), _weightKey(_catalog.getSchema()["weight"]),
409  _warpingControl(new afw::math::WarpingControl(warpingKernelName, "", cacheSize))
410 {}
afw::geom::Point2D _averagePosition
Definition: CoaddPsf.h:186
boost::shared_ptr< afw::image::Wcs const > _coaddWcs
Definition: CoaddPsf.h:184
afw::table::Key< double > _weightKey
Definition: CoaddPsf.h:185
tbl::Key< int > cacheSize
Definition: CoaddPsf.cc:327
afw::table::ExposureCatalog _catalog
Definition: CoaddPsf.h:183
boost::shared_ptr< afw::math::WarpingControl const > _warpingControl
Definition: CoaddPsf.h:188
tbl::Key< std::string > warpingKernelName
Definition: CoaddPsf.cc:329
tbl::PointKey< double > averagePosition
Definition: CoaddPsf.cc:328
Schema getSchema() const
Return the schema associated with the catalog&#39;s table.
Definition: Catalog.h:114
tbl::Key< int > coaddWcs

Member Function Documentation

boost::shared_ptr< afw::detection::Psf > lsst::meas::algorithms::CoaddPsf::clone ( void  ) const
virtual

Polymorphic deep copy. Usually unnecessary, as Psfs are immutable.

Implements lsst::afw::detection::Psf.

Definition at line 176 of file CoaddPsf.cc.

176  {
177  return boost::make_shared<CoaddPsf>(*this);
178 }
boost::shared_ptr< afw::detection::Psf::Image > lsst::meas::algorithms::CoaddPsf::doComputeKernelImage ( afw::geom::Point2D const &  position,
afw::image::Color const &  color 
) const
protectedvirtual

These virtual member functions are private, not protected, because we only want derived classes to implement them, not call them; they should call the corresponding compute*Image member functions instead so as to let the Psf base class handle caching properly.

Derived classes are responsible for ensuring that returned images sum to one.

Implements lsst::afw::detection::Psf.

Definition at line 224 of file CoaddPsf.cc.

227  {
228  // Get the subset of expoures which contain our coordinate within their validPolygons.
230  if (subcat.empty()) {
231  throw LSST_EXCEPT(
232  pex::exceptions::InvalidParameterError,
233  (boost::format("Cannot compute CoaddPsf at point %s; no input images at that point.")
234  % ccdXY).str()
235  );
236  }
237  double weightSum = 0.0;
238 
239  // Read all the Psf images into a vector. The code is set up so that this can be done in chunks,
240  // with the image modified to accomodate
241  // However, we currently read all of the images.
242  std::vector<PTR(afw::image::Image<double>)> imgVector;
243  std::vector<double> weightVector;
244 
245  for (afw::table::ExposureCatalog::const_iterator i = subcat.begin(); i != subcat.end(); ++i) {
246  PTR(afw::geom::XYTransform) xytransform(
248  );
249  WarpedPsf warpedPsf = WarpedPsf(i->getPsf(), xytransform, _warpingControl);
250  PTR(afw::image::Image<double>) componentImg = warpedPsf.computeKernelImage(ccdXY, color);
251  imgVector.push_back(componentImg);
252  weightSum += i->get(_weightKey);
253  weightVector.push_back(i->get(_weightKey));
254  }
255 
256  afw::geom::Box2I bbox = getOverallBBox(imgVector);
257 
258  // create a zero image of the right size to sum into
259  PTR(afw::detection::Psf::Image) image = boost::make_shared<afw::detection::Psf::Image>(bbox);
260  *image = 0.0;
261  addToImage(image, imgVector, weightVector);
262  *image /= weightSum;
263  return image;
264 }
afw::geom::Box2I getOverallBBox(std::vector< boost::shared_ptr< afw::image::Image< double > >> const &imgVector)
Definition: CoaddPsf.cc:183
boost::shared_ptr< Image > computeKernelImage(geom::Point2D position=makeNullPoint(), image::Color color=image::Color(), ImageOwnerEnum owner=COPY) const
Return an Image of the PSF, in a form suitable for convolution.
XYTransformFromWcsPair: An XYTransform obtained by putting two Wcs objects &quot;back to back&quot;...
Definition: Wcs.h:432
#define PTR(...)
Definition: base.h:41
boost::shared_ptr< afw::image::Wcs const > getWcs(int index)
Definition: CoaddPsf.cc:277
boost::shared_ptr< afw::image::Wcs const > _coaddWcs
Definition: CoaddPsf.h:184
afw::table::Key< double > _weightKey
Definition: CoaddPsf.h:185
Psf(bool isFixed=false)
table::Key< table::Array< Kernel::Pixel > > image
Definition: FixedKernel.cc:117
afw::table::ExposureCatalog _catalog
Definition: CoaddPsf.h:183
ExposureCatalogT subsetContaining(Coord const &coord, bool includeValidPolygon=false) const
Return a shallow subset of the catalog with only those records that contain the given point...
boost::shared_ptr< afw::math::WarpingControl const > _warpingControl
Definition: CoaddPsf.h:188
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
Base::const_iterator const_iterator
Definition: Exposure.h:259
void addToImage(boost::shared_ptr< afw::image::Image< double > > image, std::vector< boost::shared_ptr< afw::image::Image< double > >> const &imgVector, std::vector< double > const &weightVector)
Definition: CoaddPsf.cc:198
ExposureCatalogT< ExposureRecord > ExposureCatalog
Definition: Exposure.h:415
image::Image< Pixel > Image
Image type returned by computeImage.
Definition: Psf.h:79
boost::shared_ptr< afw::detection::Psf const > getPsf(int index)
Definition: CoaddPsf.cc:270
virtual afw::geom::Point2D lsst::meas::algorithms::CoaddPsf::getAveragePosition ( ) const
inlinevirtual

Return the average of the positions of the stars that went into this Psf.

For CoaddPsf, this is calculated as the weighted average of the average positions of all the component Psfs.

Reimplemented from lsst::afw::detection::Psf.

Definition at line 80 of file CoaddPsf.h.

80 { return _averagePosition; }
afw::geom::Point2D _averagePosition
Definition: CoaddPsf.h:186
afw::geom::Box2I lsst::meas::algorithms::CoaddPsf::getBBox ( int  index)

Get the bounding box (in component image Pixel coordinates) of the component image at index.

Parameters
[in]indexIndex of component for which the bounding box will be fetched.
Returns
Corresponding bounding box.
Exceptions
RangeErrorIndex of component is out of range.

Definition at line 305 of file CoaddPsf.cc.

305  {
306  if (index < 0 || index > getComponentCount()) {
307  throw LSST_EXCEPT(pex::exceptions::RangeError, "index of CoaddPsf component out of range");
308  }
309  return _catalog[index].getBBox();
310 }
afw::table::ExposureCatalog _catalog
Definition: CoaddPsf.h:183
int getComponentCount() const
Return the number of component Psfs in this CoaddPsf.
Definition: CoaddPsf.cc:266
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
boost::shared_ptr< afw::image::Wcs const > lsst::meas::algorithms::CoaddPsf::getCoaddWcs ( )
inline

Return the Wcs of the coadd (defines the coordinate system of the Psf).

Definition at line 83 of file CoaddPsf.h.

83 { return _coaddWcs; }
boost::shared_ptr< afw::image::Wcs const > _coaddWcs
Definition: CoaddPsf.h:184
int lsst::meas::algorithms::CoaddPsf::getComponentCount ( ) const

Return the number of component Psfs in this CoaddPsf.

Definition at line 266 of file CoaddPsf.cc.

266  {
267  return _catalog.size();
268 }
size_type size() const
Return the number of elements in the catalog.
Definition: Catalog.h:401
afw::table::ExposureCatalog _catalog
Definition: CoaddPsf.h:183
afw::table::RecordId lsst::meas::algorithms::CoaddPsf::getId ( int  index)

Get the exposure ID of the component image at index.

Parameters
[in]indexIndex of component for which the exposure ID will be fetched.
Returns
Corresponding exposure ID.
Exceptions
RangeErrorIndex of component is out of range.

Definition at line 298 of file CoaddPsf.cc.

298  {
299  if (index < 0 || index > getComponentCount()) {
300  throw LSST_EXCEPT(pex::exceptions::RangeError, "index of CoaddPsf component out of range");
301  }
302  return _catalog[index].getId();
303 }
afw::table::ExposureCatalog _catalog
Definition: CoaddPsf.h:183
int getComponentCount() const
Return the number of component Psfs in this CoaddPsf.
Definition: CoaddPsf.cc:266
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
std::string lsst::meas::algorithms::CoaddPsf::getPersistenceName ( ) const
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 from lsst::afw::table::io::Persistable.

Definition at line 384 of file CoaddPsf.cc.

384 { return getCoaddPsfPersistenceName(); }
boost::shared_ptr< afw::detection::Psf const > lsst::meas::algorithms::CoaddPsf::getPsf ( int  index)

Get the Psf of the component image at index.

Parameters
[in]indexIndex of component for which the Psf will be fetched.
Returns
Corresponding Psf.
Exceptions
RangeErrorIndex of component is out of range.

Definition at line 270 of file CoaddPsf.cc.

270  {
271  if (index < 0 || index > getComponentCount()) {
272  throw LSST_EXCEPT(pex::exceptions::RangeError, "index of CoaddPsf component out of range");
273  }
274  return _catalog[index].getPsf();
275 }
afw::table::ExposureCatalog _catalog
Definition: CoaddPsf.h:183
int getComponentCount() const
Return the number of component Psfs in this CoaddPsf.
Definition: CoaddPsf.cc:266
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
std::string lsst::meas::algorithms::CoaddPsf::getPythonModule ( ) const
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 from lsst::afw::table::io::Persistable.

Definition at line 386 of file CoaddPsf.cc.

386 { return "lsst.meas.algorithms"; }
boost::shared_ptr< afw::geom::polygon::Polygon const > lsst::meas::algorithms::CoaddPsf::getValidPolygon ( int  index)

Get the validPolygon (in component image Pixel coordinates) of the component image at index.

Parameters
[in]indexIndex of component for which the bounding box will be fetched.
Returns
Corresponding validPolygon.
Exceptions
RangeErrorIndex of component is out of range.

Definition at line 284 of file CoaddPsf.cc.

284  {
285  if (index < 0 || index > getComponentCount()) {
286  throw LSST_EXCEPT(pex::exceptions::RangeError, "index of CoaddPsf component out of range");
287  }
288  return _catalog[index].getValidPolygon();
289 }
afw::table::ExposureCatalog _catalog
Definition: CoaddPsf.h:183
int getComponentCount() const
Return the number of component Psfs in this CoaddPsf.
Definition: CoaddPsf.cc:266
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
boost::shared_ptr< afw::image::Wcs const > lsst::meas::algorithms::CoaddPsf::getWcs ( int  index)

Get the Wcs of the component image at index.

Parameters
[in]indexIndex of component for which the Wcs will be fetched.
Returns
Corresponding Wcs.
Exceptions
RangeErrorIndex of component is out of range.

Definition at line 277 of file CoaddPsf.cc.

277  {
278  if (index < 0 || index > getComponentCount()) {
279  throw LSST_EXCEPT(pex::exceptions::RangeError, "index of CoaddPsf component out of range");
280  }
281  return _catalog[index].getWcs();
282 }
afw::table::ExposureCatalog _catalog
Definition: CoaddPsf.h:183
int getComponentCount() const
Return the number of component Psfs in this CoaddPsf.
Definition: CoaddPsf.cc:266
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
double lsst::meas::algorithms::CoaddPsf::getWeight ( int  index)

Get the weight of the component image at index.

Parameters
[in]indexIndex of component for which the weight will be fetched.
Returns
Corresponding weight.
Exceptions
RangeErrorIndex of component is out of range.

Definition at line 291 of file CoaddPsf.cc.

291  {
292  if (index < 0 || index > getComponentCount()) {
293  throw LSST_EXCEPT(pex::exceptions::RangeError, "index of CoaddPsf component out of range");
294  }
295  return _catalog[index].get(_weightKey);
296 }
afw::table::Key< double > _weightKey
Definition: CoaddPsf.h:185
afw::table::ExposureCatalog _catalog
Definition: CoaddPsf.h:183
int getComponentCount() const
Return the number of component Psfs in this CoaddPsf.
Definition: CoaddPsf.cc:266
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
boost::shared_ptr< RecordT > const get(size_type i) const
Return a pointer to the record at index i.
Definition: Catalog.h:439
virtual bool lsst::meas::algorithms::CoaddPsf::isPersistable ( ) const
inlinevirtual

Return true if the CoaddPsf persistable (always true).

While it's actually possible to construct a CoaddPsf that isn't persistable (because its nested Psfs and Wcss are not persistable) in artificial situations, in realistic situations it's pretty much impossible, because persistence is a necessary part of how CoaddPsfs are built. And it's simpler and much faster if we just always return true, rather than loop over the elements and check each one.

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

Definition at line 151 of file CoaddPsf.h.

151 { return true; }
void lsst::meas::algorithms::CoaddPsf::write ( OutputArchiveHandle handle) const
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 from lsst::afw::table::io::Persistable.

Definition at line 388 of file CoaddPsf.cc.

388  {
389  CoaddPsfPersistenceHelper const & keys1 = CoaddPsfPersistenceHelper::get();
390  tbl::BaseCatalog cat1 = handle.makeCatalog(keys1.schema);
391  PTR(tbl::BaseRecord) record1 = cat1.addNew();
392  record1->set(keys1.coaddWcs, handle.put(_coaddWcs));
393  record1->set(keys1.cacheSize, _warpingControl->getCacheSize());
394  record1->set(keys1.averagePosition, _averagePosition);
395  record1->set(keys1.warpingKernelName, _warpingKernelName);
396  handle.saveCatalog(cat1);
397  _catalog.writeToArchive(handle, false);
398 }
CatalogT< BaseRecord > BaseCatalog
Definition: fwd.h:61
afw::geom::Point2D _averagePosition
Definition: CoaddPsf.h:186
#define PTR(...)
Definition: base.h:41
boost::shared_ptr< afw::image::Wcs const > _coaddWcs
Definition: CoaddPsf.h:184
tbl::Key< int > cacheSize
Definition: CoaddPsf.cc:327
afw::table::ExposureCatalog _catalog
Definition: CoaddPsf.h:183
boost::shared_ptr< afw::math::WarpingControl const > _warpingControl
Definition: CoaddPsf.h:188
tbl::Key< std::string > warpingKernelName
Definition: CoaddPsf.cc:329
tbl::PointKey< double > averagePosition
Definition: CoaddPsf.cc:328
tbl::Key< int > coaddWcs

Member Data Documentation

afw::geom::Point2D lsst::meas::algorithms::CoaddPsf::_averagePosition
private

Definition at line 186 of file CoaddPsf.h.

afw::table::ExposureCatalog lsst::meas::algorithms::CoaddPsf::_catalog
private

Definition at line 183 of file CoaddPsf.h.

boost::shared_ptr< afw::image::Wcs const> lsst::meas::algorithms::CoaddPsf::_coaddWcs
private

Definition at line 184 of file CoaddPsf.h.

boost::shared_ptr< afw::math::WarpingControl const> lsst::meas::algorithms::CoaddPsf::_warpingControl
private

Definition at line 188 of file CoaddPsf.h.

std::string lsst::meas::algorithms::CoaddPsf::_warpingKernelName
private

Definition at line 187 of file CoaddPsf.h.

afw::table::Key<double> lsst::meas::algorithms::CoaddPsf::_weightKey
private

Definition at line 185 of file CoaddPsf.h.


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