lsst.jointcal  14.0-14-g932474c+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/image/TanWcs.h"
13 #include "lsst/afw/coord/Coord.h"
15 #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 
34 class CcdImage {
35 public:
38  std::string const &filter, std::shared_ptr<afw::image::PhotoCalib> photoCalib,
39  std::shared_ptr<afw::cameraGeom::Detector> detector, int visit, int ccd,
40  std::string const &fluxField);
41 
43  CcdImage(CcdImage const &) = delete;
44  CcdImage(CcdImage &&) = delete;
45  CcdImage &operator=(CcdImage const &) = delete;
46  CcdImage &operator=(CcdImage &&) = delete;
47 
49  std::string getName() const { return _name; }
50 
56  MeasuredStarList const &getWholeCatalog() const { return _wholeCatalog; }
57 
59 
64  MeasuredStarList const &getCatalogForFit() const { return _catalogForFit; }
65  MeasuredStarList &getCatalogForFit() { return _catalogForFit; }
67 
73  void setCommonTangentPoint(Point const &commonTangentPoint);
74 
80  Point const &getCommonTangentPoint() const { return _commonTangentPoint; }
81 
83  Gtransfo const *getPix2CommonTangentPlane() const { return _pix2CommonTangentPlane.get(); }
84 
86  Gtransfo const *getCommonTangentPlane2TP() const { return _CTP2TP.get(); }
87 
89  Gtransfo const *getTP2CommonTangentPlane() const { return _TP2CTP.get(); }
90 
92  Gtransfo const *getPix2TangentPlane() const { return _pix2TP.get(); }
93 
95  Gtransfo const *getSky2TP() const { return _sky2TP.get(); }
96 
98  CcdIdType getCcdId() const { return _ccdId; }
99 
101  VisitIdType getVisit() const { return _visit; }
102 
104 
105  CcdImageKey getHashKey() const { return CcdImageKey(_visit, _ccdId); }
106 
108  double getAirMass() const { return _airMass; }
109 
111  double getMjd() const { return _mjd; }
112 
115 
119  lsst::afw::coord::IcrsCoord getBoresightRaDec() const { return _boresightRaDec; }
120 
122  double getHourAngle() const { return _hourAngle; }
123 
125  double getSinEta() const { return _sineta; }
126 
128  double getCosEta() const { return _coseta; }
129 
131  double getTanZ() const { return _tgz; }
132 
134  Point getRefractionVector() const { return Point(_tgz * _coseta, _tgz * _sineta); }
135 
137  std::string getFilter() const { return _filter; }
138 
140  Gtransfo const *readWCS() const { return _readWcs.get(); }
141 
143  Gtransfo const *getInverseReadWCS() const { return _inverseReadWcs.get(); }
144 
146  Frame const &getImageFrame() const { return _imageFrame; }
147 
148 private:
150  std::string const &fluxField);
151 
152  Frame _imageFrame; // in pixels
153 
154  MeasuredStarList _wholeCatalog; // the catalog of measured objets
155  MeasuredStarList _catalogForFit;
156 
157  std::shared_ptr<BaseTanWcs> _readWcs; // i.e. from pix to sky
158  std::shared_ptr<Gtransfo> _inverseReadWcs; // i.e. from sky to pix
159 
160  // The following ones should probably be mostly removed.
161  std::shared_ptr<Gtransfo> _CTP2TP; // go from CommonTangentPlane to this tangent plane.
162  std::shared_ptr<Gtransfo> _TP2CTP; // reverse one
163  std::shared_ptr<Gtransfo> _pix2CommonTangentPlane; // pixels -> CTP
165 
167 
168  std::string _name;
169  CcdIdType _ccdId;
170  VisitIdType _visit;
171 
172  lsst::afw::coord::IcrsCoord _boresightRaDec;
173  double _airMass; // airmass value.
174  double _mjd; // modified julian date
177  // refraction
178  // eta : parallactic angle, z: zenithal angle (X = 1/cos(z))
179  double _sineta, _coseta, _tgz;
180  // Local Sidereal Time and hour angle of observation
181  double _lstObs, _hourAngle;
182 
183  std::string _filter;
184 
185  Point _commonTangentPoint;
186 };
187 } // namespace jointcal
188 } // namespace lsst
189 
190 // Add our preferred hash of CcdImageKey to the std:: namespace, so it's always available "for free".
191 namespace std {
192 template <>
201  return hash<size_t>()(static_cast<size_t>(ccdImage.first) |
202  (static_cast<size_t>(ccdImage.second) << 32));
203  }
204 };
205 } // namespace std
206 
207 #endif // LSST_JOINTCAL_CCD_IMAGE_H
CcdImage(afw::table::SourceCatalog &record, std::shared_ptr< lsst::afw::image::TanWcs > 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:82
VisitIdType getVisit() const
returns visit ID
Definition: CcdImage.h:101
Gtransfo const * getInverseReadWCS() const
the inverse of the one above.
Definition: CcdImage.h:143
Gtransfo const * getCommonTangentPlane2TP() const
Definition: CcdImage.h:86
A point in a plane.
Definition: Point.h:13
Gtransfo const * getSky2TP() const
Definition: CcdImage.h:95
double getCosEta() const
Parallactic angle.
Definition: CcdImage.h:128
std::string getName() const
Return the _name that identifies this ccdImage.
Definition: CcdImage.h:49
Gtransfo const * getPix2CommonTangentPlane() const
Definition: CcdImage.h:83
double getMjd() const
Julian Date.
Definition: CcdImage.h:111
STL namespace.
tbl::Key< int > wcs
CcdIdType getCcdId() const
returns ccd ID
Definition: CcdImage.h:98
Gtransfo const * getPix2TangentPlane() const
Definition: CcdImage.h:92
double getSinEta() const
Parallactic angle.
Definition: CcdImage.h:125
A list of MeasuredStar. They are usually filled in Associations::AddImage.
Definition: MeasuredStar.h:111
STL class.
CcdImage & operator=(CcdImage const &)=delete
std::shared_ptr< afw::image::PhotoCalib > getPhotoCalib() const
Return the exposure&#39;s photometric calibration.
Definition: CcdImage.h:114
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:19
MeasuredStarList & getCatalogForFit()
Gets the catalog to be used for fitting, which may have been cleaned-up.
Definition: CcdImage.h:65
Class for a simple mapping implementing a generic Gtransfo.
Gtransfo const * getTP2CommonTangentPlane() const
Definition: CcdImage.h:89
double getHourAngle() const
Definition: CcdImage.h:122
STL class.
double getAirMass() const
Airmass.
Definition: CcdImage.h:108
double getTanZ() const
Parallactic angle.
Definition: CcdImage.h:131
Point getRefractionVector() const
Definition: CcdImage.h:134
MeasuredStarList const & getCatalogForFit() const
Gets the catalog to be used for fitting, which may have been cleaned-up.
Definition: CcdImage.h:64
a virtual (interface) class for geometric transformations.
Definition: Gtransfo.h:39
std::string getFilter() const
return the CcdImage filter name
Definition: CcdImage.h:137
size_t operator()(lsst::jointcal::CcdImageKey const &ccdImage) const
Definition: CcdImage.h:200
Gtransfo const * readWCS() const
the wcs read in the header. NOT updated when fitting.
Definition: CcdImage.h:140
std::list< std::shared_ptr< CcdImage > > CcdImageList
Definition: CcdImage.h:23
int VisitIdType
Definition: CcdImage.h:25
CcdImageKey getHashKey() const
Definition: CcdImage.h:105
std::shared_ptr< afw::cameraGeom::Detector > getDetector() const
Definition: CcdImage.h:103
Handler of an actual image from a single CCD.
Definition: CcdImage.h:34
Point const & getCommonTangentPoint() const
Gets the common tangent point, shared between all ccdImages.
Definition: CcdImage.h:80
lsst::afw::coord::IcrsCoord getBoresightRaDec() const
Gets the boresight RA/Dec.
Definition: CcdImage.h:119
MeasuredStarList const & getWholeCatalog() const
Gets the as-read catalog.
Definition: CcdImage.h:56
void setCommonTangentPoint(Point const &commonTangentPoint)
Sets the common tangent point and computes necessary transforms.
Definition: CcdImage.cc:131
Frame const & getImageFrame() const
Frame in pixels.
Definition: CcdImage.h:146