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
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