lsst.jointcal  14.0-26-gc4bc114+7
Associations.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 #include <cmath>
3 #include <iostream>
4 #include <limits>
5 #include <sstream>
6 
7 #include "lsst/log/Log.h"
13 #include "lsst/jointcal/Frame.h"
15 #include "lsst/jointcal/FatPoint.h"
16 #include "lsst/afw/image/Image.h"
19 
20 #include "lsst/pex/exceptions.h"
21 #include "lsst/afw/geom/Box.h"
22 #include "lsst/afw/geom/Point.h"
23 #include "lsst/afw/coord/Coord.h"
24 #include "lsst/afw/image/Calib.h"
25 
26 namespace jointcal = lsst::jointcal;
27 
28 namespace {
29 LOG_LOGGER _log = LOG_GET("jointcal.Associations");
30 }
31 
32 // TODO: Remove this once RFC-356 is implemented and all refcats give fluxes in Maggies.
33 const double JanskyToMaggy = 3631.0;
34 
35 namespace lsst {
36 namespace jointcal {
37 
41  lsst::afw::geom::Box2I const &bbox, std::string const &filter,
43  std::shared_ptr<afw::cameraGeom::Detector> detector, int visit, int ccd,
44  lsst::jointcal::JointcalControl const &control) {
45  auto ccdImage = std::make_shared<CcdImage>(catalog, wcs, visitInfo, bbox, filter, photoCalib, detector,
46  visit, ccd, control.sourceFluxField);
47  ccdImageList.push_back(ccdImage);
48  LOGLS_DEBUG(_log, "Catalog " << ccdImage->getName() << " has " << ccdImage->getWholeCatalog().size()
49  << " objects.");
50 }
51 
53  _commonTangentPoint = Point(commonTangentPoint.getX(), commonTangentPoint.getY()); // a jointcal::Point
54  for (auto &ccdImage : ccdImageList) ccdImage->setCommonTangentPoint(_commonTangentPoint);
55 }
56 
57 void Associations::associateCatalogs(const double matchCutInArcSec, const bool useFittedList,
58  const bool enlargeFittedList) {
59  // clear reference stars
60  refStarList.clear();
61 
62  // clear measurement counts and associations to refstars, but keep fittedStars themselves.
63  for (auto &item : fittedStarList) {
64  item->clearBeforeAssoc();
65  }
66  // clear fitted stars
67  if (!useFittedList) fittedStarList.clear();
68 
69  for (auto &ccdImage : ccdImageList) {
70  const Gtransfo *toCommonTangentPlane = ccdImage->getPix2CommonTangentPlane();
71 
72  // Clear the catalog to fit and copy the whole catalog into it.
73  // This allows reassociating from scratch after a fit.
74  ccdImage->getCatalogForFit().clear();
75  ccdImage->getWholeCatalog().copyTo(ccdImage->getCatalogForFit());
76  MeasuredStarList &catalog = ccdImage->getCatalogForFit();
77 
78  // Associate with previous lists.
79  /* To speed up the match (more precisely the contruction of the FastFinder), select in the
80  fittedStarList the objects that are within reach of the current ccdImage */
81  Frame ccdImageFrameCPT = applyTransfo(ccdImage->getImageFrame(), *toCommonTangentPlane, LargeFrame);
82  ccdImageFrameCPT = ccdImageFrameCPT.rescale(1.10); // add 10 % margin.
83  // We cannot use FittedStarList::ExtractInFrame, because it does an actual copy, which we don't want
84  // here: we want the pointers in the StarMatch to refer to fittedStarList elements.
85  FittedStarList toMatch;
86 
87  for (auto const &fittedStar : fittedStarList) {
88  if (ccdImageFrameCPT.inFrame(*fittedStar)) {
89  toMatch.push_back(fittedStar);
90  }
91  }
92 
93  // divide by 3600 because coordinates in CTP are in degrees.
94  auto starMatchList = listMatchCollect(Measured2Base(catalog), Fitted2Base(toMatch),
95  toCommonTangentPlane, matchCutInArcSec / 3600.);
96 
97  /* should check what this removeAmbiguities does... */
98  LOGLS_DEBUG(_log, "Measured-to-Fitted matches before removing ambiguities " << starMatchList->size());
99  starMatchList->removeAmbiguities(*toCommonTangentPlane);
100  LOGLS_DEBUG(_log, "Measured-to-Fitted matches after removing ambiguities " << starMatchList->size());
101 
102  // Associate MeasuredStar -> FittedStar using the surviving matches.
103 
104  int matchedCount = 0;
105  for (auto const &starMatch : *starMatchList) {
106  auto bs = starMatch.s1;
107  auto ms_const = std::dynamic_pointer_cast<const MeasuredStar>(bs);
108  auto ms = std::const_pointer_cast<MeasuredStar>(ms_const);
109  auto bs2 = starMatch.s2;
110  auto fs_const = std::dynamic_pointer_cast<const FittedStar>(bs2);
111  auto fs = std::const_pointer_cast<FittedStar>(fs_const);
112  ms->setFittedStar(fs);
113  matchedCount++;
114  }
115  LOGLS_INFO(_log, "Matched " << matchedCount << " objects in " << ccdImage->getName());
116 
117  // add unmatched objets to FittedStarList
118  int unMatchedCount = 0;
119  for (auto const &mstar : catalog) {
120  // to check if it was matched, just check if it has a fittedStar Pointer assigned
121  if (mstar->getFittedStar()) continue;
122  if (enlargeFittedList) {
123  auto fs = std::make_shared<FittedStar>(*mstar);
124  // transform coordinates to CommonTangentPlane
125  toCommonTangentPlane->transformPosAndErrors(*fs, *fs);
126  fittedStarList.push_back(fs);
127  mstar->setFittedStar(fs);
128  }
129  unMatchedCount++;
130  }
131  LOGLS_INFO(_log, "Unmatched objects: " << unMatchedCount);
132  } // end of loop on CcdImages
133 
134  assignMags();
135 }
136 
138  afw::geom::Angle matchCut, std::string const &fluxField,
139  std::map<std::string, std::vector<double>> const &refFluxMap,
140  std::map<std::string, std::vector<double>> const &refFluxErrMap,
141  bool rejectBadFluxes) {
142  if (refCat.size() == 0) {
144  " reference catalog is empty : stop here "));
145  }
146 
147  afw::table::CoordKey coordKey = refCat.getSchema()["coord"];
148  auto fluxKey = refCat.getSchema().find<double>(fluxField).key;
149  // Don't blow up if the reference catalog doesn't contain errors.
150  afw::table::Key<double> fluxErrKey;
151  try {
152  fluxErrKey = refCat.getSchema().find<double>(fluxField + "Sigma").key;
153  } catch (pex::exceptions::NotFoundError &) {
154  LOGLS_WARN(_log, "Flux error field ("
155  << fluxField << "Sigma"
156  << ") not found in reference catalog. Not using ref flux errors.");
157  }
158  _filterMap.clear();
159  _filterMap.reserve(refFluxMap.size());
160  size_t nFilters = 0;
161  for (auto const &filter : refFluxMap) {
162  _filterMap[filter.first] = nFilters;
163  nFilters++;
164  }
165 
166  refStarList.clear();
167  for (size_t i = 0; i < refCat.size(); i++) {
168  auto const &record = refCat.get(i);
169 
170  afw::coord::IcrsCoord coord = record->get(coordKey);
171  double defaultFlux = record->get(fluxKey) / JanskyToMaggy;
172  double defaultFluxErr;
173  if (fluxErrKey.isValid()) {
174  defaultFluxErr = record->get(fluxErrKey) / JanskyToMaggy;
175  } else {
176  defaultFluxErr = std::numeric_limits<double>::quiet_NaN();
177  }
178  std::vector<double> fluxList(nFilters);
179  std::vector<double> fluxErrList(nFilters);
180  for (auto const &filter : _filterMap) {
181  fluxList[filter.second] = refFluxMap.at(filter.first).at(i) / JanskyToMaggy;
182  fluxErrList[filter.second] = refFluxErrMap.at(filter.first).at(i) / JanskyToMaggy;
183  }
184  double ra = lsst::afw::geom::radToDeg(coord.getLongitude());
185  double dec = lsst::afw::geom::radToDeg(coord.getLatitude());
186  auto star = std::make_shared<RefStar>(ra, dec, defaultFlux, defaultFluxErr, fluxList, fluxErrList);
187 
188  // TODO DM-10826: RefCats aren't guaranteed to have position errors.
189  // TODO: Need to devise a way to check whether the refCat has position errors
190  // TODO: and use them instead, if available.
191  // cook up errors: 100 mas per cooordinate
192  star->vx = std::pow(0.1 / 3600 / cos(coord.getLatitude()), 2);
193  star->vy = std::pow(0.1 / 3600, 2);
194  star->vxy = 0.;
195 
196  // Reject sources with non-finite fluxes and flux errors, and fluxErr=0 (which gives chi2=inf).
197  if (rejectBadFluxes &&
198  (!std::isfinite(defaultFlux) || !std::isfinite(defaultFluxErr) || defaultFluxErr == 0))
199  continue;
200  refStarList.push_back(star);
201  }
202 
203  // project on CTP (i.e. RaDec2CTP), in degrees
204  GtransfoLin identity;
205  TanRaDec2Pix raDec2CTP(identity, _commonTangentPoint);
206 
207  associateRefStars(matchCut.asArcseconds(), &raDec2CTP);
208 }
209 
211  // compute the frame on the CTP that contains all input images
212  Frame tangentPlaneFrame;
213 
214  for (auto const &ccdImage : ccdImageList) {
215  Frame CTPFrame =
216  applyTransfo(ccdImage->getImageFrame(), *(ccdImage->getPix2CommonTangentPlane()), LargeFrame);
217  if (tangentPlaneFrame.getArea() == 0)
218  tangentPlaneFrame = CTPFrame;
219  else
220  tangentPlaneFrame += CTPFrame;
221  }
222 
223  // convert tangent plane coordinates to RaDec:
224  GtransfoLin identity;
225  TanPix2RaDec CTP2RaDec(identity, _commonTangentPoint);
226  Frame raDecFrame = applyTransfo(tangentPlaneFrame, CTP2RaDec, LargeFrame);
227 
228  lsst::afw::geom::Point<double> min(raDecFrame.xMin, raDecFrame.yMin);
229  lsst::afw::geom::Point<double> max(raDecFrame.xMax, raDecFrame.yMax);
230  lsst::afw::geom::Box2D box(min, max);
231 
232  return box;
233 }
234 
235 void Associations::associateRefStars(double matchCutInArcSec, const Gtransfo *gtransfo) {
236  // associate with FittedStars
237  // 3600 because coordinates are in degrees (in CTP).
238  auto starMatchList = listMatchCollect(Ref2Base(refStarList), Fitted2Base(fittedStarList), gtransfo,
239  matchCutInArcSec / 3600.);
240 
241  LOGLS_DEBUG(_log, "Refcat matches before removing ambiguities " << starMatchList->size());
242  starMatchList->removeAmbiguities(*gtransfo);
243  LOGLS_DEBUG(_log, "Refcat matches after removing ambiguities " << starMatchList->size());
244 
245  // actually associate things
246  for (auto const &starMatch : *starMatchList) {
247  const BaseStar &bs = *starMatch.s1;
248  const RefStar &rs_const = dynamic_cast<const RefStar &>(bs);
249  RefStar &rs = const_cast<RefStar &>(rs_const);
250  const BaseStar &bs2 = *starMatch.s2;
251  const FittedStar &fs_const = dynamic_cast<const FittedStar &>(bs2);
252  FittedStar &fs = const_cast<FittedStar &>(fs_const);
253  // rs->setFittedStar(*fs);
254  fs.setRefStar(&rs);
255  }
256 
257  LOGLS_INFO(_log,
258  "Associated " << starMatchList->size() << " reference stars among " << refStarList.size());
259 }
260 
261 void Associations::prepareFittedStars(int minMeasurements) {
262  selectFittedStars(minMeasurements);
263  normalizeFittedStars();
264 }
265 
266 void Associations::selectFittedStars(int minMeasurements) {
267  LOGLS_INFO(_log, "Fitted stars before measurement # cut: " << fittedStarList.size());
268 
269  // first pass: remove objects that have less than a certain number of measurements.
270  for (auto const &ccdImage : ccdImageList) {
271  MeasuredStarList &catalog = ccdImage->getCatalogForFit();
272  // Iteration happens internal to the loop, as we may delete measuredStars from catalog.
273  for (MeasuredStarIterator mi = catalog.begin(); mi != catalog.end();) {
274  MeasuredStar &mstar = **mi;
275 
276  auto fittedStar = mstar.getFittedStar();
277  // measuredStar has no fittedStar: move on.
278  if (fittedStar == nullptr) {
279  ++mi;
280  continue;
281  }
282 
283  // keep FittedStars which either have a minimum number of
284  // measurements, or are matched to a RefStar
285  if (!fittedStar->getRefStar() && fittedStar->getMeasurementCount() < minMeasurements) {
286  fittedStar->getMeasurementCount()--;
287  mi = catalog.erase(mi); // mi now points to the next measuredStar.
288  } else {
289  ++mi;
290  }
291  } // end loop on objects in catalog
292  } // end loop on catalogs
293 
294  // now FittedStars with less than minMeasurements should have zero measurementCount.
295  for (FittedStarIterator fi = fittedStarList.begin(); fi != fittedStarList.end();) {
296  if ((*fi)->getMeasurementCount() == 0) {
297  fi = fittedStarList.erase(fi);
298  } else {
299  ++fi;
300  }
301  }
302 
303  LOGLS_INFO(_log, "Fitted stars after measurement # cut: " << fittedStarList.size());
304 }
305 
306 void Associations::normalizeFittedStars() const {
307  // Clear positions in order to take the average of the measuredStars.
308  for (auto &fittedStar : fittedStarList) {
309  fittedStar->x = 0.0;
310  fittedStar->y = 0.0;
311  fittedStar->setFlux(0.0);
312  }
313 
314  // Iterate over measuredStars to add their values into their fittedStars
315  for (auto const &ccdImage : ccdImageList) {
316  const Gtransfo *toCommonTangentPlane = ccdImage->getPix2CommonTangentPlane();
317  MeasuredStarList &catalog = ccdImage->getCatalogForFit();
318  for (auto &mi : catalog) {
319  auto fittedStar = mi->getFittedStar();
320  if (fittedStar == nullptr)
321  throw(LSST_EXCEPT(
323  "All measuredStars must have a fittedStar: did you call selectFittedStars()?"));
324  auto point = toCommonTangentPlane->apply(*mi);
325  fittedStar->x += point.x;
326  fittedStar->y += point.y;
327  fittedStar->getFlux() += mi->getFlux();
328  }
329  }
330 
331  for (auto &fi : fittedStarList) {
332  auto measurementCount = fi->getMeasurementCount();
333  fi->x /= measurementCount;
334  fi->y /= measurementCount;
335  fi->getFlux() /= measurementCount;
336  }
337 }
338 
339 void Associations::assignMags() {
340  for (auto const &ccdImage : ccdImageList) {
341  MeasuredStarList &catalog = ccdImage->getCatalogForFit();
342  for (auto const &mstar : catalog) {
343  auto fstar = mstar->getFittedStar();
344  if (!fstar) continue;
345  fstar->addMagMeasurement(mstar->getMag(), mstar->getMagWeight());
346  }
347  }
348 }
349 
351  // By default, Associations::fittedStarList is expressed on the Associations::commonTangentPlane.
352  // For AstrometryFit, we need it on the sky.
353  if (!fittedStarList.inTangentPlaneCoordinates) {
354  LOGLS_WARN(_log,
355  "DeprojectFittedStars: Fitted stars are already in sidereal coordinates, nothing done ");
356  return;
357  }
358 
359  TanPix2RaDec ctp2Sky(GtransfoLin(), getCommonTangentPoint());
360  fittedStarList.applyTransfo(ctp2Sky);
361  fittedStarList.inTangentPlaneCoordinates = false;
362 }
363 
365  return std::count_if(ccdImageList.begin(), ccdImageList.end(), [](std::shared_ptr<CcdImage> const &item) {
366  return item->getCatalogForFit().size() > 0;
367  });
368 }
369 
371  size_t count = 0;
372  for (auto const &fittedStar : fittedStarList) {
373  if ((fittedStar != nullptr) & (fittedStar->getRefStar() != nullptr)) count++;
374  }
375  return count;
376 }
377 
378 #ifdef TODO
379 void Associations::collectMCStars(int realization) {
380  CcdImageIterator I;
381  StarMatchIterator smI;
382 
383  for (I = ccdImageList.begin(); I != ccdImageList.end(); I++) {
384  CcdImage &ccdImage = **I;
385  string dbimdir = ccdImage.Dir();
386  string mctruth = dbimdir + "/mc/mctruth.list";
387 
388  if (realization >= 0) {
389  stringstream sstrm;
390  sstrm << dbimdir << "/mc/mctruth_" << realization << ".list";
391  mctruth = sstrm.str();
392  }
393 
394  GtransfoIdentity gti;
395  MeasuredStarList &catalog = ccdImage.getCatalogForFit();
396 
397  // BaseStarWithErrorList mctruthlist(mctruth);
398  DicStarList mctruthlist(mctruth);
399  auto starMatchList =
400  listMatchCollect(Measured2Base(catalog), Dic2Base(mctruthlist), &gti, 1. /* pixel ? */);
401  if (starMatchList)
402  for (smI = starMatchList->begin(); smI != starMatchList->end(); smI++) {
403  StarMatch &sm = *smI;
404  BaseStar *bs = sm.s1;
405  MeasuredStar *mstar = dynamic_cast<MeasuredStar *>(bs);
406  bs = sm.s2;
407  DicStar *dstar = dynamic_cast<DicStar *>(bs);
408  std::unique_ptr<BaseStarWithError> mcstar(new BaseStarWithError(*bs));
409  mcstar->GetMCInfo().iflux = dstar->getval("iflux");
410  mcstar->GetMCInfo().tflux = dstar->getval("sflux");
411  /*
412  mstar->SetMCTruth(mcstar);
413  mstar->SetMCMeas(mcstar);
414  */
415  }
416  else
417  LOGLS_FATAL(_log, "CollectMCStars Unable to match MCTruth w/ catalog!");
418  }
419 }
420 
421 void Associations::setFittedStarColors(std::string dicStarListName, std::string color,
422  double matchCutArcSec) {
423  // decode color string in case it is x-y
424  size_t pos_minus = color.find('-');
425  bool compute_diff = (pos_minus != string::npos);
426  std::string c1, c2;
427  c1 = color.substr(0, pos_minus); // if pos_minus == npos, means "up to the end"
428  if (compute_diff) c2 = color.substr(pos_minus + 1, string::npos);
429  DicStarList cList(dicStarListName);
430  if (!cList.HasKey(c1))
431  throw(GastroException("Associations::SetFittedstarColors : " + dicStarListName +
432  " misses a key named \"" + c1 + "\""));
433  if (compute_diff && !cList.HasKey(c2))
434  throw(GastroException("Associations::SetFittedstarColors : " + dicStarListName +
435  " misses a key named \"" + c2 + "\""));
436  // we associate in some tangent plane. The reference catalog is expressed on the sky,
437  // but FittedStar's may be still in this tangent plane.
438  BaseStarList &l1 = (BaseStarList &)fittedStarList;
440  TanRaDec2Pix proj(GtransfoLin(), getCommonTangentPoint());
441  // project or not ?
442  Gtransfo *id_or_proj = &proj;
443  if (fittedStarList.inTangentPlaneCoordinates) id_or_proj = &id;
444  // The color List is to be projected:
445  TStarList projected_cList((BaseStarList &)cList, proj);
446  // Associate
447  auto starMatchList = listMatchCollect(Fitted2Base(fittedStarList), (const BaseStarList &)projected_cList,
448  id_or_proj, matchCutArcSec / 3600);
449 
450  LOGLS_INFO(_log, "Matched " << starMatchList->size() << '/' << fittedStarList.size()
451  << " FittedStars to color catalog");
452  // Evaluate and assign colors.
453  for (auto i = starMatchList->begin(); i != starMatchList->end(); ++i) {
454  BaseStar *s1 = i->s1;
455  FittedStar *fs = dynamic_cast<FittedStar *>(s1);
456  BaseStar *s2 = i->s2;
457  const TStar *ts = dynamic_cast<const TStar *>(s2);
458  const DicStar *ds = dynamic_cast<const DicStar *>(ts->get_original());
459  fs->color = ds->getval(c1);
460  if (compute_diff) fs->color -= ds->getval(c2);
461  }
462 }
463 
464 #endif /* TODO */
465 } // namespace jointcal
466 } // namespace lsst
#define LOGLS_WARN(logger, message)
Objects used as position anchors, typically USNO stars.
Definition: RefStar.h:16
implements the linear transformations (6 real coefficients).
Definition: Gtransfo.h:294
int nCcdImagesValidForFit() const
return the number of CcdImages with non-empty catalogs to-be-fit.
lsst::afw::geom::Angle getLongitude() const
MeasuredStarList::iterator MeasuredStarIterator
Definition: MeasuredStar.h:120
A hanger for star associations.
Definition: StarMatch.h:31
A point in a plane.
Definition: Point.h:13
double getArea() const
Definition: Frame.cc:102
the transformation that handles pix to sideral transfos (Gnomonic, possibly with polynomial distortio...
Definition: Gtransfo.h:480
int min
double xMin
coordinate of boundary.
Definition: Frame.h:22
T end(T... args)
constexpr double asArcseconds() const noexcept
STL class.
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:57
A list of MeasuredStar. They are usually filled in Associations::AddImage.
Definition: MeasuredStar.h:112
lsst::afw::geom::Angle getLatitude() const
Frame rescale(const double factor) const
rescale it. The center does not move.
Definition: Frame.cc:94
void collectRefStars(lsst::afw::table::SortedCatalogT< lsst::afw::table::SimpleRecord > &refCat, afw::geom::Angle matchCut, std::string const &fluxField, std::map< std::string, std::vector< double >> const &refFluxMap, std::map< std::string, std::vector< double >> const &refFluxErrMap, bool rejectBadFluxes=false)
Collect stars from an external reference catalog and associate them with fittedStars.
STL class.
pairs of points
The base class for handling stars. Used by all matching routines.
Definition: BaseStar.h:22
T at(T... args)
void prepareFittedStars(int minMeasurements)
Set the color field of FittedStar &#39;s from a colored catalog.
size_t nFittedStarsWithAssociatedRefStar() const
Return the number of fittedStars that have an associated refStar.
T push_back(T... args)
std::lists of Stars.
Definition: StarList.h:35
rectangle with sides parallel to axes.
Definition: Frame.h:19
#define LOGLS_DEBUG(logger, message)
Class for a simple mapping implementing a generic Gtransfo.
void setRefStar(const RefStar *_refStar)
Set the astrometric reference star associated with this star.
Definition: FittedStar.cc:30
FittedStarList::iterator FittedStarIterator
Definition: FittedStar.h:130
int max
T erase(T... args)
A list of FittedStar s. Such a list is typically constructed by Associations.
Definition: FittedStar.h:121
std::unique_ptr< StarMatchList > listMatchCollect(const BaseStarList &list1, const BaseStarList &list2, const Gtransfo *guess, const double maxDist)
assembles star matches.
Definition: ListMatch.cc:538
T str(T... args)
T isfinite(T... args)
virtual void transformPosAndErrors(const FatPoint &in, FatPoint &out) const
Definition: Gtransfo.cc:100
T cos(T... args)
objects measured on actual images.
Definition: MeasuredStar.h:18
T dynamic_pointer_cast(T... args)
::std::list< StarMatch >::iterator StarMatchIterator
Definition: StarMatch.h:110
void deprojectFittedStars()
Sends back the fitted stars coordinates on the sky FittedStarsList::inTangentPlaneCoordinates keeps t...
T count_if(T... args)
#define LOGLS_INFO(logger, message)
void setCommonTangentPoint(lsst::afw::geom::Point2D const &commonTangentPoint)
Sets a shared tangent point for all ccdImages.
Definition: Associations.cc:52
T find(T... args)
A do-nothing transformation. It anyway has dummy routines to mimick a Gtransfo.
Definition: Gtransfo.h:152
#define LSST_EXCEPT(type,...)
STL class.
This one is the Tangent Plane (called gnomonic) projection (from celestial sphere to tangent plane) ...
Definition: Gtransfo.h:554
T begin(T... args)
T pow(T... args)
void addImage(lsst::afw::table::SortedCatalogT< lsst::afw::table::SourceRecord > &catalog, std::shared_ptr< lsst::afw::geom::SkyWcs > wcs, std::shared_ptr< lsst::afw::image::VisitInfo > visitInfo, lsst::afw::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.
Definition: Associations.cc:38
MeasuredStarList const & getCatalogForFit() const
Gets the catalog to be used for fitting, which may have been cleaned-up.
Definition: CcdImage.h:65
Combinatorial searches for linear transformations to go from list1 to list2.
BaseStarList & Fitted2Base(FittedStarList &This)
Definition: FittedStar.cc:48
a virtual (interface) class for geometric transformations.
Definition: Gtransfo.h:41
std::shared_ptr< const BaseStar > s2
Definition: StarMatch.h:39
const lsst::afw::geom::Box2D getRaDecBBox()
BaseStarList & Measured2Base(MeasuredStarList &This)
Definition: MeasuredStar.cc:35
int id
constexpr double radToDeg(double x) noexcept
std::shared_ptr< RecordT > const get(size_type i) const
std::shared_ptr< const BaseStar > s1
Definition: StarMatch.h:39
T dec(T... args)
T substr(T... args)
Frame applyTransfo(const Frame &inputframe, const Gtransfo &gtransfo, const WhichTransformed which)
Transform a Frame through a Transfo.
Definition: AstroUtils.cc:15
std::string sourceFluxField
"name of flux field in source catalog" ;
T quiet_NaN(T... args)
#define LOGLS_FATAL(logger, message)
Handler of an actual image from a single CCD.
Definition: CcdImage.h:35
#define LOG_GET(logger)
const double JanskyToMaggy
Definition: Associations.cc:33
std::shared_ptr< FittedStar > getFittedStar() const
Definition: MeasuredStar.h:83
The objects which have been measured several times.
Definition: FittedStar.h:37
virtual void apply(const double xIn, const double yIn, double &xOut, double &yOut) const =0
BaseStarList & Ref2Base(RefStarList &This)
Definition: RefStar.cc:11