lsst.jointcal  master-gc935ebf72c+13
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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/Calib.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  PTR(lsst::afw::image::Calib) _calib;
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(const lsst::afw::table::SortedCatalogT<lsst::afw::table::SourceRecord> &Cat,
68  const std::string &fluxField);
69 
70 public:
71  CcdImage(lsst::afw::table::SortedCatalogT<lsst::afw::table::SourceRecord> &record,
72  const PTR(lsst::afw::image::TanWcs) wcs, const PTR(lsst::afw::image::VisitInfo) visitInfo,
73  const lsst::afw::geom::Box2I &bbox, const std::string &filter,
74  const PTR(lsst::afw::image::Calib) calib, const int &visit, const int &ccd,
75  const std::string &fluxField);
76 
78  std::string getName() const { return _name; }
79 
85  const MeasuredStarList &getWholeCatalog() const { return _wholeCatalog; }
86 
88 
93  const MeasuredStarList &getCatalogForFit() const { return _catalogForFit; }
94  MeasuredStarList &getCatalogForFit() { return _catalogForFit; }
96 
102  void setCommonTangentPoint(const Point &commonTangentPoint);
103 
109  Point const &getCommonTangentPoint() const { return _commonTangentPoint; }
110 
112  const Gtransfo *getPix2CommonTangentPlane() const { return _pix2CommonTangentPlane.get(); }
113 
115  const Gtransfo *getCommonTangentPlane2TP() const { return _CTP2TP.get(); }
116 
118  const Gtransfo *getTP2CommonTangentPlane() const { return _TP2CTP.get(); }
119 
121  const Gtransfo *getPix2TangentPlane() const { return _pix2TP.get(); }
122 
124  const Gtransfo *getSky2TP() const { return _sky2TP.get(); }
125 
127  int getCcdId() const { return _ccdId; }
128 
130  VisitIdType getVisit() const { return _visit; }
131 
133  double getAirMass() const { return _airMass; }
134 
136  double getMjd() const { return _mjd; }
137 
139  PTR(lsst::afw::image::Calib) getCalib() { return _calib; }
140 
144  lsst::afw::coord::IcrsCoord getBoresightRaDec() { return _boresightRaDec; }
145 
147  double getHourAngle() const { return _hourAngle; }
148 
150  double getSinEta() const { return _sineta; }
151 
153  double getCosEta() const { return _coseta; }
154 
156  double getTanZ() const { return _tgz; }
157 
159  Point getRefractionVector() const { return Point(_tgz * _coseta, _tgz * _sineta); }
160 
162  std::string getFilter() const { return _filter; }
163 
165  const Gtransfo *readWCS() const { return _readWcs.get(); }
166 
168  const Gtransfo *getInverseReadWCS() const { return _inverseReadWcs.get(); }
169 
171  const Frame &getImageFrame() const { return _imageFrame; }
172 
173 private:
174  CcdImage(const CcdImage &); // forbid copies
175 };
176 } // namespace jointcal
177 } // namespace lsst
178 
179 #endif // LSST_JOINTCAL_CCD_IMAGE_H
Point getRefractionVector() const
Definition: CcdImage.h:159
double getMjd() const
Julian Date.
Definition: CcdImage.h:136
Point const & getCommonTangentPoint() const
Gets the common tangent point, shared between all ccdImages.
Definition: CcdImage.h:109
void setCommonTangentPoint(const Point &commonTangentPoint)
Sets the common tangent point and computes necessary transforms.
Definition: CcdImage.cc:116
A point in a plane.
Definition: Point.h:13
const Gtransfo * readWCS() const
the wcs read in the header. NOT updated when fitting.
Definition: CcdImage.h:165
const Gtransfo * getCommonTangentPlane2TP() const
Definition: CcdImage.h:115
lsst::afw::coord::IcrsCoord getBoresightRaDec()
Gets the boresight RA/Dec.
Definition: CcdImage.h:144
const Gtransfo * getPix2TangentPlane() const
Definition: CcdImage.h:121
const Gtransfo * getPix2CommonTangentPlane() const
Definition: CcdImage.h:112
double getCosEta() const
Parallactic angle.
Definition: CcdImage.h:153
const Gtransfo * getSky2TP() const
Definition: CcdImage.h:124
std::string getFilter() const
return the CcdImage filter name
Definition: CcdImage.h:162
double getHourAngle() const
Definition: CcdImage.h:147
CcdImage(lsst::afw::table::SortedCatalogT< lsst::afw::table::SourceRecord > &record, const boost::shared_ptr< lsst::afw::image::TanWcs > wcs, const boost::shared_ptr< lsst::afw::image::VisitInfo > visitInfo, const lsst::afw::geom::Box2I &bbox, const std::string &filter, const boost::shared_ptr< lsst::afw::image::Calib > calib, const int &visit, const int &ccd, const std::string &fluxField)
Definition: CcdImage.cc:69
A list of MeasuredStar. They are usually filled in Associations::AddImage.
Definition: MeasuredStar.h:71
double getTanZ() const
Parallactic angle.
Definition: CcdImage.h:156
double getAirMass() const
Airmass.
Definition: CcdImage.h:133
double getSinEta() const
Parallactic angle.
Definition: CcdImage.h:150
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:94
const Frame & getImageFrame() const
Frame in pixels.
Definition: CcdImage.h:171
const MeasuredStarList & getCatalogForFit() const
Gets the catalog to be used for fitting, which may have been cleaned-up.
Definition: CcdImage.h:93
const Gtransfo * getInverseReadWCS() const
the inverse of the one above.
Definition: CcdImage.h:168
a virtual (interface) class for geometric transformations.
Definition: Gtransfo.h:37
std::list< std::shared_ptr< CcdImage > > CcdImageList
Definition: CcdImage.h:22
const Gtransfo * getTP2CommonTangentPlane() const
Definition: CcdImage.h:118
int VisitIdType
Definition: CcdImage.h:24
Handler of an actual image from a single CCD.
Definition: CcdImage.h:31
const MeasuredStarList & getWholeCatalog() const
Gets the as-read catalog.
Definition: CcdImage.h:85
std::string getName() const
Return the _name that identifies this ccdImage.
Definition: CcdImage.h:78
VisitIdType getVisit() const
returns visit ID
Definition: CcdImage.h:130
int getCcdId() const
returns ccd ID
Definition: CcdImage.h:127
boost::shared_ptr< lsst::afw::image::Calib > getCalib()
Return the exposure&#39;s photometric calibration.
Definition: CcdImage.h:139