LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
lsst.afw.image::Exposure< ImageT, MaskT, VarianceT > Class Template Reference

A class to contain the data, WCS, and other information needed to describe an image of the sky. More...

#include <Exposure.h>

Inheritance diagram for lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >:
lsst::daf::base::Persistable lsst::daf::base::Citizen

Public Types

typedef MaskedImage< ImageT,
MaskT, VarianceT > 
MaskedImageT
 
typedef boost::shared_ptr
< Exposure
Ptr
 
typedef boost::shared_ptr
< Exposure const > 
ConstPtr
 
- Public Types inherited from lsst::daf::base::Persistable
typedef boost::shared_ptr
< Persistable
Ptr
 
- 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 Member Functions

 Exposure (unsigned int width, unsigned int height, boost::shared_ptr< Wcs const > wcs=boost::shared_ptr< Wcs const >())
 Exposure Class Implementation for LSST: a templated framework class for creating an Exposure from a MaskedImage and a Wcs. More...
 
 Exposure (lsst::afw::geom::Extent2I const &dimensions=lsst::afw::geom::Extent2I(), boost::shared_ptr< Wcs const > wcs=boost::shared_ptr< Wcs const >())
 Construct an Exposure with a blank MaskedImage of specified size (default 0x0) and a Wcs (which may be default constructed) More...
 
 Exposure (lsst::afw::geom::Box2I const &bbox, boost::shared_ptr< Wcs const > wcs=boost::shared_ptr< Wcs const >())
 Construct an Exposure with a blank MaskedImage of specified size (default 0x0) and a Wcs (which may be default constructed) More...
 
 Exposure (MaskedImageT &maskedImage, boost::shared_ptr< Wcs const > wcs=boost::shared_ptr< Wcs const >())
 Construct an Exposure from a MaskedImage. More...
 
 Exposure (std::string const &fileName, geom::Box2I const &bbox=geom::Box2I(), ImageOrigin origin=PARENT, bool conformMasks=false)
 Construct an Exposure by reading a regular FITS file. More...
 
 Exposure (fits::MemFileManager &manager, geom::Box2I const &bbox=geom::Box2I(), ImageOrigin origin=PARENT, bool conformMasks=false)
 Construct an Exposure by reading a FITS image in memory. More...
 
 Exposure (fits::Fits &fitsfile, geom::Box2I const &bbox=geom::Box2I(), ImageOrigin origin=PARENT, bool conformMasks=false)
 Construct an Exposure from an already-open FITS object. More...
 
 Exposure (Exposure const &src, bool const deep=false)
 Copy an Exposure. More...
 
 Exposure (Exposure const &src, lsst::afw::geom::Box2I const &bbox, ImageOrigin const origin=PARENT, bool const deep=false)
 Construct a subExposure given an Exposure and a bounding box. More...
 
template<typename OtherPixelT >
 Exposure (Exposure< OtherPixelT, MaskT, VarianceT > const &rhs, const bool deep)
 
virtual ~Exposure ()
 
MaskedImageT getMaskedImage ()
 Return the MaskedImage. More...
 
MaskedImageT getMaskedImage () const
 Return the MaskedImage. More...
 
boost::shared_ptr< Wcs const > getWcs () const
 
boost::shared_ptr< WcsgetWcs ()
 
boost::shared_ptr
< lsst::afw::cameraGeom::Detector
const > 
getDetector () const
 Return the Exposure's Detector information. More...
 
Filter getFilter () const
 Return the Exposure's filter. More...
 
lsst::daf::base::PropertySet::Ptr getMetadata () const
 Return flexible metadata. More...
 
void setMetadata (lsst::daf::base::PropertySet::Ptr metadata)
 
int getWidth () const
 Return the Exposure's width. More...
 
int getHeight () const
 Return the Exposure's height. More...
 
geom::Extent2I getDimensions () const
 Return the Exposure's size. More...
 
int getX0 () const
 
int getY0 () const
 
geom::Point2I getXY0 () const
 
geom::Box2I getBBox (ImageOrigin const origin=PARENT) const
 
void setXY0 (geom::Point2I const &origin)
 
void setMaskedImage (MaskedImageT &maskedImage)
 Set the MaskedImage of the Exposure. More...
 
void setWcs (boost::shared_ptr< Wcs > wcs)
 
