LSSTApplications
20.0.0
LSSTDataManagementBasePackage
|
The class that implements the relations between MeasuredStar and FittedStar.
More...
#include <Associations.h>
|
size_t | refStarListSize () |
|
size_t | fittedStarListSize () |
|
| Associations () |
| Source selection is performed in python, so Associations' constructor only initializes a couple of variables. More...
|
|
| Associations (CcdImageList const &imageList) |
| Create an Associations object from a pre-built list of ccdImages. More...
|
|
| Associations (Associations const &)=delete |
| No moves or copies: jointcal only ever needs one Associations object. More...
|
|
| Associations (Associations &&)=delete |
|
Associations & | operator= (Associations const &)=delete |
|
Associations & | operator= (Associations &&)=delete |
|
void | computeCommonTangentPoint () |
| Sets a shared tangent point for all ccdImages, using the mean of the centers of all ccdImages. More...
|
|
void | setCommonTangentPoint (lsst::geom::Point2D const &commonTangentPoint) |
| Sets a shared tangent point for all ccdImages. More...
|
|
Point | getCommonTangentPoint () const |
| can be used to project sidereal coordinates related to the image set on a plane. More...
|
|
void | createCcdImage (afw::table::SourceCatalog &catalog, std::shared_ptr< lsst::afw::geom::SkyWcs > wcs, std::shared_ptr< lsst::afw::image::VisitInfo > visitInfo, lsst::geom::Box2I const &bbox, std::string const &filter, std::shared_ptr< afw::image::PhotoCalib > photoCalib, std::shared_ptr< afw::cameraGeom::Detector > detector, int visit, int ccd, lsst::jointcal::JointcalControl const &control) |
| Create a ccdImage from an exposure catalog and metadata, and add it to the list. More...
|
|
void | addCcdImage (std::shared_ptr< CcdImage > const ccdImage) |
| Add a pre-constructed ccdImage to the ccdImageList. More...
|
|
void | associateCatalogs (const double matchCutInArcsec=0, const bool useFittedList=false, const bool enlargeFittedList=true) |
| incrementaly builds a merged catalog of all image catalogs More...
|
|
void | collectRefStars (afw::table::SimpleCatalog &refCat, geom::Angle matchCut, std::string const &fluxField, float refCoordinateErr, bool rejectBadFluxes=false) |
| Collect stars from an external reference catalog and associate them with fittedStars. More...
|
|
void | deprojectFittedStars () |
| Sends back the fitted stars coordinates on the sky FittedStarsList::inTangentPlaneCoordinates keeps track of that. More...
|
|
void | prepareFittedStars (int minMeasurements) |
| Set the color field of FittedStar 's from a colored catalog. More...
|
|
CcdImageList const & | getCcdImageList () const |
|
unsigned | getNFilters () const |
| Number of different bands in the input image list. Not implemented so far. More...
|
|
lsst::sphgeom::Circle | computeBoundingCircle () const |
| Return the bounding circle in on-sky (RA, Dec) coordinates containing all CcdImages. More...
|
|
int | nCcdImagesValidForFit () const |
| return the number of CcdImages with non-empty catalogs to-be-fit. More...
|
|
size_t | nFittedStarsWithAssociatedRefStar () const |
| Return the number of fittedStars that have an associated refStar. More...
|
|
The class that implements the relations between MeasuredStar and FittedStar.
Definition at line 54 of file Associations.h.
◆ Associations() [1/4]
lsst::jointcal::Associations::Associations |
( |
| ) |
|
|
inline |
Source selection is performed in python, so Associations' constructor only initializes a couple of variables.
Definition at line 69 of file Associations.h.
◆ Associations() [2/4]
lsst::jointcal::Associations::Associations |
( |
CcdImageList const & |
imageList | ) |
|
|
inline |
Create an Associations object from a pre-built list of ccdImages.
This is primarily useful for tests that build their own ccdImageList, but it could be used to help parallelize the creation of the ccdImages.
- Parameters
-
imageList | A pre-built ccdImage list. |
Definition at line 81 of file Associations.h.
◆ Associations() [3/4]
lsst::jointcal::Associations::Associations |
( |
Associations const & |
| ) |
|
|
delete |
No moves or copies: jointcal only ever needs one Associations object.
◆ Associations() [4/4]
lsst::jointcal::Associations::Associations |
( |
Associations && |
| ) |
|
|
delete |
◆ addCcdImage()
Add a pre-constructed ccdImage to the ccdImageList.
Definition at line 131 of file Associations.h.
◆ associateCatalogs()
void lsst::jointcal::Associations::associateCatalogs |
( |
const double |
matchCutInArcsec = 0 , |
|
|
const bool |
useFittedList = false , |
|
|
const bool |
enlargeFittedList = true |
|
) |
| |
incrementaly builds a merged catalog of all image catalogs
Definition at line 121 of file Associations.cc.
128 item->clearBeforeAssoc();
138 ccdImage->resetCatalogForFit();
139 MeasuredStarList &catalog = ccdImage->getCatalogForFit();
144 Frame ccdImageFrameCPT = toCommonTangentPlane->apply(ccdImage->getImageFrame(),
false);
145 ccdImageFrameCPT = ccdImageFrameCPT.rescale(1.10);
148 FittedStarList toMatch;
151 if (ccdImageFrameCPT.inFrame(*fittedStar)) {
152 toMatch.push_back(fittedStar);
158 toCommonTangentPlane.
get(), matchCutInArcSec / 3600.);
161 LOGLS_DEBUG(_log,
"Measured-to-Fitted matches before removing ambiguities " << starMatchList->size());
162 starMatchList->removeAmbiguities(*toCommonTangentPlane);
163 LOGLS_DEBUG(_log,
"Measured-to-Fitted matches after removing ambiguities " << starMatchList->size());
167 int matchedCount = 0;
168 for (
auto const &starMatch : *starMatchList) {
169 auto bs = starMatch.s1;
170 auto ms_const = std::dynamic_pointer_cast<const MeasuredStar>(bs);
171 auto ms = std::const_pointer_cast<MeasuredStar>(ms_const);
172 auto bs2 = starMatch.s2;
173 auto fs_const = std::dynamic_pointer_cast<const FittedStar>(bs2);
174 auto fs = std::const_pointer_cast<FittedStar>(fs_const);
175 ms->setFittedStar(
fs);
178 LOGLS_INFO(_log,
"Matched " << matchedCount <<
" objects in " << ccdImage->getName());
181 int unMatchedCount = 0;
182 for (
auto const &mstar : catalog) {
184 if (mstar->getFittedStar())
continue;
185 if (enlargeFittedList) {
186 auto fs = std::make_shared<FittedStar>(*mstar);
188 toCommonTangentPlane->transformPosAndErrors(*
fs, *
fs);
190 mstar->setFittedStar(
fs);
194 LOGLS_INFO(_log,
"Unmatched objects: " << unMatchedCount);
◆ collectRefStars()
Collect stars from an external reference catalog and associate them with fittedStars.
- Parameters
-
| refCat | The catalog of reference sources |
[in] | matchCut | Separation radius to match fitted and reference stars. |
| fluxField | The field name in refCat to get the flux from. |
| refCoordinateErr | Error on reference catalog coordinates [mas]. If not NaN, this overrides the coord_*_err values in the reference catalog itself. This value is divided by cos(dec) before being used for ra_err. |
| rejectBadFluxes | Reject reference sources with flux=NaN or 0 and/or fluxErr=NaN or 0. Typically false for astrometry and true for photometry. |
Definition at line 205 of file Associations.cc.
208 if (refCat.size() == 0) {
209 throw(
LSST_EXCEPT(pex::exceptions::InvalidParameterError,
210 " reference catalog is empty : stop here "));
213 afw::table::CoordKey coordKey = refCat.getSchema()[
"coord"];
215 afw::table::Key<float> raErrKey;
216 afw::table::Key<float> decErrKey;
218 raErrKey = refCat.getSchema()[
"coord_raErr"];
219 decErrKey = refCat.getSchema()[
"coord_decErr"];
222 auto fluxKey = refCat.getSchema().find<
double>(fluxField).
key;
224 afw::table::Key<double> fluxErrKey;
226 fluxErrKey = refCat.getSchema().find<
double>(fluxField +
"Err").
key;
227 }
catch (pex::exceptions::NotFoundError &) {
229 << fluxField <<
"Err"
230 <<
") not found in reference catalog. Not using ref flux errors.");
234 for (
size_t i = 0; i < refCat.size(); i++) {
235 auto const &record = refCat.
get(i);
237 auto coord = record->get(coordKey);
238 double flux = record->get(fluxKey);
240 if (fluxErrKey.isValid()) {
241 fluxErr = record->get(fluxErrKey);
247 auto star = std::make_shared<RefStar>(ra,
dec, flux, fluxErr);
250 star->vx = record->get(raErrKey);
251 star->vy = record->get(decErrKey);
254 star->vx =
std::pow(refCoordinateErr / 1000. / 3600. /
std::cos(coord.getLatitude()), 2);
255 star->vy =
std::pow(refCoordinateErr / 1000. / 3600., 2);
266 AstrometryTransformLinear identity;
267 TanRaDecToPixel raDecToCommonTangentPlane(identity, _commonTangentPoint);
269 associateRefStars(matchCut.
asArcseconds(), &raDecToCommonTangentPlane);
◆ computeBoundingCircle()
Return the bounding circle in on-sky (RA, Dec) coordinates containing all CcdImages.
Requires that computeCommonTangentPoint() be called first, so that sensor bounding boxes can be transformed into the common tangent plane.
Definition at line 92 of file Associations.cc.
94 Frame tangentPlaneFrame;
97 Frame CTPFrame = ccdImage->getPixelToCommonTangentPlane()->apply(ccdImage->getImageFrame(),
false);
98 if (tangentPlaneFrame.getArea() == 0)
99 tangentPlaneFrame = CTPFrame;
101 tangentPlaneFrame += CTPFrame;
105 AstrometryTransformLinear identity;
106 TanPixelToRaDec commonTangentPlaneToRaDec(identity, _commonTangentPoint);
107 Frame raDecFrame = commonTangentPlaneToRaDec.apply(tangentPlaneFrame,
false);
◆ computeCommonTangentPoint()
void lsst::jointcal::Associations::computeCommonTangentPoint |
( |
| ) |
|
Sets a shared tangent point for all ccdImages, using the mean of the centers of all ccdImages.
Definition at line 76 of file Associations.cc.
80 centers.
push_back(ccdImage->getBoresightRaDec());
◆ createCcdImage()
Create a ccdImage from an exposure catalog and metadata, and add it to the list.
- Parameters
-
[in] | catalog | The extracted source catalog, selected for good astrometric sources. |
[in] | wcs | The exposure's original wcs |
[in] | visitInfo | The exposure's visitInfo object |
[in] | bbox | The bounding box of the exposure |
[in] | filter | The exposure's filter |
[in] | photoCalib | The exposure's photometric calibration |
[in] | detector | The exposure's detector |
[in] | visit | The visit identifier |
[in] | ccd | The ccd identifier |
[in] | control | The JointcalControl object |
Definition at line 62 of file Associations.cc.
70 visit,
ccd, control.sourceFluxField);
72 LOGLS_DEBUG(_log,
"Catalog " << ccdImage->getName() <<
" has " << ccdImage->getWholeCatalog().size()
◆ deprojectFittedStars()
void lsst::jointcal::Associations::deprojectFittedStars |
( |
| ) |
|
Sends back the fitted stars coordinates on the sky FittedStarsList::inTangentPlaneCoordinates keeps track of that.
Definition at line 394 of file Associations.cc.
399 "DeprojectFittedStars: Fitted stars are already in sidereal coordinates, nothing done ");
◆ fittedStarListSize()
size_t lsst::jointcal::Associations::fittedStarListSize |
( |
| ) |
|
|
inline |
◆ getCcdImageList()
CcdImageList const& lsst::jointcal::Associations::getCcdImageList |
( |
| ) |
const |
|
inline |
◆ getCommonTangentPoint()
Point lsst::jointcal::Associations::getCommonTangentPoint |
( |
| ) |
const |
|
inline |
can be used to project sidereal coordinates related to the image set on a plane.
Definition at line 105 of file Associations.h.
105 {
return _commonTangentPoint; }
◆ getNFilters()
unsigned lsst::jointcal::Associations::getNFilters |
( |
| ) |
const |
|
inline |
Number of different bands in the input image list. Not implemented so far.
Definition at line 174 of file Associations.h.
◆ nCcdImagesValidForFit()
int lsst::jointcal::Associations::nCcdImagesValidForFit |
( |
| ) |
const |
return the number of CcdImages with non-empty catalogs to-be-fit.
Definition at line 408 of file Associations.cc.
410 return item->getCatalogForFit().size() > 0;
◆ nFittedStarsWithAssociatedRefStar()
size_t lsst::jointcal::Associations::nFittedStarsWithAssociatedRefStar |
( |
| ) |
const |
Return the number of fittedStars that have an associated refStar.
Definition at line 414 of file Associations.cc.
417 if ((fittedStar !=
nullptr) & (fittedStar->getRefStar() !=
nullptr))
count++;
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ prepareFittedStars()
void lsst::jointcal::Associations::prepareFittedStars |
( |
int |
minMeasurements | ) |
|
Set the color field of FittedStar 's from a colored catalog.
Prepare the fittedStar list by making quality cuts and normalizing measurements.
- Parameters
-
[in] | minMeasurements | The minimum number of measuredStars for a FittedStar to be included. |
Definition at line 298 of file Associations.cc.
299 selectFittedStars(minMeasurements);
300 normalizeFittedStars();
◆ refStarListSize()
size_t lsst::jointcal::Associations::refStarListSize |
( |
| ) |
|
|
inline |
◆ setCommonTangentPoint()
void lsst::jointcal::Associations::setCommonTangentPoint |
( |
lsst::geom::Point2D const & |
commonTangentPoint | ) |
|
Sets a shared tangent point for all ccdImages.
- Parameters
-
commonTangentPoint | The common tangent point of all input images (decimal degrees). |
Definition at line 87 of file Associations.cc.
88 _commonTangentPoint = Point(commonTangentPoint.getX(), commonTangentPoint.getY());
89 for (
auto &ccdImage :
ccdImageList) ccdImage->setCommonTangentPoint(_commonTangentPoint);
◆ ccdImageList
◆ fittedStarList
◆ refStarList
The documentation for this class was generated from the following files:
- /j/snowflake/release/lsstsw/stack/1a1d771/Linux64/jointcal/20.0.0/include/lsst/jointcal/Associations.h
- /j/snowflake/release/lsstsw/stack/1a1d771/Linux64/jointcal/20.0.0/src/Associations.cc
constexpr AngleUnit degrees
constant with units of degrees
constexpr double radToDeg(double x) noexcept
SpherePoint averageSpherePoint(std::vector< SpherePoint > const &coords)
Return the average of a list of coordinates.
void applyTransform(const Operator &op)
enables to apply a geometrical transform if Star is Basestar or derives from it.
table::Key< table::Array< std::uint8_t > > wcs
static LonLat fromDegrees(double lon, double lat)
BaseStarList & Measured2Base(MeasuredStarList &This)
#define LOGLS_INFO(logger, message)
Point getCommonTangentPoint() const
can be used to project sidereal coordinates related to the image set on a plane.
FittedStarList fittedStarList
CcdImageList ccdImageList
BaseStarList & Fitted2Base(FittedStarList &This)
#define LOGLS_WARN(logger, message)
std::unique_ptr< StarMatchList > listMatchCollect(const BaseStarList &list1, const BaseStarList &list2, const AstrometryTransform *guess, const double maxDist)
assembles star matches.
bool inTangentPlaneCoordinates
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
#define LOGLS_DEBUG(logger, message)
void setCommonTangentPoint(lsst::geom::Point2D const &commonTangentPoint)
Sets a shared tangent point for all ccdImages.
T emplace_back(T... args)
Circle getBoundingCircle() const override
getBoundingCircle returns a bounding-circle for this region.
table::Key< int > detector
static ConvexPolygon convexHull(std::vector< UnitVector3d > const &points)
convexHull returns the convex hull of the given set of points if it exists and throws an exception ot...
constexpr double asArcseconds() const noexcept
Return an Angle's value in arcseconds.