lsst.jointcal  14.0-31-gde643ac
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 
74  void setCommonTangentPoint(Point const &commonTangentPoint);
75 
81  Point const &getCommonTangentPoint() const { return _commonTangentPoint; }
82 
84  Gtransfo const *getPix2CommonTangentPlane() const { return _pix2CommonTangentPlane.get(); }
85 
87  Gtransfo const *getCommonTangentPlane2TP() const { return _CTP2TP.get(); }
88 
90  Gtransfo const *getTP2CommonTangentPlane() const { return _TP2CTP.get(); }
91 
93  Gtransfo const *getPix2TangentPlane() const { return _pix2TP.get(); }
94 
96  Gtransfo const *getSky2TP() const { return _sky2TP.get(); }
97 
99  CcdIdType getCcdId() const { return _ccdId; }
100 
102  VisitIdType getVisit() const { return _visit; }
103 
105 
106  CcdImageKey getHashKey() const { return CcdImageKey(_visit, _ccdId); }
107 
109  double getAirMass() const { return _airMass; }
110 
112  double getMjd() const { return _mjd; }
113 
116 
120  lsst::afw::geom::SpherePoint getBoresightRaDec() const { return _boresightRaDec; }
121 
123  double getHourAngle() const { return _hourAngle; }
124 
126  double getSinEta() const { return _sineta; }
127 
129  double getCosEta() const { return _coseta; }
130 
132  double getTanZ() const { return _tgz; }
133 
135  Point getRefractionVector() const { return Point(_tgz * _coseta, _tgz * _sineta); }
136 
138  std::string getFilter() const { return _filter; }
139 
141  Gtransfo const *readWCS() const { return _readWcs.get(); }
142 
144  Frame const &getImageFrame() const { return _imageFrame; }
145 
146 private:
148  std::string const &fluxField);
149 
150  Frame _imageFrame; // in pixels
151 
152  MeasuredStarList _wholeCatalog; // the catalog of measured objets
153  MeasuredStarList _catalogForFit;
154 
155  std::shared_ptr<GtransfoSkyWcs> _readWcs; // apply goes from pix to sky
156 
157  // The following ones should probably be mostly removed.
158  std::shared_ptr<Gtransfo> _CTP2TP; // go from CommonTangentPlane to this tangent plane.
159  std::shared_ptr<Gtransfo> _TP2CTP; // reverse one
160  std::shared_ptr<Gtransfo> _pix2CommonTangentPlane; // pixels -> CTP
162 
164 
165  std::string _name;
166  CcdIdType _ccdId;
167  VisitIdType _visit;
168 
169  lsst::afw::geom::SpherePoint _boresightRaDec;
170  double _airMass; // airmass value.
171  double _mjd; // modified julian date
174  // refraction
175  // eta : parallactic angle, z: zenithal angle (X = 1/cos(z))
176  double _sineta, _coseta, _tgz;
177  // Local Sidereal Time and hour angle of observation
178  double _lstObs, _hourAngle;
179 
180  std::string _filter;
181 
182  Point _commonTangentPoint;
183 };
184 } // namespace jointcal
185 } // namespace lsst
186 
187 // Add our preferred hash of CcdImageKey to the std:: namespace, so it's always available "for free".
188 namespace std {
189 template <>
198  return hash<size_t>()(static_cast<size_t>(ccdImage.first) |
199  (static_cast<size_t>(ccdImage.second) << 32));
200  }
201 };
202 } // namespace std
203 
204 #endif // LSST_JOINTCAL_CCD_IMAGE_H
VisitIdType getVisit() const
returns visit ID
Definition: CcdImage.h:102
Gtransfo const * getCommonTangentPlane2TP() const
Definition: CcdImage.h:87
std::ostream & operator<<(std::ostream &out, CcdImageKey const &key)
Definition: CcdImage.cc:30
A point in a plane.
Definition: Point.h:13
Gtransfo const * getSky2TP() const
Definition: CcdImage.h:96
double getCosEta() const
Parallactic angle.
Definition: CcdImage.h:129
std::string getName() const
Return the _name that identifies this ccdImage.
Definition: CcdImage.h:50
Gtransfo const * getPix2CommonTangentPlane() const
Definition: CcdImage.h:84
double getMjd() const
Julian Date.
Definition: CcdImage.h:112
STL namespace.
tbl::Key< int > wcs
CcdIdType getCcdId() const
returns ccd ID
Definition: CcdImage.h:99
Gtransfo const * getPix2TangentPlane() const
Definition: CcdImage.h:93
double getSinEta() const
Parallactic angle.
Definition: CcdImage.h:126
A list of MeasuredStar. They are usually filled in Associations::AddImage.
Definition: MeasuredStar.h:112
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:115
lsst::afw::geom::SpherePoint getBoresightRaDec() const
Gets the boresight RA/Dec.
Definition: CcdImage.h:120
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:66
Class for a simple mapping implementing a generic Gtransfo.
Gtransfo const * getTP2CommonTangentPlane() const
Definition: CcdImage.h:90
double getHourAngle() const
Definition: CcdImage.h:123
STL class.
double getAirMass() const
Airmass.
Definition: CcdImage.h:109
double getTanZ() const
Parallactic angle.
Definition: CcdImage.h:132
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:87
Point getRefractionVector() const
Definition: CcdImage.h:135
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:41
std::string getFilter() const
return the CcdImage filter name
Definition: CcdImage.h:138
size_t operator()(lsst::jointcal::CcdImageKey const &ccdImage) const
Definition: CcdImage.h:197
Gtransfo const * readWCS() const
the wcs read in the header. NOT updated when fitting.
Definition: CcdImage.h:141
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:106
std::shared_ptr< afw::cameraGeom::Detector > getDetector() const
Definition: CcdImage.h:104
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:81
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:135
Frame const & getImageFrame() const
Frame in pixels.
Definition: CcdImage.h:144