24 #include "cheetah/sps_clustering/SpsClustering.h" 29 namespace sps_clustering {
31 template<
typename NumRepType>
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]);
void push_back(SpCandidateType const &cand)
Push back method for inserting Single pulse Candidates but without calculating tend They will be ins...
std::shared_ptr< data::SpCcl< NumRepType > > operator()(std::shared_ptr< data::SpCcl< NumRepType >> const &cands)
remove duplicate candidates
Some limits and constants for FLDO.