void setDetector (boost::shared_ptr< lsst::afw::cameraGeom::Detector const > detector)
 Set the Exposure's Detector information. More...
 
void setFilter (Filter const &filter)
 Set the Exposure's filter. More...
 
void setCalib (boost::shared_ptr< Calib > calib)
 Set the Exposure's Calib object. More...
 
boost::shared_ptr< CalibgetCalib ()
 Return the Exposure's Calib object. More...
 
boost::shared_ptr< Calib const > getCalib () const
 Return the Exposure's Calib object. More...
 
void setPsf (boost::shared_ptr< lsst::afw::detection::Psf const > psf)
 Set the Exposure's Psf. More...
 
boost::shared_ptr
< lsst::afw::detection::Psf
getPsf ()
 Return the Exposure's Psf object. More...
 
boost::shared_ptr
< lsst::afw::detection::Psf
const > 
getPsf () const
 Return the Exposure's Psf object. More...
 
bool hasPsf () const
 Does this Exposure have a Psf? More...
 
bool hasWcs () const
 Does this Exposure have a Wcs? More...
 
boost::shared_ptr< ExposureInfogetInfo ()
 Get the ExposureInfo that aggregates all the non-image components. Never null. More...
 
boost::shared_ptr
< ExposureInfo const > 
getInfo () const
 Get the ExposureInfo that aggregates all the non-image components. Never null. More...
 
void writeFits (std::string const &fileName) const
 Write an Exposure to a regular multi-extension FITS file. More...
 
void writeFits (fits::MemFileManager &manager) const
 Write an Exposure to a multi-extension FITS file in memory. More...
 
void writeFits (fits::Fits &fitsfile) const
 Write an Exposure to an already-open FITS file object. 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::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...
 

Static Public Member Functions

static Exposure readFits (std::string const &filename)
 Read an Exposure from a regular FITS file. More...
 
static Exposure readFits (fits::MemFileManager &manager)
 Read an Exposure from a FITS RAM file. More...
 
- 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...
 

Private Member Functions

void _readFits (fits::Fits &fitsfile, geom::Box2I const &bbox, ImageOrigin origin, bool conformMasks)
 

Private Attributes

MaskedImageT _maskedImage
 
boost::shared_ptr< ExposureInfo_info
 

Detailed Description

template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
class lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >

A class to contain the data, WCS, and other information needed to describe an image of the sky.

Definition at line 48 of file Exposure.h.

Member Typedef Documentation

template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
typedef boost::shared_ptr<Exposure const> lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::ConstPtr

Definition at line 53 of file Exposure.h.

template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
typedef MaskedImage<ImageT, MaskT, VarianceT> lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::MaskedImageT

Definition at line 51 of file Exposure.h.

template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
typedef boost::shared_ptr<Exposure> lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::Ptr

Definition at line 52 of file Exposure.h.

Constructor & Destructor Documentation

template<typename ImageT , typename MaskT , typename VarianceT >
lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::Exposure ( unsigned int  width,
unsigned int  height,
boost::shared_ptr< Wcs const >  wcs = boost::shared_ptr< Wcs const>() 
)
explicit

Exposure Class Implementation for LSST: a templated framework class for creating an Exposure from a MaskedImage and a Wcs.

An Exposure is required to take one afwImage::MaskedImage or a region (col, row) defining the size of a MaskedImage (this can be of size 0,0). An Exposure can (but is not required to) contain a afwImage::Wcs.

The template types should optimally be a float, double, unsigned int 16 bit, or unsigned int 32 bit for the image (pixel) type and an unsigned int 32 bit for the mask type. These types have been explicitly instantiated for the Exposure class. All MaskedImage and Wcs constructors are 'const' to allow for views and copying.

An Exposure can get and return its MaskedImage, Wcs, and a subExposure. The getSubExposure member takes a BBox region defining the subRegion of the original Exposure to be returned. The member retrieves the MaskedImage corresponding to the subRegion. The MaskedImage class throws an exception for any subRegion extending beyond the original MaskedImage bounding box. This member is not yet fully implemented because it requires the Wcs class to return the Wcs metadata to the member so the CRPIX values of the Wcs can be adjusted to reflect the new subMaskedImage origin. The getSubExposure member will eventually return a subExposure consisting of the subMAskedImage and the Wcs object with its corresponding adjusted metadata.

The hasWcs member is used to determine if the Exposure has a Wcs. It is not required to have one.Construct an Exposure with a blank MaskedImage of specified size (default 0x0) and a Wcs (which may be default constructed)

