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