lsst.jointcal  14.0-18-gbdafc55
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 
75  ccdImage->getCatalogForFit().clear();
76  ccdImage->getWholeCatalog().copyTo(ccdImage->getCatalogForFit());
77  MeasuredStarList &catalog = ccdImage->getCatalogForFit();
78 
79  // associate with previous lists
80  /* to speed up the match (more precisely the contruction of the
81  FastFinder), select in the fittedStarList the objects that
82  are within reach of the current ccdImage
83  */
84  Frame ccdImageFrameCPT = applyTransfo(ccdImage->getImageFrame(), *toCommonTangentPlane, LargeFrame);
85  ccdImageFrameCPT = ccdImageFrameCPT.rescale(1.10); // add 10 % margin.
86  /* we cannot use FittedStarList::ExtractInFrame, because it does an
87  actual copy, which we don't want here: we want the pointers in
88  the StarMatch to refer to fittedStarList elements. */
89  FittedStarList toMatch;
90 
91  for (auto const &fittedStar : fittedStarList) {
92  if (ccdImageFrameCPT.inFrame(*fittedStar)) {
93  toMatch.push_back(fittedStar);
94  }
95  }
96 
97  // divide by 3600 because coordinates in CTP are in degrees.
98  auto starMatchList = listMatchCollect(Measured2Base(catalog), Fitted2Base(toMatch),
99  toCommonTangentPlane, matchCutInArcSec / 3600.);
100 
101  /* should check what this removeAmbiguities does... */
102  LOGLS_DEBUG(_log, "Measured-to-Fitted matches before removing ambiguities " << starMatchList->size());
103  starMatchList->removeAmbiguities(*toCommonTangentPlane);
104  LOGLS_DEBUG(_log, "Measured-to-Fitted matches after removing ambiguities " << starMatchList->size());
105 
106  /* associate MeasuredStar -> FittedStar using the
107  surviving matches */
108 
109  int matchedCount = 0;
110  for (auto const &starMatch : *starMatchList) {
111  auto bs = starMatch.s1;
112  auto ms_const = std::dynamic_pointer_cast<const MeasuredStar>(bs);
113  auto ms = std::const_pointer_cast<MeasuredStar>(ms_const);
114  auto bs2 = starMatch.s2;
115  auto fs_const = std::dynamic_pointer_cast<const FittedStar>(bs2);
116  auto fs = std::const_pointer_cast<FittedStar>(fs_const);
117  ms->setFittedStar(fs);
118  matchedCount++;
119  }
120  LOGLS_INFO(_log, "Matched " << matchedCount << " objects in " << ccdImage->getName());
121 
122  // add unmatched objets to FittedStarList
123  int unMatchedCount = 0;
124  for (auto const &mstar : catalog) {
125  // to check if it was matched, just check if it has a fittedStar Pointer assigned
126  if (mstar->getFittedStar()) continue;
127  if (enlargeFittedList) {
128  auto fs = std::make_shared<FittedStar>(*mstar);
129  // transform coordinates to CommonTangentPlane
130  toCommonTangentPlane->transformPosAndErrors(*fs, *fs);
131  fittedStarList.push_back(fs);
132  mstar->setFittedStar(fs);
133  }
134  unMatchedCount++;
135  }
136  LOGLS_INFO(_log, "Unmatched objects: " << unMatchedCount);
137  } // end of loop on CcdImages
138 
139  assignMags();
140 }
141 
143  afw::geom::Angle matchCut, std::string const &fluxField,
144  std::map<std::string, std::vector<double>> const &refFluxMap,
145  std::map<std::string, std::vector<double>> const &refFluxErrMap,
146  bool rejectBadFluxes) {
147  if (refCat.size() == 0) {
149  " reference catalog is empty : stop here "));
150  }
151 
152  afw::table::CoordKey coordKey = refCat.getSchema()["coord"];
153  auto fluxKey = refCat.getSchema().find<double>(fluxField).key;
154  // Don't blow up if the reference catalog doesn't contain errors.
155  afw::table::Key<double> fluxErrKey;
156  try {
157  fluxErrKey = refCat.getSchema().find<double>(fluxField + "Sigma").key;
158  } catch (pex::exceptions::NotFoundError &) {
159  LOGLS_WARN(_log, "Flux error field ("
160  << fluxField << "Sigma"
161  << ") not found in reference catalog. Not using ref flux errors.");
162  }
163  _filterMap.clear();
164  _filterMap.reserve(refFluxMap.size());
165  size_t nFilters = 0;
166  for (auto const &filter : refFluxMap) {
167  _filterMap[filter.first] = nFilters;
168  nFilters++;
169  }
170 
171  refStarList.clear();
172  for (size_t i = 0; i < refCat.size(); i++) {
173  auto const &record = refCat.get(i);
174 
175  afw::coord::Coord coord = record->get(coordKey);
176  double defaultFlux = record->get(fluxKey) / JanskyToMaggy;
177  double defaultFluxErr;
178  if (fluxErrKey.isValid()) {
179  defaultFluxErr = record->get(fluxErrKey) / JanskyToMaggy;
180  } else {
181  defaultFluxErr = std::numeric_limits<double>::quiet_NaN();
182  }
183  std::vector<double> fluxList(nFilters);
184  std::vector<double> fluxErrList(nFilters);
185  for (auto const &filter : _filterMap) {
186  fluxList[filter.second] = refFluxMap.at(filter.first).at(i) / JanskyToMaggy;
187  fluxErrList[filter.second] = refFluxErrMap.at(filter.first).at(i) / JanskyToMaggy;
188  }
189  double ra = lsst::afw::geom::radToDeg(coord.getLongitude());
190  double dec = lsst::afw::geom::radToDeg(coord.getLatitude());
191  auto star = std::make_shared<RefStar>(ra, dec, defaultFlux, defaultFluxErr, fluxList, fluxErrList);
192 
193  // TODO DM-10826: RefCats aren't guaranteed to have position errors.
194  // TODO: Need to devise a way to check whether the refCat has position errors
195  // TODO: and use them instead, if available.
196  // cook up errors: 100 mas per cooordinate
197  star->vx = std::pow(0.1 / 3600 / cos(coord.getLatitude()), 2);
198  star->vy = std::pow(0.1 / 3600, 2);
199  star->vxy = 0.;
200 
201  // Reject sources with non-finite fluxes and flux errors, and fluxErr=0 (which gives chi2=inf).
202  if (rejectBadFluxes &&
203  (!std::isfinite(defaultFlux) || !std::isfinite(defaultFluxErr) || defaultFluxErr == 0))
204  continue;
205  refStarList.push_back(star);
206  }
207 
208  // project on CTP (i.e. RaDec2CTP), in degrees
209  GtransfoLin identity;
210  TanRaDec2Pix raDec2CTP(identity, _commonTangentPoint);
211 
212  associateRefStars(matchCut.asArcseconds(), &raDec2CTP);
213 }
214 
216  // compute the frame on the CTP that contains all input images
217  Frame tangentPlaneFrame;
218 
219  for (auto const &ccdImage : ccdImageList) {
220  Frame CTPFrame =
221  applyTransfo(ccdImage->getImageFrame(), *(ccdImage->getPix2CommonTangentPlane()), LargeFrame);
222  if (tangentPlaneFrame.getArea() == 0)
223  tangentPlaneFrame = CTPFrame;
224  else
225  tangentPlaneFrame += CTPFrame;
226  }
227 
228  // convert tangent plane coordinates to RaDec:
229  GtransfoLin identity;
230  TanPix2RaDec CTP2RaDec(identity, _commonTangentPoint);
231  Frame raDecFrame = applyTransfo(tangentPlaneFrame, CTP2RaDec, LargeFrame);
232 
233  lsst::afw::geom::Point<double> min(raDecFrame.xMin, raDecFrame.yMin);
234  lsst::afw::geom::Point<double> max(raDecFrame.xMax, raDecFrame.yMax);
235  lsst::afw::geom::Box2D box(min, max);
236 
237  return box;
238 }
239 
240 void Associations::associateRefStars(double matchCutInArcSec, const Gtransfo *gtransfo) {
241  // associate with FittedStars
242  // 3600 because coordinates are in degrees (in CTP).
243  auto starMatchList = listMatchCollect(Ref2Base(refStarList), Fitted2Base(fittedStarList), gtransfo,
244  matchCutInArcSec / 3600.);
245 
246  LOGLS_DEBUG(_log, "Refcat matches before removing ambiguities " << starMatchList->size());
247  starMatchList->removeAmbiguities(*gtransfo);
248  LOGLS_DEBUG(_log, "Refcat matches after removing ambiguities " << starMatchList->size());
249 
250  // actually associate things
251  for (auto const &starMatch : *starMatchList) {
252  const BaseStar &bs = *starMatch.s1;
253  const RefStar &rs_const = dynamic_cast<const RefStar &>(bs);
254  RefStar &rs = const_cast<RefStar &>(rs_const);
255  const BaseStar &bs2 = *starMatch.s2;
256  const FittedStar &fs_const = dynamic_cast<const FittedStar &>(bs2);
257  FittedStar &fs = const_cast<FittedStar &>(fs_const);
258  // rs->setFittedStar(*fs);
259  fs.setRefStar(&rs);
260  }
261 
262  LOGLS_INFO(_log,
263  "Associated " << starMatchList->size() << " reference stars among " << refStarList.size());
264 }
265 
266 void Associations::selectFittedStars(int minMeasurements) {
267  LOGLS_INFO(_log, "Fitted stars before measurement # cut: " << fittedStarList.size());
268  /* first pass : remove objects that have less than a
269  certain number of measurements.
270  */
271  for (auto const &ccdImage : ccdImageList) {
272  MeasuredStarList &catalog = ccdImage->getCatalogForFit();
273  for (MeasuredStarIterator mi = catalog.begin(); mi != catalog.end();) {
274  MeasuredStar &mstar = **mi;
275 
276  auto fstar = mstar.getFittedStar();
277  if (!fstar) {
278  ++mi;
279  continue;
280  }
281 
282  /* keep FittedStar's which either have a minimum number of
283  measurements, or are matched to a RefStar
284  */
285  if (!fstar->getRefStar() && fstar->getMeasurementCount() < minMeasurements) {
286  auto f = std::const_pointer_cast<FittedStar>(fstar);
287  f->getMeasurementCount()--;
288  mi = catalog.erase(mi);
289  } else
290  ++mi;
291  } // end loop on objects in catalog
292  } // end loop on catalogs
293 
294  /* now FittedStars with less than minMeasurements should have
295  zero measurementCount; */
296 
297  for (FittedStarIterator fi = fittedStarList.begin(); fi != fittedStarList.end();) {
298  if ((*fi)->getMeasurementCount() == 0)
299  fi = fittedStarList.erase(fi);
300  else
301  ++fi;
302  }
303 
304  LOGLS_INFO(_log, "Fitted stars after measurement # cut: " << fittedStarList.size());
305 }
306 
307 void Associations::assignMags() {
308  for (auto const &ccdImage : ccdImageList) {
309  MeasuredStarList &catalog = ccdImage->getCatalogForFit();
310  for (auto const &mstar : catalog) {
311  auto fstar = mstar->getFittedStar();
312  if (!fstar) continue;
313  auto f = std::const_pointer_cast<FittedStar>(fstar);
314  f->addMagMeasurement(mstar->getMag(), mstar->getMagWeight());
315  }
316  }
317 }
318 
320  /* by default, Associations::fittedStarList is expressed on the
321  Associations::commonTangentPlane. For AstrometryFit, we need it on
322  the sky */
323  if (!fittedStarList.inTangentPlaneCoordinates) {
324  LOGLS_WARN(_log,
325  "DeprojectFittedStars: Fitted stars are already in sidereal coordinates, nothing done ");
326  return;
327  }
328 
329  TanPix2RaDec ctp2Sky(GtransfoLin(), getCommonTangentPoint());
330  fittedStarList.applyTransfo(ctp2Sky);
331  fittedStarList.inTangentPlaneCoordinates = false;
332 }
333 
334 #ifdef TODO
335 void Associations::collectMCStars(int realization) {
336  CcdImageIterator I;
337  StarMatchIterator smI;
338 
339  for (I = ccdImageList.begin(); I != ccdImageList.end(); I++) {
340  CcdImage &ccdImage = **I;
341  string dbimdir = ccdImage.Dir();
342  string mctruth = dbimdir + "/mc/mctruth.list";
343 
344  if (realization >= 0) {
345  stringstream sstrm;
346  sstrm << dbimdir << "/mc/mctruth_" << realization << ".list";
347  mctruth = sstrm.str();
348  }
349 
350  GtransfoIdentity gti;
351  MeasuredStarList &catalog = ccdImage.getCatalogForFit();
352 
353  // BaseStarWithErrorList mctruthlist(mctruth);
354  DicStarList mctruthlist(mctruth);
355  auto starMatchList =
356  listMatchCollect(Measured2Base(catalog), Dic2Base(mctruthlist), &gti, 1. /* pixel ? */);
357  if (starMatchList)
358  for (smI = starMatchList->begin(); smI != starMatchList->end(); smI++) {
359  StarMatch &sm = *smI;
360  BaseStar *bs = sm.s1;
361  MeasuredStar *mstar = dynamic_cast<MeasuredStar *>(bs);
362  bs = sm.s2;
363  DicStar *dstar = dynamic_cast<DicStar *>(bs);
364  std::unique_ptr<BaseStarWithError> mcstar(new BaseStarWithError(*bs));
365  mcstar->GetMCInfo().iflux = dstar->getval("iflux");
366  mcstar->GetMCInfo().tflux = dstar->getval("sflux");
367  /*
368  mstar->SetMCTruth(mcstar);
369  mstar->SetMCMeas(mcstar);
370  */
371  }
372  else
373  LOGLS_FATAL(_log, "CollectMCStars Unable to match MCTruth w/ catalog!");
374  }
375 }
376 
377 void Associations::setFittedStarColors(std::string dicStarListName, std::string color,
378  double matchCutArcSec) {
379  // decode color string in case it is x-y
380  size_t pos_minus = color.find('-');
381  bool compute_diff = (pos_minus != string::npos);
382  std::string c1, c2;
383  c1 = color.substr(0, pos_minus); // if pos_minus == npos, means "up to the end"
384  if (compute_diff) c2 = color.substr(pos_minus + 1, string::npos);
385  DicStarList cList(dicStarListName);
386  if (!cList.HasKey(c1))
387  throw(GastroException("Associations::SetFittedstarColors : " + dicStarListName +
388  " misses a key named \"" + c1 + "\""));
389  if (compute_diff && !cList.HasKey(c2))
390  throw(GastroException("Associations::SetFittedstarColors : " + dicStarListName +
391  " misses a key named \"" + c2 + "\""));
392  // we associate in some tangent plane. The reference catalog is expressed on the sky,
393  // but FittedStar's may be still in this tangent plane.
394  BaseStarList &l1 = (BaseStarList &)fittedStarList;
396  TanRaDec2Pix proj(GtransfoLin(), getCommonTangentPoint());
397  // project or not ?
398  Gtransfo *id_or_proj = &proj;
399  if (fittedStarList.inTangentPlaneCoordinates) id_or_proj = &id;
400  // The color List is to be projected:
401  TStarList projected_cList((BaseStarList &)cList, proj);
402  // Associate
403  auto starMatchList = listMatchCollect(Fitted2Base(fittedStarList), (const BaseStarList &)projected_cList,
404  id_or_proj, matchCutArcSec / 3600);
405 
406  LOGLS_INFO(_log, "Matched " << starMatchList->size() << '/' << fittedStarList.size()
407  << " FittedStars to color catalog");
408  // Evaluate and assign colors.
409  for (auto i = starMatchList->begin(); i != starMatchList->end(); ++i) {
410  BaseStar *s1 = i->s1;
411  FittedStar *fs = dynamic_cast<FittedStar *>(s1);
412  BaseStar *s2 = i->s2;
413  const TStar *ts = dynamic_cast<const TStar *>(s2);
414  const DicStar *ds = dynamic_cast<const DicStar *>(ts->get_original());
415  fs->color = ds->getval(c1);
416  if (compute_diff) fs->color -= ds->getval(c2);
417  }
418 }
419 
420 #endif /* STORAGE */
421 } // namespace jointcal
422 } // 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:292
lsst::afw::geom::Angle getLongitude() const
MeasuredStarList::iterator MeasuredStarIterator
Definition: MeasuredStar.h:119
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:443
void addMagMeasurement(double magValue, double magWeight)
this routine will hopefully soon disappear.
Definition: FittedStar.cc:41
int getMeasurementCount() const
Definition: FittedStar.h:82
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:111
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.
void selectFittedStars(int minMeasurements)
Set the color field of FittedStar &#39;s from a colored catalog.
pairs of points
The base class for handling stars. Used by all matching routines.
Definition: BaseStar.h:22
T at(T... args)
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:99
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...
#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:150
#define LSST_EXCEPT(type,...)
std::shared_ptr< const FittedStar > getFittedStar() const
Definition: MeasuredStar.h:83
STL class.
This one is the Tangent Plane (called gnomonic) projection (from celestial sphere to tangent plane) ...
Definition: Gtransfo.h:517
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:39
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
The objects which have been measured several times.
Definition: FittedStar.h:37
BaseStarList & Ref2Base(RefStarList &This)
Definition: RefStar.cc:11
void addImage(lsst::afw::table::SortedCatalogT< lsst::afw::table::SourceRecord > &catalog, std::shared_ptr< lsst::afw::image::TanWcs > wcs, std::shared_ptr< lsst::afw::image::VisitInfo > visitInfo, lsst::afw::geom::Box2I const &bbox, std::string const &filter, std::shared_ptr< 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