Parameters
widthnumber of columns
heightnumber of rows
wcsthe Wcs

Definition at line 85 of file Exposure.cc.

89  :
90  lsst::daf::base::Citizen(typeid(this)),
91  _maskedImage(width, height),
92  _info(new ExposureInfo(wcs))
93 {}
MaskedImageT _maskedImage
Definition: Exposure.h:300
tbl::Key< int > wcs
boost::shared_ptr< ExposureInfo > _info
Definition: Exposure.h:301
Citizen is a class that should be among all LSST classes base classes, and handles basic memory manag...
Definition: Citizen.h:56
template<typename ImageT , typename MaskT , typename VarianceT >
lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::Exposure ( lsst::afw::geom::Extent2I const &  dimensions = lsst::afw::geom::Extent2I(),
boost::shared_ptr< Wcs const >  wcs = boost::shared_ptr< Wcs const>() 
)
explicit

Construct an Exposure with a blank MaskedImage of specified size (default 0x0) and a Wcs (which may be default constructed)

Parameters
dimensionsdesired image width/height
wcsthe Wcs

Definition at line 99 of file Exposure.cc.

102  :
103  lsst::daf::base::Citizen(typeid(this)),
105  _info(new ExposureInfo(wcs))
106 {}
MaskedImageT _maskedImage
Definition: Exposure.h:300
tbl::Key< int > wcs
boost::shared_ptr< ExposureInfo > _info
Definition: Exposure.h:301
afw::table::PointKey< int > dimensions
Citizen is a class that should be among all LSST classes base classes, and handles basic memory manag...
Definition: Citizen.h:56
template<typename ImageT , typename MaskT , typename VarianceT >
lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::Exposure ( lsst::afw::geom::Box2I const &  bbox,
boost::shared_ptr< Wcs const >  wcs = boost::shared_ptr< Wcs const>() 
)
explicit

Construct an Exposure with a blank MaskedImage of specified size (default 0x0) and a Wcs (which may be default constructed)

Parameters
bboxdesired image width/height, and origin
wcsthe Wcs

Definition at line 112 of file Exposure.cc.

115  :
116  lsst::daf::base::Citizen(typeid(this)),
117  _maskedImage(bbox),
118  _info(new ExposureInfo(wcs))
119 {}
MaskedImageT _maskedImage
Definition: Exposure.h:300
tbl::Key< int > wcs
boost::shared_ptr< ExposureInfo > _info
Definition: Exposure.h:301
Citizen is a class that should be among all LSST classes base classes, and handles basic memory manag...
Definition: Citizen.h:56
template<typename ImageT , typename MaskT , typename VarianceT >
lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::Exposure ( MaskedImageT maskedImage,
boost::shared_ptr< Wcs const >  wcs = boost::shared_ptr< Wcs const>() 
)
explicit

Construct an Exposure from a MaskedImage.

Parameters
maskedImagethe MaskedImage
wcsthe Wcs

Definition at line 124 of file Exposure.cc.

127  :
128  lsst::daf::base::Citizen(typeid(this)),
129  _maskedImage(maskedImage),
130  _info(new ExposureInfo(wcs))
131 {}
MaskedImageT _maskedImage
Definition: Exposure.h:300
tbl::Key< int > wcs
boost::shared_ptr< ExposureInfo > _info
Definition: Exposure.h:301
Citizen is a class that should be among all LSST classes base classes, and handles basic memory manag...
Definition: Citizen.h:56
template<typename ImageT , typename MaskT , typename VarianceT >
lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::Exposure ( std::string const &  fileName,
geom::Box2I const &  bbox = geom::Box2I(),
ImageOrigin  origin = PARENT,
bool  conformMasks = false 
)
explicit

Construct an Exposure by reading a regular FITS file.

Parameters
[in]fileNameFile to read.
[in]bboxIf non-empty, read only the pixels within the bounding box.
[in]originCoordinate system of the bounding box; if PARENT, the bounding box should take into account the xy0 saved with the image.
[in]conformMasksIf true, make Mask conform to the mask layout in the file.

Definition at line 164 of file Exposure.cc.

