Skip to content

Commit

Permalink
Merge pull request #134 from lsst/tickets/DM-18885
Browse files Browse the repository at this point in the history
DM-18885: Log number of MeasuredStars in Associations
  • Loading branch information
parejkoj committed Apr 9, 2019
2 parents 9aa4004 + c98de0f commit 2557255
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Associations.cc
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,15 @@ void Associations::prepareFittedStars(int minMeasurements) {
void Associations::selectFittedStars(int minMeasurements) {
LOGLS_INFO(_log, "Fitted stars before measurement # cut: " << fittedStarList.size());

std::size_t totalMeasured = 0, validMeasured = 0;

// first pass: remove objects that have less than a certain number of measurements.
for (auto const &ccdImage : ccdImageList) {
MeasuredStarList &catalog = ccdImage->getCatalogForFit();
// Iteration happens internal to the loop, as we may delete measuredStars from catalog.
for (MeasuredStarIterator mi = catalog.begin(); mi != catalog.end();) {
MeasuredStar &mstar = **mi;
++totalMeasured;

auto fittedStar = mstar.getFittedStar();
// measuredStar has no fittedStar: move on.
Expand All @@ -302,6 +305,7 @@ void Associations::selectFittedStars(int minMeasurements) {
fittedStar->getMeasurementCount()--;
mi = catalog.erase(mi); // mi now points to the next measuredStar.
} else {
++validMeasured;
++mi;
}
} // end loop on objects in catalog
Expand All @@ -317,6 +321,7 @@ void Associations::selectFittedStars(int minMeasurements) {
}

LOGLS_INFO(_log, "Fitted stars after measurement # cut: " << fittedStarList.size());
LOGLS_INFO(_log, "Total, valid number of Measured stars: " << totalMeasured << ", " << validMeasured);
}

void Associations::normalizeFittedStars() const {
Expand Down

0 comments on commit 2557255

Please sign in to comment.