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