167  :
168  lsst::daf::base::Citizen(typeid(this)),
169  _maskedImage(),
170  _info(new ExposureInfo())
171 {
172  fits::Fits fitsfile(fileName, "r", fits::Fits::AUTO_CLOSE | fits::Fits::AUTO_CHECK);
173  _readFits(fitsfile, bbox, origin, conformMasks);
174 }
MaskedImageT _maskedImage
Definition: Exposure.h:300
void _readFits(fits::Fits &fitsfile, geom::Box2I const &bbox, ImageOrigin origin, bool conformMasks)
Definition: Exposure.cc:200
boost::shared_ptr< ExposureInfo > _info
Definition: Exposure.h:301
Citizen is a class that should be among all LSST classes base classes, and handles basic memory manag...
Definition: Citizen.h:56
template<typename ImageT , typename MaskT , typename VarianceT >
lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::Exposure ( fits::MemFileManager manager,
geom::Box2I const &  bbox = geom::Box2I(),
ImageOrigin  origin = PARENT,
bool  conformMasks = false 
)
explicit

Construct an Exposure by reading a FITS image in memory.

Parameters
[in]managerAn object that manages the memory buffer to read.
[in]bboxIf non-empty, read only the pixels within the bounding box.
[in]originCoordinate system of the bounding box; if PARENT, the bounding box should take into account the xy0 saved with the image.
[in]conformMasksIf true, make Mask conform to the mask layout in the file.

Definition at line 177 of file Exposure.cc.

180  :
181  lsst::daf::base::Citizen(typeid(this)),
182  _maskedImage(),
183  _info(new ExposureInfo())
184 {
185  fits::Fits fitsfile(manager, "r", fits::Fits::AUTO_CLOSE | fits::Fits::AUTO_CHECK);
186  _readFits(fitsfile, bbox, origin, conformMasks);
187 }
MaskedImageT _maskedImage
Definition: Exposure.h:300
void _readFits(fits::Fits &fitsfile, geom::Box2I const &bbox, ImageOrigin origin, bool conformMasks)
Definition: Exposure.cc:200
boost::shared_ptr< ExposureInfo > _info
Definition: Exposure.h:301
Citizen is a class that should be among all LSST classes base classes, and handles basic memory manag...
Definition: Citizen.h:56
template<typename ImageT , typename MaskT , typename VarianceT >
lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::Exposure ( fits::Fits fitsfile,
geom::Box2I const &  bbox = geom::Box2I(),
ImageOrigin  origin = PARENT,
bool  conformMasks = false 
)
explicit

Construct an Exposure from an already-open FITS object.

Parameters
[in]fitsfileA FITS object to read from. Current HDU is ignored.
[in]bboxIf non-empty, read only the pixels within the bounding box.
[in]originCoordinate system of the bounding box; if PARENT, the bounding box should take into account the xy0 saved with the image.
[in]conformMasksIf true, make Mask conform to the mask layout in the file.

Definition at line 190 of file Exposure.cc.

193  :
194  lsst::daf::base::Citizen(typeid(this))
195 {
196  _readFits(fitsfile, bbox, origin, conformMasks);
197 }
void _readFits(fits::Fits &fitsfile, geom::Box2I const &bbox, ImageOrigin origin, bool conformMasks)
Definition: Exposure.cc:200
Citizen is a class that should be among all LSST classes base classes, and handles basic memory manag...
Definition: Citizen.h:56
template<typename ImageT , typename MaskT , typename VarianceT >
lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::Exposure ( Exposure< ImageT, MaskT, VarianceT > const &  src,
bool const  deep = false 
)

Copy an Exposure.

Parameters
srcParent Exposure
deepShould we copy the pixels?

Definition at line 137 of file Exposure.cc.

140  :
141  lsst::daf::base::Citizen(typeid(this)),
142  _maskedImage(src.getMaskedImage(), deep),
143  _info(new ExposureInfo(*src.getInfo(), deep))
144 {}
MaskedImageT _maskedImage
Definition: Exposure.h:300
boost::shared_ptr< ExposureInfo > _info
Definition: Exposure.h:301
Citizen is a class that should be among all LSST classes base classes, and handles basic memory manag...
Definition: Citizen.h:56
template<typename ImageT , typename MaskT , typename VarianceT >
lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::Exposure ( Exposure< ImageT, MaskT, VarianceT > const &  src,
lsst::afw::geom::Box2I const &  bbox,
ImageOrigin const  origin = PARENT,
bool const  deep = false 
)

Construct a subExposure given an Exposure and a bounding box.

