25 #ifndef LSST_AFW_IMAGE_EXPOSURE_H
26 #define LSST_AFW_IMAGE_EXPOSURE_H
30 #include "lsst/base.h"
31 #include "lsst/daf/base.h"
38 namespace formatters {
39 template <
typename ImageT,
typename MaskT,
typename VarianceT>
40 class ExposureFormatter;
76 class Exposure :
public lsst::daf::base::Persistable,
public lsst::daf::base::Citizen {
88 explicit Exposure(
unsigned int width,
unsigned int height,
89 std::shared_ptr<Wcs const> wcs = std::shared_ptr<Wcs const>());
98 std::shared_ptr<Wcs const> wcs = std::shared_ptr<Wcs const>());
107 std::shared_ptr<Wcs const> wcs = std::shared_ptr<Wcs const>());
115 std::shared_ptr<Wcs const> wcs = std::shared_ptr<Wcs const>());
180 bool const deep =
false);
186 template <
typename OtherPixelT>
190 : lsst::daf::base::Citizen(typeid(this)),
194 throw LSST_EXCEPT(lsst::pex::exceptions::InvalidParameterError,
195 "Exposure's converting copy constructor must make a deep copy");
209 std::shared_ptr<Wcs const>
getWcs()
const {
return _info->getWcs(); }
210 std::shared_ptr<Wcs>
getWcs() {
return _info->getWcs(); }
213 std::shared_ptr<lsst::afw::cameraGeom::Detector const>
getDetector()
const {
214 return _info->getDetector();
219 std::shared_ptr<lsst::daf::base::PropertySet>
getMetadata()
const {
return _info->getMetadata(); }
220 void setMetadata(std::shared_ptr<lsst::daf::base::PropertySet> metadata) { _info->setMetadata(metadata); }
266 void setWcs(std::shared_ptr<Wcs> wcs) { _info->setWcs(wcs); }
268 void setDetector(std::shared_ptr<lsst::afw::cameraGeom::Detector const> detector) {
269 _info->setDetector(detector);
274 void setCalib(std::shared_ptr<Calib> calib) { _info->setCalib(calib); }
276 std::shared_ptr<Calib>
getCalib() {
return _info->getCalib(); }
278 std::shared_ptr<Calib const>
getCalib()
const {
return _info->getCalib(); }
280 void setPsf(std::shared_ptr<lsst::afw::detection::Psf const> psf) { _info->setPsf(psf); }
283 std::shared_ptr<lsst::afw::detection::Psf>
getPsf() {
return _info->getPsf(); }
285 std::shared_ptr<lsst::afw::detection::Psf const>
getPsf()
const {
return _info->getPsf(); }
288 bool hasPsf()
const {
return _info->hasPsf(); }
291 bool hasWcs()
const {
return _info->hasWcs(); }
294 std::shared_ptr<ExposureInfo>
getInfo() {
return _info; }
297 std::shared_ptr<ExposureInfo const>
getInfo()
const {
return _info; }
300 void setInfo(std::shared_ptr<ExposureInfo> exposureInfo) { _info = exposureInfo; }
316 void writeFits(std::string
const& fileName)
const;
357 void _readFits(fits::Fits& fitsfile, geom::Box2I const& bbox,
ImageOrigin origin,
bool conformMasks);
366 template <typename ImagePixelT, typename MaskPixelT, typename VariancePixelT>
368 MaskedImage<ImagePixelT, MaskPixelT, VariancePixelT>& mimage,
369 std::shared_ptr<
Wcs const> wcs = std::shared_ptr<
Wcs const>()
371 return typename std::shared_ptr<Exposure<ImagePixelT, MaskPixelT, VariancePixelT>>(
378 #endif // LSST_AFW_IMAGE_EXPOSURE_H
int getHeight() const
Return the Exposure's height.
void setFilter(Filter const &filter)
Set the Exposure's filter.
afw::table::PointKey< int > dimensions
virtual ~Exposure()
Destructor.
geom::Point2I getXY0() const
Return the Exposure's origin.
geom::Box2I getBBox(ImageOrigin const origin=PARENT) const
void setInfo(std::shared_ptr< ExposureInfo > exposureInfo)
Set the ExposureInfo that aggregates all the non-image components.
std::shared_ptr< lsst::afw::detection::Psf const > getPsf() const
Return the Exposure's Psf object.
void setCalib(std::shared_ptr< Calib > calib)
Set the Exposure's Calib object.
A class to contain the data, WCS, and other information needed to describe an image of the sky...
int getHeight() const
Return the number of rows in the image.
bool hasWcs() const
Does this Exposure have a Wcs?
int getX0() const
Return the image's column-origin.
std::shared_ptr< ExposureInfo > getInfo()
Get the ExposureInfo that aggregates all the non-image components. Never null.
void setXY0(geom::Point2I const &origin)
Set the Exposure's origin (including correcting the Wcs)
bool hasPsf() const
Does this Exposure have a Psf?
geom::Box2I getBBox(ImageOrigin const origin=PARENT) const
void setMetadata(std::shared_ptr< lsst::daf::base::PropertySet > metadata)
void writeFits(std::string const &fileName) const
Write an Exposure to a regular multi-extension FITS file.
Exposure(unsigned int width, unsigned int height, std::shared_ptr< Wcs const > wcs=std::shared_ptr< Wcs const >())
Construct an Exposure with a blank MaskedImage of specified size (default 0x0) and a Wcs (which may b...
Implementation of the WCS standard for a any projection.
int getX0() const
Return the Exposure's column-origin.
std::shared_ptr< Exposure< ImagePixelT, MaskPixelT, VariancePixelT > > makeExposure(MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > &mimage, std::shared_ptr< Wcs const > wcs=std::shared_ptr< Wcs const >())
A function to return an Exposure of the correct type (cf.
geom::Extent2I getDimensions() const
Return the Exposure's size.
A simple struct that combines the two arguments that must be passed to most cfitsio routines and cont...
MaskedImage< ImageT, MaskT, VarianceT > MaskedImageT
MaskedImageT getMaskedImage() const
Return the MaskedImage.
geom::Extent2I getDimensions() const
static Exposure readFits(fits::MemFileManager &manager)
Read an Exposure from a FITS RAM file.
An integer coordinate rectangle.
std::shared_ptr< Wcs > getWcs()
MaskedImageT getMaskedImage()
Return the MaskedImage.
Lifetime-management for memory that goes into FITS memory files.
std::shared_ptr< lsst::afw::cameraGeom::Detector const > getDetector() const
Return the Exposure's Detector information.
void setMaskedImage(MaskedImageT &maskedImage)
Set the MaskedImage of the Exposure.
Filter getFilter() const
Return the Exposure's filter.
std::shared_ptr< ExposureInfo const > getInfo() const
Get the ExposureInfo that aggregates all the non-image components. Never null.
std::int32_t MaskPixel
default type for Masks and MaskedImage Masks
Holds an integer identifier for an LSST filter.
int getY0() const
Return the Exposure's row-origin.
void setDetector(std::shared_ptr< lsst::afw::cameraGeom::Detector const > detector)
Set the Exposure's Detector information.
std::shared_ptr< Calib const > getCalib() const
Return the Exposure's Calib object.
std::shared_ptr< Calib > getCalib()
Return the Exposure's Calib object.
static Exposure readFits(std::string const &filename)
Read an Exposure from a regular FITS file.
Exposure(Exposure< OtherPixelT, MaskT, VarianceT > const &rhs, const bool deep)
generalised copy constructor; defined here in the header so that the compiler can instantiate N(N-1)/...
std::shared_ptr< Wcs const > getWcs() const
std::shared_ptr< lsst::afw::detection::Psf > getPsf()
Return the Exposure's Psf object.
int getWidth() const
Return the Exposure's width.
geom::Point2I getXY0() const
Return the image's origin.
void setPsf(std::shared_ptr< lsst::afw::detection::Psf const > psf)
Set the Exposure's Psf.
int getWidth() const
Return the number of columns in the image.
int getY0() const
Return the image's row-origin.
A collection of all the things that make an Exposure different from a MaskedImage.
float VariancePixel
default type for MaskedImage variance images
std::shared_ptr< lsst::daf::base::PropertySet > getMetadata() const
Return flexible metadata.
void setWcs(std::shared_ptr< Wcs > wcs)