lsst.jointcal  master-gc935ebf72c
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Associations.h
Go to the documentation of this file.
1 // -*- LSST-C++ -*-
2 #ifndef LSST_JOINTCAL_ASSOCIATIONS_H
3 #define LSST_JOINTCAL_ASSOCIATIONS_H
4 
5 #include <string>
6 #include <iostream>
7 #include <list>
8 
9 #include "lsst/afw/table/Source.h"
10 #include "lsst/afw/image/TanWcs.h"
11 #include "lsst/afw/image/Calib.h"
12 #include "lsst/afw/image/VisitInfo.h"
13 #include "lsst/daf/base/PropertySet.h"
14 #include "lsst/afw/geom/Box.h"
15 
16 #include "lsst/jointcal/RefStar.h"
18 #include "lsst/jointcal/CcdImage.h"
19 #include "lsst/jointcal/Point.h"
21 
22 #include "lsst/afw/table/SortedCatalog.h"
23 
24 namespace lsst {
25 namespace jointcal {
26 
28 class Associations {
29 public:
30  CcdImageList ccdImageList; // the catalog handlers
31  RefStarList refStarList; // e.g. GAIA or SDSS reference stars
32  FittedStarList fittedStarList; // stars that are going to be fitted
33 
35 
36 public:
37  // These are strictly speaking not needed anymore (after DM-4043),
38  // but keeping them seems cleaner then exposing the lists themselves.
39  size_t refStarListSize() { return refStarList.size(); }
40  size_t fittedStarListSize() { return fittedStarList.size(); }
41 
46  Associations();
47 
53  void setCommonTangentPoint(lsst::afw::geom::Point2D const &commonTangentPoint);
54 
57 
71  void addImage(lsst::afw::table::SortedCatalogT<lsst::afw::table::SourceRecord> &catalog,
72  std::shared_ptr<lsst::afw::image::TanWcs> wcs,
73  std::shared_ptr<lsst::afw::image::VisitInfo> visitInfo, lsst::afw::geom::Box2I const &bbox,
74  std::string const &filter, std::shared_ptr<lsst::afw::image::Calib> calib, int visit,
75  int ccd, std::shared_ptr<lsst::jointcal::JointcalControl> control);
76 
78  void associateCatalogs(const double matchCutInArcsec = 0, const bool useFittedList = false,
79  const bool enlargeFittedList = true);
80 
88  void collectRefStars(lsst::afw::table::SortedCatalogT<lsst::afw::table::SimpleRecord> &refCat,
89  afw::geom::Angle matchCut, std::string const &fluxField);
90 
93  void deprojectFittedStars();
94 
96 /* If Color is "g-i", then the color is assigned from columns "g" and "i" of the colored catalog. */
97 #ifdef TODO
98  void setFittedStarColors(std::string const &dicStarListName, std::string const &color,
99  double matchCutArcSec);
100 #endif
101 
107  void selectFittedStars(int minMeasurements);
108 
109  const CcdImageList &getCcdImageList() const { return ccdImageList; }
110 
112  unsigned NBands() const { return 1; }
113 
114  // Return the bounding box in (ra, dec) coordinates containing the whole catalog
115  const lsst::afw::geom::Box2D getRaDecBBox();
116 
120  int nCcdImagesValidForFit() const {
121  return std::count_if(
122  ccdImageList.begin(), ccdImageList.end(),
123  [](std::shared_ptr<CcdImage> const &item) { return item->getCatalogForFit().size() > 0; });
124  }
125 
126 private:
127  void associateRefStars(double matchCutInArcsec, const Gtransfo *gtransfo);
128 
129  void assignMags();
130 };
131 
132 } // namespace jointcal
133 } // namespace lsst
134 #endif // LSST_JOINTCAL_ASSOCIATIONS_H
Point getCommonTangentPoint() const
can be used to project sidereal coordinates related to the image set on a plane.
Definition: Associations.h:56
A point in a plane.
Definition: Point.h:13
void addImage(lsst::afw::table::SortedCatalogT< lsst::afw::table::SourceRecord > &catalog, std::shared_ptr< lsst::afw::image::TanWcs > wcs, std::shared_ptr< lsst::afw::image::VisitInfo > visitInfo, lsst::afw::geom::Box2I const &bbox, std::string const &filter, std::shared_ptr< lsst::afw::image::Calib > calib, int visit, int ccd, std::shared_ptr< lsst::jointcal::JointcalControl > control)
Create a ccdImage from an exposure catalog and metadata, and add it to the list.
Definition: Associations.cc:38
The class that implements the relations between MeasuredStar and FittedStar.
Definition: Associations.h:28
void associateCatalogs(const double matchCutInArcsec=0, const bool useFittedList=false, const bool enlargeFittedList=true)
incrementaly builds a merged catalog of all image catalogs
Definition: Associations.cc:56
void selectFittedStars(int minMeasurements)
Set the color field of FittedStar &#39;s from a colored catalog.
const CcdImageList & getCcdImageList() const
Definition: Associations.h:109
A list of FittedStar s. Such a list is typically constructed by Associations.
Definition: FittedStar.h:134
void deprojectFittedStars()
Sends back the fitted stars coordinates on the sky FittedStarsList::inTangentPlaneCoordinates keeps t...
unsigned NBands() const
Number of different bands in the input image list. Not implemented so far.
Definition: Associations.h:112
void setCommonTangentPoint(lsst::afw::geom::Point2D const &commonTangentPoint)
Sets a shared tangent point for all ccdImages.
Definition: Associations.cc:51
a virtual (interface) class for geometric transformations.
Definition: Gtransfo.h:37
const lsst::afw::geom::Box2D getRaDecBBox()
Associations()
Source selection is performed in python, so Associations&#39; constructor only initializes a couple of va...
Definition: Associations.cc:36
void collectRefStars(lsst::afw::table::SortedCatalogT< lsst::afw::table::SimpleRecord > &refCat, afw::geom::Angle matchCut, std::string const &fluxField)
Collect stars from an external reference catalog and associate them with fittedStars.
std::list< std::shared_ptr< CcdImage > > CcdImageList
Definition: CcdImage.h:22
int nCcdImagesValidForFit() const
return the number of CcdImages with non-empty catalogs to-be-fit.
Definition: Associations.h:120
FittedStarList fittedStarList
Definition: Associations.h:32