Exceptions
alsst::pex::exceptions::InvalidParameter if the requested subRegion is not fully contained by the original MaskedImage BBox.
Parameters
srcParent Exposure
bboxDesired region in Exposure
originCoordinate system for bbox
deepShould we copy the pixels?

Definition at line 152 of file Exposure.cc.

157  :
158  lsst::daf::base::Citizen(typeid(this)),
159  _maskedImage(src.getMaskedImage(), bbox, origin, deep),
160  _info(new ExposureInfo(*src.getInfo(), deep))
161 {}
MaskedImageT _maskedImage
Definition: Exposure.h:300
boost::shared_ptr< ExposureInfo > _info
Definition: Exposure.h:301
Citizen is a class that should be among all LSST classes base classes, and handles basic memory manag...
Definition: Citizen.h:56
template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
template<typename OtherPixelT >
lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::Exposure ( Exposure< OtherPixelT, MaskT, VarianceT > const &  rhs,
const bool  deep 
)
inline

generalised copy constructor; defined here in the header so that the compiler can instantiate N(N-1)/2 conversions between N ImageBase types.

We only support converting the Image part

Parameters
rhsInput Exposure
deepMust be true; needed to disambiguate

Definition at line 133 of file Exposure.h.

135  :
136  lsst::daf::base::Citizen(typeid(this)),
137  _maskedImage(rhs.getMaskedImage(), deep),
138  _info(new ExposureInfo(*rhs.getInfo(), deep))
139  {
140  if (not deep) {
141  throw LSST_EXCEPT(lsst::pex::exceptions::InvalidParameterError,
142  "Exposure's converting copy constructor must make a deep copy");
143  }
144  }
MaskedImageT _maskedImage
Definition: Exposure.h:300
boost::shared_ptr< ExposureInfo > _info
Definition: Exposure.h:301
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
Citizen is a class that should be among all LSST classes base classes, and handles basic memory manag...
Definition: Citizen.h:56
template<typename ImageT , typename MaskT , typename VarianceT >
lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::~Exposure ( )
virtual

Destructor

Definition at line 214 of file Exposure.cc.

214 {}

Member Function Documentation

template<typename ImageT , typename MaskT , typename VarianceT >
void lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::_readFits ( fits::Fits fitsfile,
geom::Box2I const &  bbox,
ImageOrigin  origin,
bool  conformMasks 
)
private

Definition at line 200 of file Exposure.cc.

203  {
204  PTR(daf::base::PropertySet) metadata(new lsst::daf::base::PropertyList());
205  PTR(daf::base::PropertySet) imageMetadata(new lsst::daf::base::PropertyList());
206  _maskedImage = MaskedImageT(fitsfile, metadata, bbox, origin, conformMasks, false, imageMetadata);
207  _info->_readFits(fitsfile, metadata, imageMetadata);
208 }
#define PTR(...)
Definition: base.h:41
Class for storing ordered metadata with comments.
Definition: PropertyList.h:81
MaskedImageT _maskedImage
Definition: Exposure.h:300
void _readFits(fits::Fits &fitsfile, geom::Box2I const &bbox, ImageOrigin origin, bool conformMasks)
Definition: Exposure.cc:200
boost::shared_ptr< ExposureInfo > _info
Definition: Exposure.h:301
lsst::daf::base::PropertySet PropertySet
Definition: Wcs.cc:58
MaskedImage< ImageT, MaskT, VarianceT > MaskedImageT
Definition: Exposure.h:51
Class for storing generic metadata.
Definition: PropertySet.h:82
template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
geom::Box2I lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::getBBox ( ImageOrigin const  origin = PARENT) const
inline

Definition at line 194 of file Exposure.h.

194  {
195  return _maskedImage.getBBox(origin);
196  }
MaskedImageT _maskedImage
Definition: Exposure.h:300
geom::Box2I getBBox(ImageOrigin const origin=PARENT) const
Definition: MaskedImage.h:905
template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
boost::shared_ptr< Calib > lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::getCalib ( )
inline

Return the Exposure's Calib object.

Definition at line 217 of file Exposure.h.

217 { return _info->getCalib(); }
boost::shared_ptr< ExposureInfo > _info
Definition: Exposure.h:301
template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
boost::shared_ptr< Calib const> lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::getCalib ( ) const
inline

Return the Exposure's Calib object.

