A class that will merge candidates that have been labeled in the same group.
More...
#include <cheetah/sps_clustering/SpsClustering.h>
A class that will merge candidates that have been labeled in the same group.
Will take SpCcl object as an argument and return the same object
Definition at line 39 of file SpsClustering.h.
◆ operator()()
template<typename NumRepType >
std::shared_ptr< data::SpCcl< NumRepType > > ska::cheetah::sps_clustering::SpsClustering::operator() |
( |
std::shared_ptr< data::SpCcl< NumRepType >> const & |
cands | ) |
|
remove duplicate candidates
cnadidates are considered to be duplicates if they are clustered together within the bounds provided by the configuration
- Returns
- a new shared_ptr<SpCcl> candidate object with representative candidate fro each cluster. The representative is the candidate with the maximum signal to noise ratio
Definition at line 32 of file SpsClustering.cpp.
34 if (! _config.active())
37 std::shared_ptr<data::SpCcl<NumRepType>> merged_cands = std::make_shared<data::SpCcl<NumRepType>>(cands->tf_blocks());
38 std::vector<std::vector<size_t>> groups = _clustered_candidates(*cands);
40 PANDA_LOG_DEBUG <<
"Picking best candidate from " << groups.size() <<
" clusters...";
41 std::vector<data::SpCandidate<Cpu, float>> group_cands;
42 for (
auto const& group : groups )
46 PANDA_LOG_DEBUG <<
"Size of each cluster: " << group.size();
47 std::size_t max_sigma_index = group[0];
48 typename data::SpCcl<NumRepType>::SpCandidateType::NumericalRep max_sigma = (*cands)[max_sigma_index].sigma();
49 for (std::size_t ii=1; ii < group.size(); ++ii)
51 auto const& candidate = (*cands)[group[ii]];
52 if( candidate.sigma() > max_sigma ) {
53 max_sigma = candidate.sigma();
54 max_sigma_index = group[ii];
57 PANDA_LOG_DEBUG <<
"Parameters for max S/N candidate";
58 PANDA_LOG_DEBUG <<
"DM: " << (*cands)[max_sigma_index].dm();
59 PANDA_LOG_DEBUG <<
"Width: " << (*cands)[max_sigma_index].width();
60 PANDA_LOG_DEBUG <<
"S/N: " << (*cands)[max_sigma_index].sigma();
61 if ((*cands)[max_sigma_index].dm() >= (*cands).dm_range().first + (1.0 * pss::astrotypes::units::parsecs_per_cube_cm))
63 merged_cands->push_back((*cands)[max_sigma_index]);
The documentation for this class was generated from the following files: