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>());
114 explicit Exposure(MaskedImageT& maskedImage,
115 std::shared_ptr<Wcs const> wcs = std::shared_ptr<Wcs const>());
124 explicit Exposure(MaskedImageT& maskedImage, std::shared_ptr<ExposureInfo> info);
180 bool const deep =
false);
186 template <
typename OtherPixelT>
190 :
lsst::daf::base::Citizen(typeid(this)),
191 _maskedImage(rhs.getMaskedImage(), deep),
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); }
223 int getWidth()
const {
return _maskedImage.getWidth(); }
225 int getHeight()
const {
return _maskedImage.getHeight(); }
234 int getX0()
const {
return _maskedImage.getX0(); }
240 int getY0()
const {
return _maskedImage.getY0(); }
265 void setMaskedImage(MaskedImageT& maskedImage);
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);
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; }
316 void writeFits(std::string
const& fileName)
const;
359 MaskedImageT _maskedImage;
360 std::shared_ptr<ExposureInfo> _info;
366 template <
typename ImagePixelT,
typename MaskPixelT,
typename VariancePixelT>
367 std::shared_ptr<Exposure<ImagePixelT, MaskPixelT, VariancePixelT>>
makeExposure(
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 getWidth() const
Return the Exposure's width.
void setFilter(Filter const &filter)
Set the Exposure's filter.
afw::table::PointKey< int > dimensions
std::shared_ptr< Calib const > getCalib() const
Return the Exposure's Calib object.
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.
int getHeight() const
Return the Exposure's height.
int getY0() const
Return the Exposure's row-origin.
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...
std::shared_ptr< ExposureInfo > getInfo()
Get the ExposureInfo that aggregates all the non-image components. Never null.
void setMetadata(std::shared_ptr< lsst::daf::base::PropertySet > metadata)
A simple struct that combines the two arguments that must be passed to most cfitsio routines and cont...
MaskedImage< ImageT, MaskT, VarianceT > MaskedImageT
bool hasWcs() const
Does this Exposure have a Wcs?
std::shared_ptr< ExposureInfo const > getInfo() const
Get the ExposureInfo that aggregates all the non-image components. Never null.
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() const
Return the MaskedImage.
A base class for image defects.
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.
MaskedImageT getMaskedImage()
Return the MaskedImage.
int getX0() const
Return the Exposure's column-origin.
Lifetime-management for memory that goes into FITS memory files.
std::shared_ptr< Wcs const > getWcs() const
std::shared_ptr< lsst::daf::base::PropertySet > getMetadata() const
Return flexible metadata.
bool hasPsf() const
Does this Exposure have a Psf?
std::int32_t MaskPixel
default type for Masks and MaskedImage Masks
Holds an integer identifier for an LSST filter.
geom::Point2I getXY0() const
Return the Exposure's origin.
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)/...
Filter getFilter() const
Return the Exposure's filter.
std::shared_ptr< lsst::afw::detection::Psf > getPsf()
Return the Exposure's Psf object.
void setDetector(std::shared_ptr< lsst::afw::cameraGeom::Detector const > detector)
Set the Exposure's Detector information.
std::shared_ptr< lsst::afw::detection::Psf const > getPsf() const
Return the Exposure's Psf object.
geom::Extent2I getDimensions() const
Return the Exposure's size.
void setPsf(std::shared_ptr< lsst::afw::detection::Psf const > psf)
Set the Exposure's Psf.
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::afw::cameraGeom::Detector const > getDetector() const
Return the Exposure's Detector information.
void setWcs(std::shared_ptr< Wcs > wcs)