Definition at line 219 of file Exposure.h.

219 { return _info->getCalib(); }
boost::shared_ptr< ExposureInfo > _info
Definition: Exposure.h:301
template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
boost::shared_ptr< lsst::afw::cameraGeom::Detector const> lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::getDetector ( ) const
inline

Return the Exposure's Detector information.

Definition at line 158 of file Exposure.h.

158 { return _info->getDetector(); }
boost::shared_ptr< ExposureInfo > _info
Definition: Exposure.h:301
template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
geom::Extent2I lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::getDimensions ( ) const
inline

Return the Exposure's size.

Definition at line 170 of file Exposure.h.

170 { return _maskedImage.getDimensions(); }
MaskedImageT _maskedImage
Definition: Exposure.h:300
geom::Extent2I getDimensions() const
Definition: MaskedImage.h:904
template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
Filter lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::getFilter ( ) const
inline

Return the Exposure's filter.

Definition at line 160 of file Exposure.h.

160 { return _info->getFilter(); }
boost::shared_ptr< ExposureInfo > _info
Definition: Exposure.h:301
template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
int lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::getHeight ( ) const
inline

Return the Exposure's height.

Definition at line 168 of file Exposure.h.

168 { return _maskedImage.getHeight(); }
MaskedImageT _maskedImage
Definition: Exposure.h:300
int getHeight() const
Return the number of rows in the image.
Definition: MaskedImage.h:903
template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
boost::shared_ptr< ExposureInfo > lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::getInfo ( )
inline

Get the ExposureInfo that aggregates all the non-image components. Never null.

Definition at line 235 of file Exposure.h.

235 { return _info; }
boost::shared_ptr< ExposureInfo > _info
Definition: Exposure.h:301
template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
boost::shared_ptr< ExposureInfo const> lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::getInfo ( ) const
inline

Get the ExposureInfo that aggregates all the non-image components. Never null.

Definition at line 238 of file Exposure.h.

238 { return _info; }
boost::shared_ptr< ExposureInfo > _info
Definition: Exposure.h:301
template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
MaskedImageT lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::getMaskedImage ( )
inline

Return the MaskedImage.

Definition at line 150 of file Exposure.h.

150 { return _maskedImage; }
MaskedImageT _maskedImage
Definition: Exposure.h:300
template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
MaskedImageT lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::getMaskedImage ( ) const
inline

Return the MaskedImage.

Definition at line 152 of file Exposure.h.

152 { return _maskedImage; }
MaskedImageT _maskedImage
Definition: Exposure.h:300
template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
lsst::daf::base::PropertySet::Ptr lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::getMetadata ( ) const
inline

Return flexible metadata.

Definition at line 162 of file Exposure.h.

162 { return _info->getMetadata(); }
boost::shared_ptr< ExposureInfo > _info
Definition: Exposure.h:301
template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
boost::shared_ptr< lsst::afw::detection::Psf > lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::getPsf ( )
inline

Return the Exposure's Psf object.

Definition at line 224 of file Exposure.h.

224 { return _info->getPsf(); }
boost::shared_ptr< ExposureInfo > _info
Definition: Exposure.h:301
template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
boost::shared_ptr< lsst::afw::detection::Psf const> lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::getPsf ( ) const
inline

Return the Exposure's Psf object.

Definition at line 226 of file Exposure.h.

226 { return _info->getPsf(); }
boost::shared_ptr< ExposureInfo > _info
Definition: Exposure.h:301
template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
boost::shared_ptr< Wcs const> lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::getWcs ( ) const
inline

Definition at line 154 of file Exposure.h.

154 { return _info->getWcs(); }
boost::shared_ptr< ExposureInfo > _info
Definition: Exposure.h:301
template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
boost::shared_ptr< Wcs > lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::getWcs ( )
inline

Definition at line 155 of file Exposure.h.

155 { return _info->getWcs(); }
boost::shared_ptr< ExposureInfo > _info
Definition: Exposure.h:301
template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
int lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::getWidth ( ) const
inline

Return the Exposure's width.

Definition at line 166 of file Exposure.h.

166 { return _maskedImage.getWidth(); }
int getWidth() const
Return the number of columns in the image.
Definition: MaskedImage.h:901
MaskedImageT _maskedImage
Definition: Exposure.h:300
template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
int lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::getX0 ( ) const
inline

Return the Exposure's row-origin

See Also
getXY0()

Definition at line 177 of file Exposure.h.

177 { return _maskedImage.getX0(); }
MaskedImageT _maskedImage
Definition: Exposure.h:300
template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
geom::Point2I lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::getXY0 ( ) const
inline

Return the Exposure's origin

This will usually be (0, 0) except for images created using the Exposure(fileName, hdu, BBox, mode) ctor or Exposure(Exposure, BBox) cctor The origin can be reset with setXY0

Definition at line 192 of file Exposure.h.

192 { return _maskedImage.getXY0(); }
MaskedImageT _maskedImage
Definition: Exposure.h:300
geom::Point2I getXY0() const
Definition: MaskedImage.h:929
template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
int lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::getY0 ( ) const
inline

Return the Exposure's column-origin

See Also
getXY0()

Definition at line 183 of file Exposure.h.

183 { return _maskedImage.getY0(); }
MaskedImageT _maskedImage
Definition: Exposure.h:300
template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
bool lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::hasPsf ( ) const
inline

Does this Exposure have a Psf?

Definition at line 229 of file Exposure.h.

229 { return _info->hasPsf(); }
boost::shared_ptr< ExposureInfo > _info
Definition: Exposure.h:301
template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
bool lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::hasWcs ( ) const
inline

Does this Exposure have a Wcs?

Definition at line 232 of file Exposure.h.

232 { return _info->hasWcs(); }
boost::shared_ptr< ExposureInfo > _info
Definition: Exposure.h:301
template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
static Exposure lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::readFits ( std::string const &  filename)
inlinestatic

Read an Exposure from a regular FITS file.

Parameters
[in]filenameName of the file to read.

Definition at line 279 of file Exposure.h.

279  {
280  return Exposure<ImageT, MaskT, VarianceT>(filename);
281  }
template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
static Exposure lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::readFits ( fits::MemFileManager manager)
inlinestatic

Read an Exposure from a FITS RAM file.

Parameters
[in]managerObject that manages the memory to be read.

Definition at line 288 of file Exposure.h.

288  {
289  return Exposure<ImageT, MaskT, VarianceT>(manager);
290  }
template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
void lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::setCalib ( boost::shared_ptr< Calib calib)
inline

Set the Exposure's Calib object.

Definition at line 215 of file Exposure.h.

215 { _info->setCalib(calib); }
boost::shared_ptr< ExposureInfo > _info
Definition: Exposure.h:301
template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
void lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::setDetector ( boost::shared_ptr< lsst::afw::cameraGeom::Detector const >  detector)
inline

Set the Exposure's Detector information.

Definition at line 211 of file Exposure.h.

211 { _info->setDetector(detector); }
boost::shared_ptr< ExposureInfo > _info
Definition: Exposure.h:301
template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
void lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::setFilter ( Filter const &  filter)
inline

Set the Exposure's filter.

Definition at line 213 of file Exposure.h.

213 { _info->setFilter(filter); }
boost::shared_ptr< ExposureInfo > _info
Definition: Exposure.h:301
template<typename ImageT , typename MaskT , typename VarianceT >
void lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::setMaskedImage ( MaskedImageT maskedImage)

Set the MaskedImage of the Exposure.

Definition at line 221 of file Exposure.cc.

221  {
222  _maskedImage = maskedImage;
223 }
MaskedImageT _maskedImage
Definition: Exposure.h:300
template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
void lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::setMetadata ( lsst::daf::base::PropertySet::Ptr  metadata)
inline

Definition at line 163 of file Exposure.h.

163 { _info->setMetadata(metadata); }
boost::shared_ptr< ExposureInfo > _info
Definition: Exposure.h:301
template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
void lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::setPsf ( boost::shared_ptr< lsst::afw::detection::Psf const >  psf)
inline

Set the Exposure's Psf.

Definition at line 221 of file Exposure.h.

221 { _info->setPsf(psf); }
boost::shared_ptr< ExposureInfo > _info
Definition: Exposure.h:301
template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
void lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::setWcs ( boost::shared_ptr< Wcs wcs)
inline

Definition at line 209 of file Exposure.h.

209 { _info->setWcs(wcs); }
tbl::Key< int > wcs
boost::shared_ptr< ExposureInfo > _info
Definition: Exposure.h:301
template<typename ImageT , typename MaskT , typename VarianceT >
void lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::setXY0 ( geom::Point2I const &  origin)

