LSST Applications g0f08755f38+9c285cab97,g1635faa6d4+13f3999e92,g1653933729+a8ce1bb630,g1a0ca8cf93+bf6eb00ceb,g28da252d5a+0829b12dee,g29321ee8c0+5700dc9eac,g2bbee38e9b+9634bc57db,g2bc492864f+9634bc57db,g2cdde0e794+c2c89b37c4,g3156d2b45e+41e33cbcdc,g347aa1857d+9634bc57db,g35bb328faa+a8ce1bb630,g3a166c0a6a+9634bc57db,g3e281a1b8c+9f2c4e2fc3,g414038480c+077ccc18e7,g41af890bb2+fde0dd39b6,g5fbc88fb19+17cd334064,g781aacb6e4+a8ce1bb630,g80478fca09+55a9465950,g82479be7b0+d730eedb7d,g858d7b2824+9c285cab97,g9125e01d80+a8ce1bb630,g9726552aa6+10f999ec6a,ga5288a1d22+2a84bb7594,gacf8899fa4+c69c5206e8,gae0086650b+a8ce1bb630,gb58c049af0+d64f4d3760,gc28159a63d+9634bc57db,gcf0d15dbbd+4b7d09cae4,gda3e153d99+9c285cab97,gda6a2b7d83+4b7d09cae4,gdaeeff99f8+1711a396fd,ge2409df99d+5e831397f4,ge79ae78c31+9634bc57db,gf0baf85859+147a0692ba,gf3967379c6+41c94011de,gf3fb38a9a8+8f07a9901b,gfb92a5be7c+9c285cab97,w.2024.46
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Member Functions | List of all members
lsst::jointcal::CcdImage Class Reference

Handler of an actual image from a single CCD. More...

#include <CcdImage.h>

Public Member Functions

 CcdImage (afw::table::SourceCatalog &record, const std::shared_ptr< lsst::afw::geom::SkyWcs > &wcs, const std::shared_ptr< lsst::afw::image::VisitInfo > &visitInfo, lsst::geom::Box2I const &bbox, std::string filter, std::shared_ptr< afw::image::PhotoCalib > photoCalib, std::shared_ptr< afw::cameraGeom::Detector > detector, int visit, int ccd, std::string const &fluxField)
 
 CcdImage (CcdImage const &)=delete
 No move or copy: each CCD image is unique to that ccd+visit, and Associations holds all CcdImages.
 
 CcdImage (CcdImage &&)=delete
 
CcdImageoperator= (CcdImage const &)=delete
 
CcdImageoperator= (CcdImage &&)=delete
 
std::string getName () const
 Return the _name that identifies this ccdImage.
 
MeasuredStarList const & getWholeCatalog () const
 Gets the as-read catalog.
 
MeasuredStarList const & getCatalogForFit () const
 Gets the catalog to be used for fitting, which may have been cleaned-up.
 
MeasuredStarListgetCatalogForFit ()
 
void resetCatalogForFit ()
 Clear the catalog for fitting and set it to a copy of the whole catalog.
 
std::pair< int, int > countStars () const
 Count the number of valid measured and reference stars that fall within this ccdImage.
 
void setCommonTangentPoint (Point const &commonTangentPoint)
 Sets the common tangent point and computes necessary transforms.
 
jointcal::Point const & getCommonTangentPoint () const
 Gets the common tangent point, shared between all ccdImages.
 
std::shared_ptr< AstrometryTransform > const getPixelToCommonTangentPlane () const
 
std::shared_ptr< AstrometryTransform > const getCommonTangentPlaneToTangentPlane () const
 
std::shared_ptr< AstrometryTransform > const getTangentPlaneToCommonTangentPlane () const
 
std::shared_ptr< AstrometryTransform > const getPixelToTangentPlane () const
 
std::shared_ptr< AstrometryTransform > const getSkyToTangentPlane () const
 
CcdIdType getCcdId () const
 returns ccd ID
 
VisitIdType getVisit () const
 returns visit ID
 
std::shared_ptr< afw::cameraGeom::DetectorgetDetector () const
 
CcdImageKey getHashKey () const
 
double getAirMass () const
 Airmass.
 
double getEpoch () const
 
std::shared_ptr< afw::image::PhotoCalibgetPhotoCalib () const
 Return the exposure's photometric calibration.
 
lsst::geom::SpherePoint getBoresightRaDec () const
 Gets the boresight RA/Dec.
 
double getHourAngle () const
 
double getLstObs () const
 
double getSinEta () const
 Parallactic angle.
 
double getCosEta () const
 Parallactic angle.
 
double getTanZ () const
 Parallactic angle.
 
Point getRefractionVector () const
 
std::string getFilter () const
 return the CcdImage filter name
 
std::shared_ptr< AstrometryTransform > const getReadWcs () const
 the wcs read in the header. NOT updated when fitting.
 
Frame const & getImageFrame () const
 Frame in pixels.
 

Detailed Description

Handler of an actual image from a single CCD.

NOTE: could possibly be replaced with a subclass of afw.image.Exposure?

Definition at line 64 of file CcdImage.h.

Constructor & Destructor Documentation

◆ CcdImage() [1/3]

lsst::jointcal::CcdImage::CcdImage ( afw::table::SourceCatalog & record,
const std::shared_ptr< lsst::afw::geom::SkyWcs > & wcs,
const std::shared_ptr< lsst::afw::image::VisitInfo > & visitInfo,
lsst::geom::Box2I const & bbox,
std::string filter,
std::shared_ptr< afw::image::PhotoCalib > photoCalib,
std::shared_ptr< afw::cameraGeom::Detector > detector,
int visit,
int ccd,
std::string const & fluxField )

Definition at line 113 of file CcdImage.cc.

118 : _ccdId(ccdId), _visit(visit), _photoCalib(std::move(photoCalib)), _detector(std::move(detector)), _filter(std::move(filter)) {
119 loadCatalog(catalog, fluxField);
120
121 Point lowerLeft(bbox.getMinX(), bbox.getMinY());
122 Point upperRight(bbox.getMaxX(), bbox.getMaxY());
123 _imageFrame = Frame(lowerLeft, upperRight);
124
125 _readWcs = std::make_shared<AstrometryTransformSkyWcs>(wcs);
126
128 out << visit << "_" << ccdId;
129 _name = out.str();
130
131 _boresightRaDec = visitInfo->getBoresightRaDec();
132 _airMass = visitInfo->getBoresightAirmass();
133 _epoch = visitInfo->getDate().get(lsst::daf::base::DateTime::EPOCH);
134 _lstObs = visitInfo->getEra();
135 _hourAngle = visitInfo->getBoresightHourAngle();
136
137 // Some cameras don't manage ERA (and thus Hour Angle) properly, so it's going to be NaN.
138 // Because we need the refraction vector later, go with 0 HA to prevent crashes on that NaN.
139 if (std::isnan(_hourAngle) == true) {
140 _hourAngle = 0;
141 }
142
143 if (_airMass == 1)
144 _sinEta = _cosEta = _tanZ = 0;
145 else {
146 double cosz = 1. / _airMass;
147 double sinz = std::sqrt(1 - cosz * cosz); // astronomers usually observe above the horizon
148 _tanZ = sinz / cosz;
149 lsst::geom::Angle eta = visitInfo->getBoresightParAngle();
150 _sinEta = std::sin(eta.asRadians());
151 _cosEta = std::cos(eta.asRadians());
152 }
153}
AmpInfoBoxKey bbox
Definition Amplifier.cc:117
A class representing an angle.
Definition Angle.h:128
constexpr double asRadians() const noexcept
Return an Angle's value in radians.
Definition Angle.h:173
T cos(T... args)
T isnan(T... args)
T move(T... args)
T sin(T... args)
T sqrt(T... args)
T str(T... args)
Key< int > visitInfo
Definition Exposure.cc:70

◆ CcdImage() [2/3]

lsst::jointcal::CcdImage::CcdImage ( CcdImage const & )
delete

No move or copy: each CCD image is unique to that ccd+visit, and Associations holds all CcdImages.

◆ CcdImage() [3/3]

lsst::jointcal::CcdImage::CcdImage ( CcdImage && )
delete

Member Function Documentation

◆ countStars()

std::pair< int, int > lsst::jointcal::CcdImage::countStars ( ) const

Count the number of valid measured and reference stars that fall within this ccdImage.

Measured stars are counted if they are valid. Reference stars are counted if a measured star (valid or not) has a fittedStar that has an associated refStar.

Returns
Number of (measured, reference) stars in the image.

Definition at line 155 of file CcdImage.cc.

155 {
156 int measuredStars = 0;
157 int refStars = 0;
158 for (auto const &measuredStar : _catalogForFit) {
159 if (measuredStar->isValid()) {
160 measuredStars++;
161 }
162 if ((measuredStar->getFittedStar() != nullptr) &&
163 (measuredStar->getFittedStar()->getRefStar() != nullptr)) {
164 refStars++;
165 }
166 }
167 return std::make_pair(measuredStars, refStars);
168}
T make_pair(T... args)

◆ getAirMass()

double lsst::jointcal::CcdImage::getAirMass ( ) const
inline

Airmass.

Definition at line 155 of file CcdImage.h.

155{ return _airMass; }

