LSSTApplications  17.0+11,17.0+34,17.0+56,17.0+57,17.0+59,17.0+7,17.0-1-g377950a+33,17.0.1-1-g114240f+2,17.0.1-1-g4d4fbc4+28,17.0.1-1-g55520dc+49,17.0.1-1-g5f4ed7e+52,17.0.1-1-g6dd7d69+17,17.0.1-1-g8de6c91+11,17.0.1-1-gb9095d2+7,17.0.1-1-ge9fec5e+5,17.0.1-1-gf4e0155+55,17.0.1-1-gfc65f5f+50,17.0.1-1-gfc6fb1f+20,17.0.1-10-g87f9f3f+1,17.0.1-11-ge9de802+16,17.0.1-16-ga14f7d5c+4,17.0.1-17-gc79d625+1,17.0.1-17-gdae4c4a+8,17.0.1-2-g26618f5+29,17.0.1-2-g54f2ebc+9,17.0.1-2-gf403422+1,17.0.1-20-g2ca2f74+6,17.0.1-23-gf3eadeb7+1,17.0.1-3-g7e86b59+39,17.0.1-3-gb5ca14a,17.0.1-3-gd08d533+40,17.0.1-30-g596af8797,17.0.1-4-g59d126d+4,17.0.1-4-gc69c472+5,17.0.1-6-g5afd9b9+4,17.0.1-7-g35889ee+1,17.0.1-7-gc7c8782+18,17.0.1-9-gc4bbfb2+3,w.2019.22
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 PhotoCalib;
60 class ApCorrMap;
61 class VisitInfo;
62 class TransmissionCurve;
63 
88 class ExposureInfo final {
89 public:
91  bool hasWcs() const { return static_cast<bool>(_wcs); }
92 
95 
98 
100  bool hasDetector() const { return static_cast<bool>(_detector); }
101 
104 
107 
109  Filter getFilter() const { return _filter; }
110 
112  void setFilter(Filter const& filter) { _filter = filter; }
113 
115  bool hasPhotoCalib() const { return static_cast<bool>(_photoCalib); }
116 
118  std::shared_ptr<PhotoCalib const> getPhotoCalib() const { return _photoCalib; }
119 
122 
124  [[deprecated("Replaced with hasPhotoCalib (will be removed in 18.0)")]] bool hasCalib() const {
125  return static_cast<bool>(_photoCalib);
126  }
127 
129  [[deprecated("Replaced with getPhotoCalib (will be removed in 18.0)")]] std::shared_ptr<PhotoCalib const>
130  getCalib() const {
131  return _photoCalib;
132  }
133 
135  [[deprecated("Replaced with setPhotoCalib (will be removed in 18.0)")]] void setCalib(
137  _photoCalib = photoCalib;
138  }
139 
142 
144  void setMetadata(std::shared_ptr<daf::base::PropertySet> metadata) { _metadata = metadata; }
145 
147  bool hasPsf() const { return static_cast<bool>(_psf); }
148 
150  std::shared_ptr<detection::Psf> getPsf() const { return _psf; }
151 
154  // Psfs are immutable, so this is always safe; it'd be better to always just pass around
155  // const or non-const pointers, instead of both, but this is more backwards-compatible.
157  }
158 
160  bool hasValidPolygon() const { return static_cast<bool>(_validPolygon); }
161 
164 
166  void setValidPolygon(std::shared_ptr<geom::polygon::Polygon const> polygon) { _validPolygon = polygon; }
167 
169  bool hasApCorrMap() const { return static_cast<bool>(_apCorrMap); }
170 
172  std::shared_ptr<ApCorrMap> getApCorrMap() { return _apCorrMap; }
173 
175  std::shared_ptr<ApCorrMap const> getApCorrMap() const { return _apCorrMap; }
176 
179 
186  void initApCorrMap();
187 
189  bool hasCoaddInputs() const { return static_cast<bool>(_coaddInputs); }
190 
192  void setCoaddInputs(std::shared_ptr<CoaddInputs> coaddInputs) { _coaddInputs = coaddInputs; }
193 
195  std::shared_ptr<CoaddInputs> getCoaddInputs() const { return _coaddInputs; }
196 
199 
201  bool hasVisitInfo() const { return static_cast<bool>(_visitInfo); }
202 
205 
207  bool hasTransmissionCurve() const { return static_cast<bool>(_transmissionCurve); }
208 
210  std::shared_ptr<TransmissionCurve const> getTransmissionCurve() const { return _transmissionCurve; }
211 
214 
216  static int getFitsSerializationVersion();
217 
219  static std::string const& getFitsSerializationVersionName();
220 
228  explicit ExposureInfo(
236  Filter const& filter = Filter(),
245 
248  ExposureInfo(ExposureInfo&& other);
249 
251  ExposureInfo(ExposureInfo const& other, bool copyMetadata);
252 
254  ExposureInfo& operator=(ExposureInfo const& other);
255  ExposureInfo& operator=(ExposureInfo&& other);
256 
257  // Destructor defined in source file because we need access to destructors of forward-declared components
258  ~ExposureInfo();
259 
260 private:
261  template <typename ImageT, typename MaskT, typename VarianceT>
262  friend class Exposure;
263 
277  struct FitsWriteData {
282  table::io::OutputArchive archive;
283  };
284 
293  FitsWriteData _startWriteFits(lsst::geom::Point2I const& xy0 = lsst::geom::Point2I()) const;
294 
308  void _finishWriteFits(fits::Fits& fitsfile, FitsWriteData const& data) const;
309 
311 
317  Filter _filter;
319  std::shared_ptr<CoaddInputs> _coaddInputs;
320  std::shared_ptr<ApCorrMap> _apCorrMap;
322  std::shared_ptr<TransmissionCurve const> _transmissionCurve;
323 };
324 } // namespace image
325 } // namespace afw
326 } // namespace lsst
327 
328 #endif // !LSST_AFW_IMAGE_ExposureInfo_h_INCLUDED
void setMetadata(std::shared_ptr< daf::base::PropertySet > metadata)
Set the flexible metadata.
Definition: ExposureInfo.h:144
bool hasTransmissionCurve() const
Does this exposure have a transmission curve?
Definition: ExposureInfo.h:207
Key< int > visitInfo
Definition: Exposure.cc:70
void setWcs(std::shared_ptr< geom::SkyWcs const > wcs)
Set the WCS of the exposure.
Definition: ExposureInfo.h:97
void setCalib(std::shared_ptr< PhotoCalib const > photoCalib)
Set the Exposure&#39;s PhotoCalib object.
Definition: ExposureInfo.h:135
Basic LSST definitions.
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:204
std::shared_ptr< PhotoCalib const > getPhotoCalib() const
Return the exposure&#39;s photometric calibration.
Definition: ExposureInfo.h:118
bool hasCalib() const
Does this exposure have a photometric calibration?
Definition: ExposureInfo.h:124
std::shared_ptr< image::VisitInfo const > getVisitInfo() const
Return the exposure&#39;s visit info.
Definition: ExposureInfo.h:198
bool hasPsf() const
Does this exposure have a Psf?
Definition: ExposureInfo.h:147
std::shared_ptr< ApCorrMap > getApCorrMap()
Return the exposure&#39;s aperture correction map (null pointer if !hasApCorrMap())
Definition: ExposureInfo.h:172
void setDetector(std::shared_ptr< cameraGeom::Detector const > detector)
Set the exposure&#39;s Detector information.
Definition: ExposureInfo.h:106
Key< int > photoCalib
Definition: Exposure.cc:67
bool hasDetector() const
Does this exposure have Detector information?
Definition: ExposureInfo.h:100
void setCoaddInputs(std::shared_ptr< CoaddInputs > coaddInputs)
Set the exposure&#39;s coadd provenance catalogs.
Definition: ExposureInfo.h:192
A simple struct that combines the two arguments that must be passed to most cfitsio routines and cont...
Definition: fits.h:297
bool hasWcs() const
Does this exposure have a Wcs?
Definition: ExposureInfo.h:91
table::Key< table::Array< std::uint8_t > > wcs
Definition: SkyWcs.cc:71
Fits * fits
Definition: FitsWriter.cc:90
std::shared_ptr< PhotoCalib const > getCalib() const
Return the exposure&#39;s photometric calibration.
Definition: ExposureInfo.h:130
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:166
bool hasApCorrMap() const
Return true if the exposure has an aperture correction map.
Definition: ExposureInfo.h:169
bool hasVisitInfo() const
Does this exposure have visit info?
Definition: ExposureInfo.h:201
void setPsf(std::shared_ptr< detection::Psf const > psf)
Set the exposure&#39;s point-spread function.
Definition: ExposureInfo.h:153
A base class for image defects.
std::shared_ptr< detection::Psf > getPsf() const
Return the exposure&#39;s point-spread function.
Definition: ExposureInfo.h:150
char * data
Definition: BaseRecord.cc:62
void setTransmissionCurve(std::shared_ptr< TransmissionCurve const > tc)
Set the exposure&#39;s transmission curve.
Definition: ExposureInfo.h:213
void setPhotoCalib(std::shared_ptr< PhotoCalib const > photoCalib)
Set the Exposure&#39;s PhotoCalib object.
Definition: ExposureInfo.h:121
void setFilter(Filter const &filter)
Set the exposure&#39;s filter.
Definition: ExposureInfo.h:112
bool hasValidPolygon() const
Does this exposure have a valid Polygon.
Definition: ExposureInfo.h:160
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:163
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:141
Key< int > apCorrMap
Definition: Exposure.cc:68
std::shared_ptr< cameraGeom::Detector const > getDetector() const
Return the exposure&#39;s Detector information.
Definition: ExposureInfo.h:103
void setApCorrMap(std::shared_ptr< ApCorrMap > apCorrMap)
Set the exposure&#39;s aperture correction map (null pointer if !hasApCorrMap())
Definition: ExposureInfo.h:178
bool hasPhotoCalib() const
Does this exposure have a photometric calibration?
Definition: ExposureInfo.h:115
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:175
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects...
A collection of all the things that make an Exposure different from a MaskedImage.
Definition: ExposureInfo.h:88
A polymorphic base class for representing an image&#39;s Point Spread Function.
Definition: Psf.h:76
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:195
Key< int > psf
Definition: Exposure.cc:65
std::shared_ptr< geom::SkyWcs const > getWcs() const
Return the WCS of the exposure.
Definition: ExposureInfo.h:94
Filter getFilter() const
Return the exposure&#39;s filter.
Definition: ExposureInfo.h:109
bool hasCoaddInputs() const
Does this exposure have coadd provenance catalogs?
Definition: ExposureInfo.h:189
std::shared_ptr< TransmissionCurve const > getTransmissionCurve() const
Return the exposure&#39;s transmission curve.
Definition: ExposureInfo.h:210