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