LSSTApplications  16.0-11-g09ed895+2,16.0-11-g12e47bd,16.0-11-g9bb73b2+6,16.0-12-g5c924a4+6,16.0-14-g9a974b3+1,16.0-15-g1417920+1,16.0-15-gdd5ca33+1,16.0-16-gf0259e2,16.0-17-g31abd91+7,16.0-17-g7d7456e+7,16.0-17-ga3d2e9f+13,16.0-18-ga4d4bcb+1,16.0-18-gd06566c+1,16.0-2-g0febb12+21,16.0-2-g9d5294e+69,16.0-2-ga8830df+6,16.0-20-g21842373+7,16.0-24-g3eae5ec,16.0-28-gfc9ea6c+4,16.0-29-ge8801f9,16.0-3-ge00e371+34,16.0-4-g18f3627+13,16.0-4-g5f3a788+20,16.0-4-ga3eb747+10,16.0-4-gabf74b7+29,16.0-4-gb13d127+6,16.0-49-g42e581f7+6,16.0-5-g27fb78a+7,16.0-5-g6a53317+34,16.0-5-gb3f8a4b+87,16.0-6-g9321be7+4,16.0-6-gcbc7b31+42,16.0-6-gf49912c+29,16.0-7-gd2eeba5+51,16.0-71-ge89f8615e,16.0-8-g21fd5fe+29,16.0-8-g3a9f023+20,16.0-8-g4734f7a+1,16.0-8-g5858431+3,16.0-9-gf5c1f43+8,master-gd73dc1d098+1,w.2019.01
LSSTDataManagementBasePackage
ExposureInfo.h
Go to the documentation of this file.
1 // -*- LSST-C++ -*- // fixed format comment for emacs
2 /*
3  * LSST Data Management System
4  * Copyright 2008-2013 LSST Corporation.
5  *
6  * This product includes software developed by the
7  * LSST Project (http://www.lsst.org/).
8  *
9  * This program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the LSST License Statement and
20  * the GNU General Public License along with this program. If not,
21  * see <http://www.lsstcorp.org/LegalNotices/>.
22  */
23 
24 #ifndef LSST_AFW_IMAGE_ExposureInfo_h_INCLUDED
25 #define LSST_AFW_IMAGE_ExposureInfo_h_INCLUDED
26 
27 #include "lsst/base.h"
28 #include "lsst/daf/base.h"
29 #include "lsst/geom/Point.h"
30 #include "lsst/afw/image/Filter.h"
34 
35 namespace lsst {
36 namespace afw {
37 
38 namespace cameraGeom {
39 class Detector;
40 }
41 
42 namespace detection {
43 class Psf;
44 }
45 
46 namespace geom {
47 namespace polygon {
48 class Polygon;
49 class SkyWcs;
50 } // namespace polygon
51 } // namespace geom
52 
53 namespace fits {
54 class Fits;
55 }
56 
57 namespace image {
58 
59 class Calib;
60 class ApCorrMap;
61 class VisitInfo;
62 class TransmissionCurve;
63 
87 class ExposureInfo final {
88 public:
90  bool hasWcs() const { return static_cast<bool>(_wcs); }
91 
94 
97 
99  bool hasDetector() const { return static_cast<bool>(_detector); }
100 
103 
106 
108  Filter getFilter() const { return _filter; }
109 
111  void setFilter(Filter const& filter) { _filter = filter; }
112 
114  bool hasCalib() const { return static_cast<bool>(_calib); }
115 
117  std::shared_ptr<Calib> getCalib() { return _calib; }
118 
120  std::shared_ptr<Calib const> getCalib() const { return _calib; }
121 
123  void setCalib(std::shared_ptr<Calib const> calib) { _calib = _cloneCalib(calib); }
124 
127 
129  void setMetadata(std::shared_ptr<daf::base::PropertySet> metadata) { _metadata = metadata; }
130 
132  bool hasPsf() const { return static_cast<bool>(_psf); }
133 
135  std::shared_ptr<detection::Psf> getPsf() const { return _psf; }
136 
139  // Psfs are immutable, so this is always safe; it'd be better to always just pass around
140  // const or non-const pointers, instead of both, but this is more backwards-compatible.
142  }
143 
145  bool hasValidPolygon() const { return static_cast<bool>(_validPolygon); }
146 
149 
151  void setValidPolygon(std::shared_ptr<geom::polygon::Polygon const> polygon) { _validPolygon = polygon; }
152 
154  bool hasApCorrMap() const { return static_cast<bool>(_apCorrMap); }
155 
157  std::shared_ptr<ApCorrMap> getApCorrMap() { return _apCorrMap; }
158 
160  std::shared_ptr<ApCorrMap const> getApCorrMap() const { return _apCorrMap; }
161 
164 
171  void initApCorrMap();
172 
174  bool hasCoaddInputs() const { return static_cast<bool>(_coaddInputs); }
175 
177  void setCoaddInputs(std::shared_ptr<CoaddInputs> coaddInputs) { _coaddInputs = coaddInputs; }
178 
180  std::shared_ptr<CoaddInputs> getCoaddInputs() const { return _coaddInputs; }
181 
184 
186  bool hasVisitInfo() const { return static_cast<bool>(_visitInfo); }
187 
190 
192  bool hasTransmissionCurve() const { return static_cast<bool>(_transmissionCurve); }
193 
195  std::shared_ptr<TransmissionCurve const> getTransmissionCurve() const { return _transmissionCurve; }
196 
199 
207  explicit ExposureInfo(
215  Filter const& filter = Filter(),
224 
227  ExposureInfo(ExposureInfo&& other);
228 
230  ExposureInfo(ExposureInfo const& other, bool copyMetadata);
231 
233  ExposureInfo& operator=(ExposureInfo const& other);
234  ExposureInfo& operator=(ExposureInfo&& other);
235 
236  // Destructor defined in source file because we need access to destructors of forward-declared components
237  ~ExposureInfo();
238 
239 private:
240  template <typename ImageT, typename MaskT, typename VarianceT>
241  friend class Exposure;
242 
256  struct FitsWriteData {
261  table::io::OutputArchive archive;
262  };
263 
272  FitsWriteData _startWriteFits(lsst::geom::Point2I const& xy0 = lsst::geom::Point2I()) const;
273 
287  void _finishWriteFits(fits::Fits& fitsfile, FitsWriteData const& data) const;
288 
291 
294  std::shared_ptr<Calib> _calib;
297  Filter _filter;
299  std::shared_ptr<CoaddInputs> _coaddInputs;
300  std::shared_ptr<ApCorrMap> _apCorrMap;
302  std::shared_ptr<TransmissionCurve const> _transmissionCurve;
303 };
304 } // namespace image
305 } // namespace afw
306 } // namespace lsst
307 
308 #endif // !LSST_AFW_IMAGE_ExposureInfo_h_INCLUDED
void setMetadata(std::shared_ptr< daf::base::PropertySet > metadata)
Set the flexible metadata.
Definition: ExposureInfo.h:129
char * data
Definition: BaseTable.cc:205
bool hasTransmissionCurve() const
Does this exposure have a transmission curve?
Definition: ExposureInfo.h:192
Key< int > visitInfo
Definition: Exposure.cc:68
void setCalib(std::shared_ptr< Calib const > calib)
Set the Exposure&#39;s Calib object.
Definition: ExposureInfo.h:123
void setWcs(std::shared_ptr< geom::SkyWcs const > wcs)
Set the WCS of the exposure.
Definition: ExposureInfo.h:96
A class to contain the data, WCS, and other information needed to describe an image of the sky...
Definition: Exposure.h:72
void setVisitInfo(std::shared_ptr< image::VisitInfo const > const visitInfo)
Set the exposure&#39;s visit info.
Definition: ExposureInfo.h:189
bool hasCalib() const
Does this exposure have a Calib?
Definition: ExposureInfo.h:114
std::shared_ptr< image::VisitInfo const > getVisitInfo() const
Return the exposure&#39;s visit info.
Definition: ExposureInfo.h:183
bool hasPsf() const
Does this exposure have a Psf?
Definition: ExposureInfo.h:132
std::shared_ptr< ApCorrMap > getApCorrMap()
Return the exposure&#39;s aperture correction map (null pointer if !hasApCorrMap())
Definition: ExposureInfo.h:157
void setDetector(std::shared_ptr< cameraGeom::Detector const > detector)
Set the exposure&#39;s Detector information.
Definition: ExposureInfo.h:105
bool hasDetector() const
Does this exposure have Detector information?
Definition: ExposureInfo.h:99
void setCoaddInputs(std::shared_ptr< CoaddInputs > coaddInputs)
Set the exposure&#39;s coadd provenance catalogs.
Definition: ExposureInfo.h:177
A simple struct that combines the two arguments that must be passed to most cfitsio routines and cont...
Definition: fits.h:296
bool hasWcs() const
Does this exposure have a Wcs?
Definition: ExposureInfo.h:90
table::Key< table::Array< std::uint8_t > > wcs
Definition: SkyWcs.cc:71
Fits * fits
Definition: FitsWriter.cc:90
A multi-catalog archive object used to save table::io::Persistable objects.
Definition: OutputArchive.h:34
void setValidPolygon(std::shared_ptr< geom::polygon::Polygon const > polygon)
Set the exposure&#39;s valid Polygon.
Definition: ExposureInfo.h:151
bool hasApCorrMap() const
Return true if the exposure has an aperture correction map.
Definition: ExposureInfo.h:154
bool hasVisitInfo() const
Does this exposure have visit info?
Definition: ExposureInfo.h:186
void setPsf(std::shared_ptr< detection::Psf const > psf)
Set the exposure&#39;s point-spread function.
Definition: ExposureInfo.h:138
A base class for image defects.
Definition: cameraGeom.dox:3
std::shared_ptr< detection::Psf > getPsf() const
Return the exposure&#39;s point-spread function.
Definition: ExposureInfo.h:135
void setTransmissionCurve(std::shared_ptr< TransmissionCurve const > tc)
Set the exposure&#39;s transmission curve.
Definition: ExposureInfo.h:198
Basic LSST definitions.
void setFilter(Filter const &filter)
Set the exposure&#39;s filter.
Definition: ExposureInfo.h:111
bool hasValidPolygon() const
Does this exposure have a valid Polygon.
Definition: ExposureInfo.h:145
table::Key< int > detector
T const_pointer_cast(T... args)
std::shared_ptr< geom::polygon::Polygon const > getValidPolygon() const
Return the valid Polygon.
Definition: ExposureInfo.h:148
Holds an integer identifier for an LSST filter.
Definition: Filter.h:141
std::shared_ptr< daf::base::PropertySet > getMetadata() const
Return flexible metadata.
Definition: ExposureInfo.h:126
std::shared_ptr< Calib const > getCalib() const
Return the exposure&#39;s photometric calibration.
Definition: ExposureInfo.h:120
Key< int > apCorrMap
Definition: Exposure.cc:66
std::shared_ptr< cameraGeom::Detector const > getDetector() const
Return the exposure&#39;s Detector information.
Definition: ExposureInfo.h:102
std::shared_ptr< Calib > getCalib()
Return the exposure&#39;s photometric calibration.
Definition: ExposureInfo.h:117
void setApCorrMap(std::shared_ptr< ApCorrMap > apCorrMap)
Set the exposure&#39;s aperture correction map (null pointer if !hasApCorrMap())
Definition: ExposureInfo.h:163
ItemVariant const * other
Definition: Schema.cc:56
std::shared_ptr< ApCorrMap const > getApCorrMap() const
Return the exposure&#39;s aperture correction map (null pointer if !hasApCorrMap())
Definition: ExposureInfo.h:160
A collection of all the things that make an Exposure different from a MaskedImage.
Definition: ExposureInfo.h:87
A polymorphic base class for representing an image&#39;s Point Spread Function.
Definition: Psf.h:75
std::shared_ptr< CoaddInputs > getCoaddInputs() const
Return a pair of catalogs that record the inputs, if this Exposure is a coadd (otherwise null)...
Definition: ExposureInfo.h:180
Key< int > psf
Definition: Exposure.cc:64
std::shared_ptr< geom::SkyWcs const > getWcs() const
Return the WCS of the exposure.
Definition: ExposureInfo.h:93
Filter getFilter() const
Return the exposure&#39;s filter.
Definition: ExposureInfo.h:108
bool hasCoaddInputs() const
Does this exposure have coadd provenance catalogs?
Definition: ExposureInfo.h:174
std::shared_ptr< TransmissionCurve const > getTransmissionCurve() const
Return the exposure&#39;s transmission curve.
Definition: ExposureInfo.h:195