lsst.jointcal  master-ga8493ae4fe+5
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 
8 #include "lsst/afw/table/Source.h"
9 #include "lsst/afw/image/TanWcs.h"
10 #include "lsst/afw/image/PhotoCalib.h"
11 #include "lsst/afw/image/VisitInfo.h"
12 #include "lsst/afw/coord/Coord.h"
13 #include "lsst/daf/base/PropertySet.h"
14 #include "lsst/afw/geom/Box.h"
16 #include "lsst/jointcal/Gtransfo.h"
17 #include "lsst/jointcal/Frame.h"
18 
19 namespace lsst {
20 namespace jointcal {
21 
22 typedef std::list<std::shared_ptr<CcdImage>> CcdImageList;
23 
24 typedef int VisitIdType;
25 typedef int CcdIdType;
26 
31 class CcdImage {
32 private:
33  Frame _imageFrame; // in pixels
34 
35  MeasuredStarList _wholeCatalog; // the catalog of measured objets
36  MeasuredStarList _catalogForFit;
37 
38  std::shared_ptr<BaseTanWcs> _readWcs; // i.e. from pix to sky
39  std::shared_ptr<Gtransfo> _inverseReadWcs; // i.e. from sky to pix
40 
41  // The following ones should probably be mostly removed.
42  std::shared_ptr<Gtransfo> _CTP2TP; // go from CommonTangentPlane to this tangent plane.
43  std::shared_ptr<Gtransfo> _TP2CTP; // reverse one
44  std::shared_ptr<Gtransfo> _pix2CommonTangentPlane; // pixels -> CTP
45  std::shared_ptr<Gtransfo> _pix2TP;
46 
47  std::shared_ptr<Gtransfo> _sky2TP;
48 
49  std::string _name;
50  CcdIdType _ccdId;
51  VisitIdType _visit;
52 
53  lsst::afw::coord::IcrsCoord _boresightRaDec;
54  double _airMass; // airmass value.
55  double _mjd; // modified julian date
56  std::shared_ptr<afw::image::PhotoCalib> _photoCalib;
57  // refraction
58  // eta : parallactic angle, z: zenithal angle (X = 1/cos(z))
59  double _sineta, _coseta, _tgz;
60  // Local Sidereal Time and hour angle of observation
61  double _lstObs, _hourAngle;
62 
63  std::string _filter;
64 
65  Point _commonTangentPoint;
66 
67  void LoadCatalog(lsst::afw::table::SortedCatalogT<lsst::afw::table::SourceRecord> const &Cat,
68  std::string const &fluxField);
69 
70 public:
71  CcdImage(afw::table::SourceCatalog &record, std::shared_ptr<lsst::afw::image::TanWcs> wcs,
72  std::shared_ptr<lsst::afw::image::VisitInfo> visitInfo, afw::geom::Box2I const &bbox,
73  std::string const &filter, std::shared_ptr<afw::image::PhotoCalib> photoCalib, int visit,
74  int ccd, std::string const &fluxField);
75 
77  CcdImage(CcdImage const &) = delete;
78  CcdImage(CcdImage &&) = delete;
79  CcdImage &operator=(CcdImage const &) = delete;
80  CcdImage &operator=(CcdImage &&) = delete;
81 
83  std::string getName() const { return _name; }
84 
90  MeasuredStarList const &getWholeCatalog() const { return _wholeCatalog; }
91 
93 
98  MeasuredStarList const &getCatalogForFit() const { return _catalogForFit; }
99  MeasuredStarList &getCatalogForFit() { return _catalogForFit; }
101 
107  void setCommonTangentPoint(Point const &commonTangentPoint);
108 
114  Point const &getCommonTangentPoint() const { return _commonTangentPoint; }
115 
117  Gtransfo const *getPix2CommonTangentPlane() const { return _pix2CommonTangentPlane.get(); }
118 
120  Gtransfo const *getCommonTangentPlane2TP() const { return _CTP2TP.get(); }
121 
123  Gtransfo const *getTP2CommonTangentPlane() const { return _TP2CTP.get(); }
124 
126  Gtransfo const *getPix2TangentPlane() const { return _pix2TP.get(); }
127 
129  Gtransfo const *getSky2TP() const { return _sky2TP.get(); }
130 
132  int getCcdId() const { return _ccdId; }
133 
135  VisitIdType getVisit() const { return _visit; }
136 
138  double getAirMass() const { return _airMass; }
139 
141  double getMjd() const { return _mjd; }
142 
144  std::shared_ptr<afw::image::PhotoCalib> getPhotoCalib() { return _photoCalib; }
145 
149  lsst::afw::coord::IcrsCoord getBoresightRaDec() { return _boresightRaDec; }
150 
152  double getHourAngle() const { return _hourAngle; }
153 
155  double getSinEta() const { return _sineta; }
156 
158  double getCosEta() const { return _coseta; }
159 
161  double getTanZ() const { return _tgz; }
162 
164  Point getRefractionVector() const { return Point(_tgz * _coseta, _tgz * _sineta); }
165 
167  std::string getFilter() const { return _filter; }
168 
170  Gtransfo const *readWCS() const { return _readWcs.get(); }
171 
173  Gtransfo const *getInverseReadWCS() const { return _inverseReadWcs.get(); }
174 
176  Frame const &getImageFrame() const { return _imageFrame; }
177 };
178 } // namespace jointcal
179 } // namespace lsst
180 
181 #endif // LSST_JOINTCAL_CCD_IMAGE_H
int getCcdId() const
returns ccd ID
Definition: CcdImage.h:132
VisitIdType getVisit() const
returns visit ID
Definition: CcdImage.h:135
Gtransfo const * getInverseReadWCS() const
the inverse of the one above.
Definition: CcdImage.h:173
Gtransfo const * getCommonTangentPlane2TP() const
Definition: CcdImage.h:120
A point in a plane.
Definition: Point.h:13
Gtransfo const * getSky2TP() const
Definition: CcdImage.h:129
double getCosEta() const
Parallactic angle.
Definition: CcdImage.h:158
lsst::afw::coord::IcrsCoord getBoresightRaDec()
Gets the boresight RA/Dec.
Definition: CcdImage.h:149
std::string getName() const
Return the _name that identifies this ccdImage.
Definition: CcdImage.h:83
Gtransfo const * getPix2CommonTangentPlane() const
Definition: CcdImage.h:117
double getMjd() const
Julian Date.
Definition: CcdImage.h:141
Gtransfo const * getPix2TangentPlane() const
Definition: CcdImage.h:126
double getSinEta() const
Parallactic angle.
Definition: CcdImage.h:155
A list of MeasuredStar. They are usually filled in Associations::AddImage.
Definition: MeasuredStar.h:95
CcdImage & operator=(CcdImage const &)=delete
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:99
Class for a simple mapping implementing a generic Gtransfo.
Definition: Associations.h:24
Gtransfo const * getTP2CommonTangentPlane() const
Definition: CcdImage.h:123
std::shared_ptr< afw::image::PhotoCalib > getPhotoCalib()
Return the exposure&#39;s photometric calibration.
Definition: CcdImage.h:144
double getHourAngle() const
Definition: CcdImage.h:152
double getAirMass() const
Airmass.
Definition: CcdImage.h:138
double getTanZ() const
Parallactic angle.
Definition: CcdImage.h:161
Point getRefractionVector() const
Definition: CcdImage.h:164
MeasuredStarList const & getCatalogForFit() const
Gets the catalog to be used for fitting, which may have been cleaned-up.
Definition: CcdImage.h:98
a virtual (interface) class for geometric transformations.
Definition: Gtransfo.h:37
std::string getFilter() const
return the CcdImage filter name
Definition: CcdImage.h:167
Gtransfo const * readWCS() const
the wcs read in the header. NOT updated when fitting.
Definition: CcdImage.h:170
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, int visit, int ccd, std::string const &fluxField)
Definition: CcdImage.cc:78
std::list< std::shared_ptr< CcdImage > > CcdImageList
Definition: CcdImage.h:22
int VisitIdType
Definition: CcdImage.h:24
Handler of an actual image from a single CCD.
Definition: CcdImage.h:31
Point const & getCommonTangentPoint() const
Gets the common tangent point, shared between all ccdImages.
Definition: CcdImage.h:114
MeasuredStarList const & getWholeCatalog() const
Gets the as-read catalog.
Definition: CcdImage.h:90
void setCommonTangentPoint(Point const &commonTangentPoint)
Sets the common tangent point and computes necessary transforms.
Definition: CcdImage.cc:121
Frame const & getImageFrame() const
Frame in pixels.
Definition: CcdImage.h:176