LSST Applications g070148d5b3+33e5256705,g0d53e28543+25c8b88941,g0da5cf3356+2dd1178308,g1081da9e2a+62d12e78cb,g17e5ecfddb+7e422d6136,g1c76d35bf8+ede3a706f7,g295839609d+225697d880,g2e2c1a68ba+cc1f6f037e,g2ffcdf413f+853cd4dcde,g38293774b4+62d12e78cb,g3b44f30a73+d953f1ac34,g48ccf36440+885b902d19,g4b2f1765b6+7dedbde6d2,g5320a0a9f6+0c5d6105b6,g56b687f8c9+ede3a706f7,g5c4744a4d9+ef6ac23297,g5ffd174ac0+0c5d6105b6,g6075d09f38+66af417445,g667d525e37+2ced63db88,g670421136f+2ced63db88,g71f27ac40c+2ced63db88,g774830318a+463cbe8d1f,g7876bc68e5+1d137996f1,g7985c39107+62d12e78cb,g7fdac2220c+0fd8241c05,g96f01af41f+368e6903a7,g9ca82378b8+2ced63db88,g9d27549199+ef6ac23297,gabe93b2c52+e3573e3735,gb065e2a02a+3dfbe639da,gbc3249ced9+0c5d6105b6,gbec6a3398f+0c5d6105b6,gc9534b9d65+35b9f25267,gd01420fc67+0c5d6105b6,geee7ff78d7+a14128c129,gf63283c776+ede3a706f7,gfed783d017+0c5d6105b6,w.2022.47
LSST Data Management Base Package
Loading...
Searching...
No Matches
CcdImage.h
Go to the documentation of this file.
1// -*- LSST-C++ -*-
2/*
3 * This file is part of jointcal.
4 *
5 * Developed for the LSST Data Management System.
6 * This product includes software developed by the LSST Project
7 * (https://www.lsst.org).
8 * See the COPYRIGHT file at the top-level directory of this distribution
9 * for details of code ownership.
10 *
11 * This program is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation, either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program. If not, see <https://www.gnu.org/licenses/>.
23 */
24
25#ifndef LSST_JOINTCAL_CCD_IMAGE_H
26#define LSST_JOINTCAL_CCD_IMAGE_H
27
28#include <list>
29#include <string>
30
37#include "lsst/geom/Box.h"
41#include "lsst/jointcal/Frame.h"
42
43namespace lsst {
44namespace jointcal {
45
47
48using VisitIdType = long;
49using CcdIdType = int;
54 bool operator!=(CcdImageKey const &right) const { return !(*this == right); }
55 bool operator==(CcdImageKey const &right) const { return (visit == right.visit) && (ccd == right.ccd); }
56};
57// typedef std::pair<VisitIdType, CcdIdType> CcdImageKey;
58std::ostream &operator<<(std::ostream &out, CcdImageKey const &key);
59
64class CcdImage {
65public:
70 std::string const &fluxField);
71
73 CcdImage(CcdImage const &) = delete;
74 CcdImage(CcdImage &&) = delete;
75 CcdImage &operator=(CcdImage const &) = delete;
77
79 std::string getName() const { return _name; }
80
86 MeasuredStarList const &getWholeCatalog() const { return _wholeCatalog; }
87
89
94 MeasuredStarList const &getCatalogForFit() const { return _catalogForFit; }
95 MeasuredStarList &getCatalogForFit() { return _catalogForFit; }
97
102 }
103
113
119 void setCommonTangentPoint(Point const &commonTangentPoint);
120
126 jointcal::Point const &getCommonTangentPoint() const { return _commonTangentPoint; }
127
129 return _pixelToCommonTangentPlane;
130 }
131
133 return _commonTangentPlaneToTangentPlane;
134 }
135
137 return _tangentPlaneToCommonTangentPlane;
138 }
139
140 std::shared_ptr<AstrometryTransform> const getPixelToTangentPlane() const { return _pixelToTangentPlane; }
141
142 std::shared_ptr<AstrometryTransform> const getSkyToTangentPlane() const { return _skyToTangentPlane; }
143
145 CcdIdType getCcdId() const { return _ccdId; }
146
148 VisitIdType getVisit() const { return _visit; }
149
151
152 CcdImageKey getHashKey() const { return CcdImageKey{_visit, _ccdId}; }
153
155 double getAirMass() const { return _airMass; }
156
157 double getEpoch() const { return _epoch; }
158
161
165 lsst::geom::SpherePoint getBoresightRaDec() const { return _boresightRaDec; }
166
167 double getHourAngle() const { return _hourAngle; }
168
169 double getLstObs() const { return _lstObs; }
170
172 double getSinEta() const { return _sinEta; }
173
175 double getCosEta() const { return _cosEta; }
176
178 double getTanZ() const { return _tanZ; }
179
181 Point getRefractionVector() const { return Point(_tanZ * _cosEta, _tanZ * _sinEta); }
182
184 std::string getFilter() const { return _filter; }
185
187 std::shared_ptr<AstrometryTransform> const getReadWcs() const { return _readWcs; }
188
190 Frame const &getImageFrame() const { return _imageFrame; }
191
192private:
194 std::string const &fluxField);
195
196 jointcal::Frame _imageFrame; // in pixels
197
198 MeasuredStarList _wholeCatalog; // the catalog of measured objets
199 MeasuredStarList _catalogForFit;
200
201 std::shared_ptr<AstrometryTransformSkyWcs> _readWcs; // apply goes from pix to sky
202
203 // The following ones should probably be mostly removed.
204 // go from CommonTangentPlane to this tangent plane.
205 std::shared_ptr<AstrometryTransform> _commonTangentPlaneToTangentPlane;
206 std::shared_ptr<AstrometryTransform> _tangentPlaneToCommonTangentPlane; // reverse one
207 std::shared_ptr<AstrometryTransform> _pixelToCommonTangentPlane; // pixels -> CTP
208 std::shared_ptr<AstrometryTransform> _pixelToTangentPlane;
209
210 std::shared_ptr<AstrometryTransform> _skyToTangentPlane;
211
212 std::string _name;
213 CcdIdType _ccdId;
214 VisitIdType _visit;
215
216 lsst::geom::SpherePoint _boresightRaDec;
217 double _airMass; // airmass value.
218 double _epoch; // julian epoch year (e.g. 2000.0 for J2000)
221 // refraction
222 // eta : parallactic angle, z: zenithal angle (X = 1/cos(z))
223 double _sinEta, _cosEta, _tanZ;
224 // Local Sidereal Time and hour angle of observation
225 double _lstObs, _hourAngle;
226
227 std::string _filter;
228
229 jointcal::Point _commonTangentPoint;
230};
231} // namespace jointcal
232} // namespace lsst
233
234// Add our preferred hash of CcdImageKey to the std:: namespace, so it's always available "for free".
235namespace std {
236template <>
244 size_t operator()(lsst::jointcal::CcdImageKey const &key) const {
245 return hash<size_t>()(static_cast<size_t>(key.visit) | (static_cast<size_t>(key.ccd) << 32));
246 }
247};
248} // namespace std
249
250#endif // LSST_JOINTCAL_CCD_IMAGE_H
AmpInfoBoxKey bbox
Definition: Amplifier.cc:117
table::Key< int > detector
Implementation of the Photometric Calibration class.
table::Key< table::Array< std::uint8_t > > wcs
Definition: SkyWcs.cc:66
Custom catalog class for record/table subclasses that are guaranteed to have an ID,...
Definition: SortedCatalog.h:42
An integer coordinate rectangle.
Definition: Box.h:55
Point in an unspecified spherical coordinate system.
Definition: SpherePoint.h:57
Handler of an actual image from a single CCD.
Definition: CcdImage.h:64
std::shared_ptr< AstrometryTransform > const getPixelToCommonTangentPlane() const
Definition: CcdImage.h:128
CcdIdType getCcdId() const
returns ccd ID
Definition: CcdImage.h:145
std::shared_ptr< afw::cameraGeom::Detector > getDetector() const
Definition: CcdImage.h:150
VisitIdType getVisit() const
returns visit ID
Definition: CcdImage.h:148
void setCommonTangentPoint(Point const &commonTangentPoint)
Sets the common tangent point and computes necessary transforms.
Definition: CcdImage.cc:170
MeasuredStarList & getCatalogForFit()
Definition: CcdImage.h:95
std::shared_ptr< AstrometryTransform > const getPixelToTangentPlane() const
Definition: CcdImage.h:140
double getEpoch() const
Definition: CcdImage.h:157
std::pair< int, int > countStars() const
Count the number of valid measured and reference stars that fall within this ccdImage.
Definition: CcdImage.cc:155
std::shared_ptr< AstrometryTransform > const getReadWcs() const
the wcs read in the header. NOT updated when fitting.
Definition: CcdImage.h:187
Frame const & getImageFrame() const
Frame in pixels.
Definition: CcdImage.h:190
MeasuredStarList const & getWholeCatalog() const
Gets the as-read catalog.
Definition: CcdImage.h:86
std::shared_ptr< AstrometryTransform > const getTangentPlaneToCommonTangentPlane() const
Definition: CcdImage.h:136
std::shared_ptr< AstrometryTransform > const getCommonTangentPlaneToTangentPlane() const
Definition: CcdImage.h:132
MeasuredStarList const & getCatalogForFit() const
Gets the catalog to be used for fitting, which may have been cleaned-up.
Definition: CcdImage.h:94
CcdImage & operator=(CcdImage &&)=delete
void resetCatalogForFit()
Clear the catalog for fitting and set it to a copy of the whole catalog.
Definition: CcdImage.h:99
CcdImage(CcdImage const &)=delete
No move or copy: each CCD image is unique to that ccd+visit, and Associations holds all CcdImages.
double getSinEta() const
Parallactic angle.
Definition: CcdImage.h:172
Point getRefractionVector() const
Definition: CcdImage.h:181
double getHourAngle() const
Definition: CcdImage.h:167
std::shared_ptr< afw::image::PhotoCalib > getPhotoCalib() const
Return the exposure's photometric calibration.
Definition: CcdImage.h:160
std::string getFilter() const
return the CcdImage filter name
Definition: CcdImage.h:184
CcdImage(CcdImage &&)=delete
lsst::geom::SpherePoint getBoresightRaDec() const
Gets the boresight RA/Dec.
Definition: CcdImage.h:165
jointcal::Point const & getCommonTangentPoint() const
Gets the common tangent point, shared between all ccdImages.
Definition: CcdImage.h:126
std::string getName() const
Return the _name that identifies this ccdImage.
Definition: CcdImage.h:79
double getLstObs() const
Definition: CcdImage.h:169
double getTanZ() const
Parallactic angle.
Definition: CcdImage.h:178
double getCosEta() const
Parallactic angle.
Definition: CcdImage.h:175
CcdImage & operator=(CcdImage const &)=delete
CcdImageKey getHashKey() const
Definition: CcdImage.h:152
double getAirMass() const
Airmass.
Definition: CcdImage.h:155
std::shared_ptr< AstrometryTransform > const getSkyToTangentPlane() const
Definition: CcdImage.h:142
rectangle with sides parallel to axes.
Definition: Frame.h:38
A list of MeasuredStar. They are usually filled in Associations::createCcdImage.
Definition: MeasuredStar.h:151
A point in a plane.
Definition: Point.h:37
void copyTo(StarList< Star > &copy) const
clears copy and makes a copy of the std::list to copy
Definition: StarList.cc:68
T clear(T... args)
T right(T... args)
long VisitIdType
Definition: CcdImage.h:48
std::ostream & operator<<(std::ostream &stream, AstrometryMapping const &mapping)
STL namespace.
For hashing a ccdImage: the pair of (visit, ccd) IDs should be unique to each ccdImage.
Definition: CcdImage.h:51
bool operator==(CcdImageKey const &right) const
Definition: CcdImage.h:55
bool operator!=(CcdImageKey const &right) const
Definition: CcdImage.h:54
size_t operator()(lsst::jointcal::CcdImageKey const &key) const
Definition: CcdImage.h:244
Key< int > visitInfo
Definition: Exposure.cc:70
Key< int > photoCalib
Definition: Exposure.cc:67