◆ getBoresightRaDec()

lsst::geom::SpherePoint lsst::jointcal::CcdImage::getBoresightRaDec ( ) const
inline

Gets the boresight RA/Dec.

Definition at line 165 of file CcdImage.h.

165{ return _boresightRaDec; }

◆ getCatalogForFit() [1/2]

MeasuredStarList & lsst::jointcal::CcdImage::getCatalogForFit ( )
inline

Definition at line 95 of file CcdImage.h.

95{ return _catalogForFit; }

◆ getCatalogForFit() [2/2]

MeasuredStarList const & lsst::jointcal::CcdImage::getCatalogForFit ( ) const
inline

Gets the catalog to be used for fitting, which may have been cleaned-up.

Returns
The catalog for fitting.

Definition at line 94 of file CcdImage.h.

94{ return _catalogForFit; }

◆ getCcdId()

CcdIdType lsst::jointcal::CcdImage::getCcdId ( ) const
inline

returns ccd ID

Definition at line 145 of file CcdImage.h.

145{ return _ccdId; }

◆ getCommonTangentPlaneToTangentPlane()

std::shared_ptr< AstrometryTransform > const lsst::jointcal::CcdImage::getCommonTangentPlaneToTangentPlane ( ) const
inline

Definition at line 132 of file CcdImage.h.

132 {
133 return _commonTangentPlaneToTangentPlane;
134 }

◆ getCommonTangentPoint()

jointcal::Point const & lsst::jointcal::CcdImage::getCommonTangentPoint ( ) const
inline

Gets the common tangent point, shared between all ccdImages.

Returns
The common tangent point of all ccdImages (decimal degrees).

Definition at line 126 of file CcdImage.h.

126{ return _commonTangentPoint; }

◆ getCosEta()

double lsst::jointcal::CcdImage::getCosEta ( ) const
inline

Parallactic angle.

Definition at line 175 of file CcdImage.h.

175{ return _cosEta; }

◆ getDetector()

std::shared_ptr< afw::cameraGeom::Detector > lsst::jointcal::CcdImage::getDetector ( ) const
inline

Definition at line 150 of file CcdImage.h.

150{ return _detector; }

◆ getEpoch()

double lsst::jointcal::CcdImage::getEpoch ( ) const
inline

Definition at line 157 of file CcdImage.h.

157{ return _epoch; }

◆ getFilter()

std::string lsst::jointcal::CcdImage::getFilter ( ) const
inline

return the CcdImage filter name

Definition at line 184 of file CcdImage.h.

184{ return _filter; }

◆ getHashKey()

CcdImageKey lsst::jointcal::CcdImage::getHashKey ( ) const
inline

Definition at line 152 of file CcdImage.h.

152{ return CcdImageKey{_visit, _ccdId}; }

◆ getHourAngle()

double lsst::jointcal::CcdImage::getHourAngle ( ) const
inline

Definition at line 167 of file CcdImage.h.

167{ return _hourAngle; }

◆ getImageFrame()

Frame const & lsst::jointcal::CcdImage::getImageFrame ( ) const
inline

Frame in pixels.

Definition at line 190 of file CcdImage.h.

190{ return _imageFrame; }

◆ getLstObs()

double lsst::jointcal::CcdImage::getLstObs ( ) const
inline

Definition at line 169 of file CcdImage.h.

169{ return _lstObs; }

◆ getName()

std::string lsst::jointcal::CcdImage::getName ( ) const
inline

Return the _name that identifies this ccdImage.

Definition at line 79 of file CcdImage.h.

79{ return _name; }

◆ getPhotoCalib()

std::shared_ptr< afw::image::PhotoCalib > lsst::jointcal::CcdImage::getPhotoCalib ( ) const
inline

Return the exposure's photometric calibration.

Definition at line 160 of file CcdImage.h.

160{ return _photoCalib; }

◆ getPixelToCommonTangentPlane()

std::shared_ptr< AstrometryTransform > const lsst::jointcal::CcdImage::getPixelToCommonTangentPlane ( ) const
inline

Definition at line 128 of file CcdImage.h.

128 {
129 return _pixelToCommonTangentPlane;
130 }

◆ getPixelToTangentPlane()

std::shared_ptr< AstrometryTransform > const lsst::jointcal::CcdImage::getPixelToTangentPlane ( ) const
inline

Definition at line 140 of file CcdImage.h.

140{ return _pixelToTangentPlane; }

◆ getReadWcs()

std::shared_ptr< AstrometryTransform > const lsst::jointcal::CcdImage::getReadWcs ( ) const
inline

the wcs read in the header. NOT updated when fitting.

Definition at line 187 of file CcdImage.h.

187{ return _readWcs; }

◆ getRefractionVector()

Point lsst::jointcal::CcdImage::getRefractionVector ( ) const
inline

Definition at line 181 of file CcdImage.h.

181{ return Point(_tanZ * _cosEta, _tanZ * _sinEta); }

◆ getSinEta()

double lsst::jointcal::CcdImage::getSinEta ( ) const
inline

Parallactic angle.

Definition at line 172 of file CcdImage.h.

172{ return _sinEta; }

◆ getSkyToTangentPlane()

std::shared_ptr< AstrometryTransform > const lsst::jointcal::CcdImage::getSkyToTangentPlane ( ) const
inline

Definition at line 142 of file CcdImage.h.

142{ return _skyToTangentPlane; }

◆ getTangentPlaneToCommonTangentPlane()

std::shared_ptr< AstrometryTransform > const lsst::jointcal::CcdImage::getTangentPlaneToCommonTangentPlane ( ) const
inline

Definition at line 136 of file CcdImage.h.

136 {
137 return _tangentPlaneToCommonTangentPlane;
138 }

◆ getTanZ()

double lsst::jointcal::CcdImage::getTanZ ( ) const
inline

Parallactic angle.

Definition at line 178 of file CcdImage.h.

178{ return _tanZ; }

◆ getVisit()

VisitIdType lsst::jointcal::CcdImage::getVisit ( ) const
inline

returns visit ID

Definition at line 148 of file CcdImage.h.

148{ return _visit; }

◆ getWholeCatalog()

MeasuredStarList const & lsst::jointcal::CcdImage::getWholeCatalog ( ) const
inline

Gets the as-read catalog.

Returns
The whole catalog.

Definition at line 86 of file CcdImage.h.

86{ return _wholeCatalog; }

◆ operator=() [1/2]

CcdImage & lsst::jointcal::CcdImage::operator= ( CcdImage && )
delete

◆ operator=() [2/2]

CcdImage & lsst::jointcal::CcdImage::operator= ( CcdImage const & )
delete

◆ resetCatalogForFit()

void lsst::jointcal::CcdImage::resetCatalogForFit ( )
inline

Clear the catalog for fitting and set it to a copy of the whole catalog.

Definition at line 99 of file CcdImage.h.

99 {
102 }
MeasuredStarList const & getWholeCatalog() const
Gets the as-read catalog.
Definition CcdImage.h:86
MeasuredStarList const & getCatalogForFit() const
Gets the catalog to be used for fitting, which may have been cleaned-up.
Definition CcdImage.h:94
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)

◆ setCommonTangentPoint()

void lsst::jointcal::CcdImage::setCommonTangentPoint ( Point const & commonTangentPoint)

Sets the common tangent point and computes necessary transforms.

Parameters
[in]commonTangentPointThe common tangent point of all ccdImages (decimal degrees).

Definition at line 170 of file CcdImage.cc.

170 {
171 _commonTangentPoint = commonTangentPoint;
172
173 auto const crval = _readWcs->getSkyWcs()->getSkyOrigin();
174 jointcal::Point tangentPoint(crval[0].asDegrees(), crval[1].asDegrees());
175
176 /* we don't assume here that we know the internals of TanPixelToRaDec:
177 to construct pix->TP, we do pix->sky->TP, although pix->sky
178 actually goes through TP */
179 AstrometryTransformLinear identity;
180 TanRaDecToPixel raDecToTangentPlane(identity, tangentPoint);
181 _pixelToTangentPlane = compose(raDecToTangentPlane, *_readWcs);
182 TanPixelToRaDec CommonTangentPlane2RaDec(identity, commonTangentPoint);
183 _commonTangentPlaneToTangentPlane = compose(raDecToTangentPlane, CommonTangentPlane2RaDec);
184
185 // jump from one TP to an other:
186 TanRaDecToPixel raDecToCommonTangentPlane(identity, commonTangentPoint);
187 TanPixelToRaDec TangentPlaneToRaDec(identity, tangentPoint);
188 _tangentPlaneToCommonTangentPlane = compose(raDecToCommonTangentPlane, TangentPlaneToRaDec);
189 _skyToTangentPlane.reset(new TanRaDecToPixel(identity, tangentPoint));
190
191 // this one is needed for matches :
192 _pixelToCommonTangentPlane = compose(raDecToCommonTangentPlane, *_readWcs);
193}
table::PointKey< double > crval
Definition OldWcs.cc:128
A point in a plane.
Definition Point.h:37
std::unique_ptr< AstrometryTransform > compose(AstrometryTransform const &left, AstrometryTransform const &right)
Returns a pointer to a composition of transforms, representing left(right()).

The documentation for this class was generated from the following files: