LSSTApplications  16.0-10-g0ee56ad+5,16.0-11-ga33d1f2+5,16.0-12-g3ef5c14+3,16.0-12-g71e5ef5+18,16.0-12-gbdf3636+3,16.0-13-g118c103+3,16.0-13-g8f68b0a+3,16.0-15-gbf5c1cb+4,16.0-16-gfd17674+3,16.0-17-g7c01f5c+3,16.0-18-g0a50484+1,16.0-20-ga20f992+8,16.0-21-g0e05fd4+6,16.0-21-g15e2d33+4,16.0-22-g62d8060+4,16.0-22-g847a80f+4,16.0-25-gf00d9b8+1,16.0-28-g3990c221+4,16.0-3-gf928089+3,16.0-32-g88a4f23+5,16.0-34-gd7987ad+3,16.0-37-gc7333cb+2,16.0-4-g10fc685+2,16.0-4-g18f3627+26,16.0-4-g5f3a788+26,16.0-5-gaf5c3d7+4,16.0-5-gcc1f4bb+1,16.0-6-g3b92700+4,16.0-6-g4412fcd+3,16.0-6-g7235603+4,16.0-69-g2562ce1b+2,16.0-8-g14ebd58+4,16.0-8-g2df868b+1,16.0-8-g4cec79c+6,16.0-8-gadf6c7a+1,16.0-8-gfc7ad86,16.0-82-g59ec2a54a+1,16.0-9-g5400cdc+2,16.0-9-ge6233d7+5,master-g2880f2d8cf+3,v17.0.rc1
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 
201  static int getFitsSerializationVersion();
202 
204  static std::string const& getFitsSerializationVersionName();
205 
213  explicit ExposureInfo(
221  Filter const& filter = Filter(),
230 
233  ExposureInfo(ExposureInfo&& other);
234 
236  ExposureInfo(ExposureInfo const& other, bool copyMetadata);
237 
239  ExposureInfo& operator=(ExposureInfo const& other);
240  ExposureInfo& operator=(ExposureInfo&& other);
241 
242  // Destructor defined in source file because we need access to destructors of forward-declared components
243  ~ExposureInfo();
244 
245 private:
246  template <typename ImageT, typename MaskT, typename VarianceT>
247  friend class Exposure;
248 
262  struct FitsWriteData {
267  table::io::OutputArchive archive;
268  };
269 
278  FitsWriteData _startWriteFits(lsst::geom::Point2I const& xy0 = lsst::geom::Point2I()) const;
279 
293  void _finishWriteFits(fits::Fits& fitsfile, FitsWriteData const& data) const;
294 
297 
300  std::shared_ptr<Calib> _calib;
303  Filter _filter;
305  std::shared_ptr<CoaddInputs> _coaddInputs;
306  std::shared_ptr<ApCorrMap> _apCorrMap;
308  std::shared_ptr<TransmissionCurve const> _transmissionCurve;
309 };
310 } // namespace image
311 } // namespace afw
312 } // namespace lsst
313 
314 #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
STL class.
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.
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
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
Basic LSST definitions.
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