LSST Applications g0f08755f38+82efc23009,g12f32b3c4e+e7bdf1200e,g1653933729+a8ce1bb630,g1a0ca8cf93+50eff2b06f,g28da252d5a+52db39f6a5,g2bbee38e9b+37c5a29d61,g2bc492864f+37c5a29d61,g2cdde0e794+c05ff076ad,g3156d2b45e+41e33cbcdc,g347aa1857d+37c5a29d61,g35bb328faa+a8ce1bb630,g3a166c0a6a+37c5a29d61,g3e281a1b8c+fb992f5633,g414038480c+7f03dfc1b0,g41af890bb2+11b950c980,g5fbc88fb19+17cd334064,g6b1c1869cb+12dd639c9a,g781aacb6e4+a8ce1bb630,g80478fca09+72e9651da0,g82479be7b0+04c31367b4,g858d7b2824+82efc23009,g9125e01d80+a8ce1bb630,g9726552aa6+8047e3811d,ga5288a1d22+e532dc0a0b,gae0086650b+a8ce1bb630,gb58c049af0+d64f4d3760,gc28159a63d+37c5a29d61,gcf0d15dbbd+2acd6d4d48,gd7358e8bfb+778a810b6e,gda3e153d99+82efc23009,gda6a2b7d83+2acd6d4d48,gdaeeff99f8+1711a396fd,ge2409df99d+6b12de1076,ge79ae78c31+37c5a29d61,gf0baf85859+d0a5978c5a,gf3967379c6+4954f8c433,gfb92a5be7c+82efc23009,gfec2e1e490+2aaed99252,w.2024.46
LSST Data Management Base Package
Loading...
Searching...
No Matches
Associations.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_ASSOCIATIONS_H
26#define LSST_JOINTCAL_ASSOCIATIONS_H
27
28#include <iostream>
29#include <list>
30#include <string>
31#include <utility>
32
38#include "lsst/geom/Box.h"
39#include "lsst/sphgeom/Circle.h"
40
44#include "lsst/jointcal/Point.h"
46
48
49namespace lsst {
50namespace jointcal {
51
53
56public:
57 CcdImageList ccdImageList; // the catalog handlers
58 RefStarList refStarList; // e.g. GAIA or SDSS reference stars
59 FittedStarList fittedStarList; // stars that are going to be fitted
60
61 // These are strictly speaking not needed anymore (after DM-4043),
62 // but keeping them seems cleaner then exposing the lists themselves.
63 size_t refStarListSize() { return refStarList.size(); }
64 size_t fittedStarListSize() { return fittedStarList.size(); }
65
71 : _commonTangentPoint(Point(std::numeric_limits<double>::quiet_NaN(),
72 std::numeric_limits<double>::quiet_NaN())),
73 _maxMeasuredStars(0) {}
74
84 Associations(CcdImageList imageList, double epoch = 0)
85 : ccdImageList(std::move(imageList)),
86 _commonTangentPoint(Point(std::numeric_limits<double>::quiet_NaN(),
87 std::numeric_limits<double>::quiet_NaN())),
88 _maxMeasuredStars(0),
89 _epoch(epoch) {}
90
92 Associations(Associations const &) = delete;
96
101
108 void setCommonTangentPoint(lsst::geom::Point2D const &commonTangentPoint);
109 Point getCommonTangentPoint() const { return _commonTangentPoint; }
111
113 size_t getMaxMeasuredStars() const { return _maxMeasuredStars; }
114
119 double getEpoch() const { return _epoch; }
120 void setEpoch(double epoch) { _epoch = epoch; }
122
139 const std::string &filter, const std::shared_ptr<afw::image::PhotoCalib>& photoCalib,
140 const std::shared_ptr<afw::cameraGeom::Detector>& detector, int visit, int ccd,
141 const lsst::jointcal::JointcalControl &control);
142
146 void addCcdImage(std::shared_ptr<CcdImage> const& ccdImage) { ccdImageList.push_back(ccdImage); }
147
149 void associateCatalogs(double matchCutInArcsec = 0, bool useFittedList = false,
150 bool enlargeFittedList = true);
151
166 std::string const &fluxField, float refCoordinateErr, bool rejectBadFluxes = false);
167
171
177 void prepareFittedStars(int minMeasurements);
178
187 void cleanFittedStars();
188
189 CcdImageList const &getCcdImageList() const { return ccdImageList; }
190
192 unsigned getNFilters() const { return 1; }
193
201
205 int nCcdImagesValidForFit() const;
206
211
212private:
213 void associateRefStars(double matchCutInArcsec, const AstrometryTransform *transform);
214
215 void assignMags();
216
222 void selectFittedStars(int minMeasurements);
223
230 void normalizeFittedStars();
231
232 // Common tangent point on-sky of all of the ccdImages, typically determined by computeCommonTangentPoint.
233 // (decimal degrees)
234 Point _commonTangentPoint;
235
236 // The number of MeasuredStars at the start of fitting, before any outliers are removed.
237 // This is used to reserve space in vectors for e.g. outlier removal, but is not updated during outlier
238 // removal or cleanup, so should only be used as an upper bound on the number of MeasuredStars.
239 size_t _maxMeasuredStars;
240
241 // Julian Epoch Year (e.g. 2000.0 for J2000)
242 // Common epoch of all of the ccdImages, typically computed externally via astropy and then set.
243 double _epoch{};
244};
245
246} // namespace jointcal
247} // namespace lsst
248#endif // LSST_JOINTCAL_ASSOCIATIONS_H
AmpInfoBoxKey bbox
Definition Amplifier.cc:117
This file declares a class for representing circular regions on the unit sphere.
table::Key< int > transform
Custom catalog class for record/table subclasses that are guaranteed to have an ID,...
A class representing an angle.
Definition Angle.h:128
An integer coordinate rectangle.
Definition Box.h:55
The class that implements the relations between MeasuredStar and FittedStar.
size_t nFittedStarsWithAssociatedRefStar() const
Return the number of fittedStars that have an associated refStar.
void cleanFittedStars()
Remove FittedStars that have no measured stars; this can happen after outlier rejection.
void computeCommonTangentPoint()
Sets a shared tangent point for all ccdImages, using the mean of the centers of all ccdImages.
Associations()
Source selection is performed in python, so Associations' constructor only initializes a couple of va...
CcdImageList const & getCcdImageList() const
lsst::sphgeom::Circle computeBoundingCircle() const
Return the bounding circle in on-sky (RA, Dec) coordinates containing all CcdImages.
Associations & operator=(Associations const &)=delete
int nCcdImagesValidForFit() const
return the number of CcdImages with non-empty catalogs to-be-fit.
Associations(Associations const &)=delete
No moves or copies: jointcal only ever needs one Associations object.
void setEpoch(double epoch)
Common epoch of all of the ccdImages as a Julian Epoch Year (e.g.
void addCcdImage(std::shared_ptr< CcdImage > const &ccdImage)
Add a pre-constructed ccdImage to the ccdImageList.
void createCcdImage(afw::table::SourceCatalog &catalog, const std::shared_ptr< lsst::afw::geom::SkyWcs > &wcs, const std::shared_ptr< lsst::afw::image::VisitInfo > &visitInfo, const lsst::geom::Box2I &bbox, const std::string &filter, const std::shared_ptr< afw::image::PhotoCalib > &photoCalib, const std::shared_ptr< afw::cameraGeom::Detector > &detector, int visit, int ccd, const lsst::jointcal::JointcalControl &control)
Create a ccdImage from an exposure catalog and metadata, and add it to the list.
unsigned getNFilters() const
Number of different bands in the input image list. Not implemented so far.
Associations(Associations &&)=delete
size_t getMaxMeasuredStars() const
The number of MeasuredStars at the start of fitting, before any outliers are removed.
void associateCatalogs(double matchCutInArcsec=0, bool useFittedList=false, bool enlargeFittedList=true)
incrementaly builds a merged catalog of all image catalogs
void setCommonTangentPoint(lsst::geom::Point2D const &commonTangentPoint)
Shared tangent point for all ccdImages (decimal degrees).
Associations(CcdImageList imageList, double epoch=0)
Create an Associations object from a pre-built list of ccdImages.
double getEpoch() const
Common epoch of all of the ccdImages as a Julian Epoch Year (e.g.
Point getCommonTangentPoint() const
Shared tangent point for all ccdImages (decimal degrees).
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.
Associations & operator=(Associations &&)=delete
void prepareFittedStars(int minMeasurements)
Prepare the fittedStar list by making quality cuts and normalizing measurements.
void deprojectFittedStars()
Sends back the fitted stars coordinates on the sky FittedStarsList::inTangentPlaneCoordinates keeps t...
a virtual (interface) class for geometric transformations.
A list of FittedStar s. Such a list is typically constructed by Associations.
Definition FittedStar.h:116
A point in a plane.
Definition Point.h:37
Circle is a circular region on the unit sphere that contains its boundary.
Definition Circle.h:54
T move(T... args)
STL namespace.
T push_back(T... args)
T size(T... args)
Key< int > visitInfo
Definition Exposure.cc:70