lsst.jointcal  15.0-7-gab4c137+2
CcdImage.h
Go to the documentation of this file.
1 // -*- LSST-C++ -*-
2 #ifndef LSST_JOINTCAL_CCD_IMAGE_H
3 #define LSST_JOINTCAL_CCD_IMAGE_H
4 
5 #include <list>
6 #include <string>
7 
10 #include "lsst/afw/geom/SkyWcs.h"
14 #include "lsst/afw/geom/Box.h"
17 #include "lsst/jointcal/Gtransfo.h"
18 #include "lsst/jointcal/Frame.h"
19 
20 namespace lsst {
21 namespace jointcal {
22 
24 
25 typedef int VisitIdType;
26 typedef int CcdIdType;
29 std::ostream &operator<<(std::ostream &out, CcdImageKey const &key);
30 
35 class CcdImage {
36 public:
39  std::string const &filter, std::shared_ptr<afw::image::PhotoCalib> photoCalib,
40  std::shared_ptr<afw::cameraGeom::Detector> detector, int visit, int ccd,
41  std::string const &fluxField);
42 
44  CcdImage(CcdImage const &) = delete;
45  CcdImage(CcdImage &&) = delete;
46  CcdImage &operator=(CcdImage const &) = delete;
47  CcdImage &operator=(CcdImage &&) = delete;
48 
50  std::string getName() const { return _name; }
51 
57  MeasuredStarList const &getWholeCatalog() const { return _wholeCatalog; }
58 
60 
65  MeasuredStarList const &getCatalogForFit() const { return _catalogForFit; }
66  MeasuredStarList &getCatalogForFit() { return _catalogForFit; }
68 
73  }
74 
80  void setCommonTangentPoint(Point const &commonTangentPoint);
81 
87  Point const &getCommonTangentPoint() const { return _commonTangentPoint; }
88 
90  Gtransfo const *getPix2CommonTangentPlane() const { return _pix2CommonTangentPlane.get(); }
91 
93  Gtransfo const *getCommonTangentPlane2TP() const { return _CTP2TP.get(); }
94 
96  Gtransfo const *getTP2CommonTangentPlane() const { return _TP2CTP.get(); }
97 
99  Gtransfo const *getPix2TangentPlane() const { return _pix2TP.get(); }
100 
102  Gtransfo const *getSky2TP() const { return _sky2TP.get(); }
103 
105  CcdIdType getCcdId() const { return _ccdId; }
106 
108  VisitIdType getVisit() const { return _visit; }
109 
111 
112  CcdImageKey getHashKey() const { return CcdImageKey(_visit, _ccdId); }
113 
115  double getAirMass() const { return _airMass; }
116 
118  double getMjd() const { return _mjd; }
119 
122 
126  lsst::afw::geom::SpherePoint getBoresightRaDec() const { return _boresightRaDec; }
127 
129  double getHourAngle() const { return _hourAngle; }
130 
132  double getSinEta() const { return _sineta; }
133 
135  double getCosEta() const { return _coseta; }
136 
138  double getTanZ() const { return _tgz; }
139 
141  Point getRefractionVector() const { return Point(_tgz * _coseta, _tgz * _sineta); }
142 
144  std::string getFilter() const { return _filter; }
145 
147  Gtransfo const *readWCS() const { return _readWcs.get(); }
148 
150  Frame const &getImageFrame() const { return _imageFrame; }
151 
152 private:
154  std::string const &fluxField);
155 
156  Frame _imageFrame; // in pixels
157 
158  MeasuredStarList _wholeCatalog; // the catalog of measured objets
159  MeasuredStarList _catalogForFit;
160 
161  std::shared_ptr<GtransfoSkyWcs> _readWcs; // apply goes from pix to sky
162 
163  // The following ones should probably be mostly removed.
164  std::shared_ptr<Gtransfo> _CTP2TP; // go from CommonTangentPlane to this tangent plane.
165  std::shared_ptr<Gtransfo> _TP2CTP; // reverse one
166  std::shared_ptr<Gtransfo> _pix2CommonTangentPlane; // pixels -> CTP
168 
170 
171  std::string _name;
172  CcdIdType _ccdId;
173  VisitIdType _visit;
174 
175  lsst::afw::geom::SpherePoint _boresightRaDec;
176  double _airMass; // airmass value.
177  double _mjd; // modified julian date
180  // refraction
181  // eta : parallactic angle, z: zenithal angle (X = 1/cos(z))
182  double _sineta, _coseta, _tgz;
183  // Local Sidereal Time and hour angle of observation
184  double _lstObs, _hourAngle;
185 
186  std::string _filter;
187 
188  Point _commonTangentPoint;
189 };
190 } // namespace jointcal
191 } // namespace lsst
192 
193 // Add our preferred hash of CcdImageKey to the std:: namespace, so it's always available "for free".
194 namespace std {
195 template <>
204  return hash<size_t>()(static_cast<size_t>(ccdImage.first) |
205  (static_cast<size_t>(ccdImage.second) << 32));
206  }
207 };
208 } // namespace std
209 
210 #endif // LSST_JOINTCAL_CCD_IMAGE_H
VisitIdType getVisit() const
returns visit ID
Definition: CcdImage.h:108
Gtransfo const * getCommonTangentPlane2TP() const
Definition: CcdImage.h:93
std::ostream & operator<<(std::ostream &out, CcdImageKey const &key)
Definition: CcdImage.cc:28
A point in a plane.
Definition: Point.h:13
Gtransfo const * getSky2TP() const
Definition: CcdImage.h:102
double getCosEta() const
Parallactic angle.
Definition: CcdImage.h:135
std::string getName() const
Return the _name that identifies this ccdImage.
Definition: CcdImage.h:50
Gtransfo const * getPix2CommonTangentPlane() const
Definition: CcdImage.h:90
double getMjd() const
Julian Date.
Definition: CcdImage.h:118
STL namespace.
CcdIdType getCcdId() const
returns ccd ID
Definition: CcdImage.h:105
Gtransfo const * getPix2TangentPlane() const
Definition: CcdImage.h:99
double getSinEta() const
Parallactic angle.
Definition: CcdImage.h:132
A list of MeasuredStar. They are usually filled in Associations::AddImage.
Definition: MeasuredStar.h:113
STL class.
void resetCatalogForFit()
Clear the catalog for fitting and set it to a copy of the whole catalog.
Definition: CcdImage.h:70
CcdImage & operator=(CcdImage const &)=delete
std::shared_ptr< afw::image::PhotoCalib > getPhotoCalib() const
Return the exposure&#39;s photometric calibration.
Definition: CcdImage.h:121
lsst::afw::geom::SpherePoint getBoresightRaDec() const
Gets the boresight RA/Dec.
Definition: CcdImage.h:126
std::pair< VisitIdType, CcdIdType > CcdImageKey
For hashing a ccdImage: the pair of (visit, ccd) IDs should be unique to each ccdImage.
Definition: CcdImage.h:28
rectangle with sides parallel to axes.
Definition: Frame.h:15
table::Key< table::Array< std::uint8_t > > wcs
MeasuredStarList & getCatalogForFit()
Gets the catalog to be used for fitting, which may have been cleaned-up.
Definition: CcdImage.h:66
Class for a simple mapping implementing a generic Gtransfo.
Gtransfo const * getTP2CommonTangentPlane() const
Definition: CcdImage.h:96
T clear(T... args)
double getHourAngle() const
Definition: CcdImage.h:129
STL class.
double getAirMass() const
Airmass.
Definition: CcdImage.h:115
void copyTo(StarList< Star > &copy) const
clears copy and makes a copy of the std::list to copy
Definition: StarList.cc:44
Key< int > visitInfo
double getTanZ() const
Parallactic angle.
Definition: CcdImage.h:138
CcdImage(afw::table::SourceCatalog &record, std::shared_ptr< lsst::afw::geom::SkyWcs > wcs, std::shared_ptr< lsst::afw::image::VisitInfo > visitInfo, afw::geom::Box2I const &bbox, std::string const &filter, std::shared_ptr< afw::image::PhotoCalib > photoCalib, std::shared_ptr< afw::cameraGeom::Detector > detector, int visit, int ccd, std::string const &fluxField)
Definition: CcdImage.cc:85
Point getRefractionVector() const
Definition: CcdImage.h:141
MeasuredStarList const & getCatalogForFit() const
Gets the catalog to be used for fitting, which may have been cleaned-up.
Definition: CcdImage.h:65
a virtual (interface) class for geometric transformations.
Definition: Gtransfo.h:42
std::string getFilter() const
return the CcdImage filter name
Definition: CcdImage.h:144
size_t operator()(lsst::jointcal::CcdImageKey const &ccdImage) const
Definition: CcdImage.h:203
Gtransfo const * readWCS() const
the wcs read in the header. NOT updated when fitting.
Definition: CcdImage.h:147
table::Box2IKey bbox
std::list< std::shared_ptr< CcdImage > > CcdImageList
Definition: CcdImage.h:23
int VisitIdType
Definition: CcdImage.h:25
CcdImageKey getHashKey() const
Definition: CcdImage.h:112
std::shared_ptr< afw::cameraGeom::Detector > getDetector() const
Definition: CcdImage.h:110
Handler of an actual image from a single CCD.
Definition: CcdImage.h:35
STL class.
Point const & getCommonTangentPoint() const
Gets the common tangent point, shared between all ccdImages.
Definition: CcdImage.h:87
MeasuredStarList const & getWholeCatalog() const
Gets the as-read catalog.
Definition: CcdImage.h:57
void setCommonTangentPoint(Point const &commonTangentPoint)
Sets the common tangent point and computes necessary transforms.
Definition: CcdImage.cc:133
Frame const & getImageFrame() const
Frame in pixels.
Definition: CcdImage.h:150