LSST Applications g063fba187b+fee0456c91,g0f08755f38+ea96e5a5a3,g1653933729+a8ce1bb630,g168dd56ebc+a8ce1bb630,g1a2382251a+90257ff92a,g20f6ffc8e0+ea96e5a5a3,g217e2c1bcf+937a289c59,g28da252d5a+daa7da44eb,g2bbee38e9b+253935c60e,g2bc492864f+253935c60e,g3156d2b45e+6e55a43351,g32e5bea42b+31359a2a7a,g347aa1857d+253935c60e,g35bb328faa+a8ce1bb630,g3a166c0a6a+253935c60e,g3b1af351f3+a8ce1bb630,g3e281a1b8c+c5dd892a6c,g414038480c+416496e02f,g41af890bb2+afe91b1188,g599934f4f4+0db33f7991,g7af13505b9+e36de7bce6,g80478fca09+da231ba887,g82479be7b0+a4516e59e3,g858d7b2824+ea96e5a5a3,g89c8672015+f4add4ffd5,g9125e01d80+a8ce1bb630,ga5288a1d22+bc6ab8dfbd,gb58c049af0+d64f4d3760,gc28159a63d+253935c60e,gcab2d0539d+3f2b72788c,gcf0d15dbbd+4ea9c45075,gda6a2b7d83+4ea9c45075,gdaeeff99f8+1711a396fd,ge79ae78c31+253935c60e,gef2f8181fd+3031e3cf99,gf0baf85859+c1f95f4921,gfa517265be+ea96e5a5a3,gfa999e8aa5+17cd334064,w.2024.50
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: