LSST Applications 27.0.0,g0265f82a02+469cd937ee,g02d81e74bb+21ad69e7e1,g1470d8bcf6+cbe83ee85a,g2079a07aa2+e67c6346a6,g212a7c68fe+04a9158687,g2305ad1205+94392ce272,g295015adf3+81dd352a9d,g2bbee38e9b+469cd937ee,g337abbeb29+469cd937ee,g3939d97d7f+72a9f7b576,g487adcacf7+71499e7cba,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+df404f777f,g5a732f18d5+be83d3ecdb,g64a986408d+21ad69e7e1,g858d7b2824+21ad69e7e1,g8a8a8dda67+a6fc98d2e7,g99cad8db69+f62e5b0af5,g9ddcbc5298+d4bad12328,ga1e77700b3+9c366c4306,ga8c6da7877+71e4819109,gb0e22166c9+25ba2f69a1,gb6a65358fc+469cd937ee,gbb8dafda3b+69d3c0e320,gc07e1c2157+a98bf949bb,gc120e1dc64+615ec43309,gc28159a63d+469cd937ee,gcf0d15dbbd+72a9f7b576,gdaeeff99f8+a38ce5ea23,ge6526c86ff+3a7c1ac5f1,ge79ae78c31+469cd937ee,gee10cc3b42+a6fc98d2e7,gf1cff7945b+21ad69e7e1,gfbcc870c63+9a11dc8c8f
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.
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:53
T move(T... args)
STL namespace.
T push_back(T... args)
T size(T... args)
Key< int > visitInfo
Definition Exposure.cc:70