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
|
A class to contain the data, WCS, and other information needed to describe an image of the sky. More...
#include <Exposure.h>
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< Wcs > | getWcs () |
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< Calib > | getCalib () |
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< ExposureInfo > | getInfo () |
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 () | |
Citizen & | operator= (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 |
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.
typedef boost::shared_ptr<Exposure const> lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::ConstPtr |
Definition at line 53 of file Exposure.h.
typedef MaskedImage<ImageT, MaskT, VarianceT> lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::MaskedImageT |
Definition at line 51 of file Exposure.h.
typedef boost::shared_ptr<Exposure> lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::Ptr |
Definition at line 52 of file Exposure.h.
|
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)
width | number of columns |
height | number of rows |
wcs | the Wcs |
Definition at line 85 of file Exposure.cc.
|
explicit |
Construct an Exposure with a blank MaskedImage of specified size (default 0x0) and a Wcs (which may be default constructed)
dimensions | desired image width/height |
wcs | the Wcs |
Definition at line 99 of file Exposure.cc.
|
explicit |
Construct an Exposure with a blank MaskedImage of specified size (default 0x0) and a Wcs (which may be default constructed)
bbox | desired image width/height, and origin |
wcs | the Wcs |
Definition at line 112 of file Exposure.cc.
|
explicit |
Construct an Exposure from a MaskedImage.
maskedImage | the MaskedImage |
wcs | the Wcs |
Definition at line 124 of file Exposure.cc.
|
explicit |
Construct an Exposure by reading a regular FITS file.
[in] | fileName | File to read. |
[in] | bbox | If non-empty, read only the pixels within the bounding box. |
[in] | origin | Coordinate system of the bounding box; if PARENT, the bounding box should take into account the xy0 saved with the image. |
[in] | conformMasks | If true, make Mask conform to the mask layout in the file. |
Definition at line 164 of file Exposure.cc.
|
explicit |
Construct an Exposure by reading a FITS image in memory.
[in] | manager | An object that manages the memory buffer to read. |
[in] | bbox | If non-empty, read only the pixels within the bounding box. |
[in] | origin | Coordinate system of the bounding box; if PARENT, the bounding box should take into account the xy0 saved with the image. |
[in] | conformMasks | If true, make Mask conform to the mask layout in the file. |
Definition at line 177 of file Exposure.cc.
|
explicit |
Construct an Exposure from an already-open FITS object.
[in] | fitsfile | A FITS object to read from. Current HDU is ignored. |
[in] | bbox | If non-empty, read only the pixels within the bounding box. |
[in] | origin | Coordinate system of the bounding box; if PARENT, the bounding box should take into account the xy0 saved with the image. |
[in] | conformMasks | If true, make Mask conform to the mask layout in the file. |
Definition at line 190 of file Exposure.cc.
lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::Exposure | ( | Exposure< ImageT, MaskT, VarianceT > const & | src, |
bool const | deep = false |
||
) |
Copy an Exposure.
src | Parent Exposure |
deep | Should we copy the pixels? |
Definition at line 137 of file Exposure.cc.
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.
a | lsst::pex::exceptions::InvalidParameter if the requested subRegion is not fully contained by the original MaskedImage BBox. |
src | Parent Exposure |
bbox | Desired region in Exposure |
origin | Coordinate system for bbox |
deep | Should we copy the pixels? |
Definition at line 152 of file Exposure.cc.
|
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
rhs | Input Exposure |
deep | Must be true; needed to disambiguate |
Definition at line 133 of file Exposure.h.
|
virtual |
|
private |
Definition at line 200 of file Exposure.cc.
|
inline |
Definition at line 194 of file Exposure.h.
|
inline |
|
inline |
|
inline |
|
inline |
Return the Exposure's size.
Definition at line 170 of file Exposure.h.
|
inline |
|
inline |
Return the Exposure's height.
Definition at line 168 of file Exposure.h.
|
inline |
Get the ExposureInfo that aggregates all the non-image components. Never null.
Definition at line 235 of file Exposure.h.
|
inline |
Get the ExposureInfo that aggregates all the non-image components. Never null.
Definition at line 238 of file Exposure.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 154 of file Exposure.h.
|
inline |
Definition at line 155 of file Exposure.h.
|
inline |
Return the Exposure's width.
Definition at line 166 of file Exposure.h.
|
inline |
|
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.
|
inline |
|
inline |
|
inline |
|
inlinestatic |
Read an Exposure from a regular FITS file.
[in] | filename | Name of the file to read. |
Definition at line 279 of file Exposure.h.
|
inlinestatic |
Read an Exposure from a FITS RAM file.
[in] | manager | Object that manages the memory to be read. |
Definition at line 288 of file Exposure.h.
|
inline |
|
inline |
|
inline |
void lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::setMaskedImage | ( | MaskedImageT & | maskedImage | ) |
|
inline |
Definition at line 163 of file Exposure.h.
|
inline |
|
inline |
Definition at line 209 of file Exposure.h.
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
Definition at line 226 of file Exposure.cc.
void lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::writeFits | ( | std::string const & | fileName | ) | const |
Write an Exposure to a regular multi-extension FITS file.
[in] | fileName | Name 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.
void lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::writeFits | ( | fits::MemFileManager & | manager | ) | const |
Write an Exposure to a multi-extension FITS file in memory.
[in] | manager | Manager for the memory to write to. |
Definition at line 243 of file Exposure.cc.
void lsst.afw.image::Exposure< ImageT, MaskT, VarianceT >::writeFits | ( | fits::Fits & | fitsfile | ) | const |
Write an Exposure to an already-open FITS file object.
[in] | fitsfile | FITS object to write. |
Definition at line 249 of file Exposure.cc.
|
private |
Definition at line 301 of file Exposure.h.
|
private |
Definition at line 300 of file Exposure.h.