Set the Exposure's origin (including correcting the Wcs)

The origin is usually set by the constructor, so you shouldn't need this function

Note
There are use cases (e.g. memory overlays) that may want to set these values, but don't do so unless you are an Expert.

Definition at line 226 of file Exposure.cc.

226  {
228  if (_info->hasWcs())
229  _info->getWcs()->shiftReferencePixel(origin.getX() - old.getX(), origin.getY() - old.getY());
230  _maskedImage.setXY0(origin);
231 }
void setXY0(int const x0, int const y0)
Definition: MaskedImage.h:939
MaskedImageT _maskedImage
Definition: Exposure.h:300
boost::shared_ptr< ExposureInfo > _info
Definition: Exposure.h:301
geom::Point2I getXY0() const
Definition: MaskedImage.h:929
template<typename ImageT , typename MaskT , typename VarianceT >
void lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::writeFits ( std::string const &  fileName) const

Write an Exposure to a regular multi-extension FITS file.

Parameters
[in]fileNameName of the file to write.

As with MaskedImage persistence, an empty primary HDU will be created and all images planes will be saved to extension HDUs. Most metadata will be saved only to the header of the main image HDU, but the WCS will be saved to the header of the mask and variance as well. If present, the Psf will be written to one or more additional HDUs.

Note that the LSST pixel origin differs from the FITS convention by one, so the values of CRPIX and LTV saved in the file are not the same as those in the C++ objects in memory, but are rather modified so they are interpreted by external tools (like ds9).

Definition at line 237 of file Exposure.cc.

237  {
238  fits::Fits fitsfile(fileName, "w", fits::Fits::AUTO_CLOSE | fits::Fits::AUTO_CHECK);
239  writeFits(fitsfile);
240 }
void writeFits(std::string const &fileName) const
Write an Exposure to a regular multi-extension FITS file.
Definition: Exposure.cc:237
template<typename ImageT , typename MaskT , typename VarianceT >
void lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::writeFits ( fits::MemFileManager manager) const

Write an Exposure to a multi-extension FITS file in memory.

Parameters
[in]managerManager for the memory to write to.
See Also
writeFits

Definition at line 243 of file Exposure.cc.

243  {
244  fits::Fits fitsfile(manager, "w", fits::Fits::AUTO_CLOSE | fits::Fits::AUTO_CHECK);
245  writeFits(fitsfile);
246 }
void writeFits(std::string const &fileName) const
Write an Exposure to a regular multi-extension FITS file.
Definition: Exposure.cc:237
template<typename ImageT , typename MaskT , typename VarianceT >
void lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::writeFits ( fits::Fits fitsfile) const

Write an Exposure to an already-open FITS file object.

Parameters
[in]fitsfileFITS object to write.
See Also
writeFits

Definition at line 249 of file Exposure.cc.

249  {
250  ExposureInfo::FitsWriteData data = _info->_startWriteFits(getXY0());
252  fitsfile, data.metadata,
253  data.imageMetadata, data.maskMetadata, data.varianceMetadata
254  );
255  _info->_finishWriteFits(fitsfile, data);
256 }
MaskedImageT _maskedImage
Definition: Exposure.h:300
boost::shared_ptr< ExposureInfo > _info
Definition: Exposure.h:301
void writeFits(std::string const &fileName, boost::shared_ptr< daf::base::PropertySet const > metadata=boost::shared_ptr< daf::base::PropertySet const >(), boost::shared_ptr< daf::base::PropertySet const > imageMetadata=boost::shared_ptr< daf::base::PropertySet const >(), boost::shared_ptr< daf::base::PropertySet const > maskMetadata=boost::shared_ptr< daf::base::PropertySet const >(), boost::shared_ptr< daf::base::PropertySet const > varianceMetadata=boost::shared_ptr< daf::base::PropertySet const >()) const
Write a MaskedImage to a regular FITS file.
Definition: MaskedImage.cc:562
geom::Point2I getXY0() const
Definition: Exposure.h:192

Member Data Documentation

template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
boost::shared_ptr< ExposureInfo > lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::_info
private

Definition at line 301 of file Exposure.h.

template<typename ImageT, typename MaskT = lsst::afw::image::MaskPixel, typename VarianceT = lsst::afw::image::VariancePixel>
MaskedImageT lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::_maskedImage
private

Definition at line 300 of file Exposure.h.


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