From dff2b7e146fa564a74a864e84c2991a00a483a49 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 19 Jun 2020 15:54:59 -0400 Subject: [PATCH] Add code to sort FST280 candidates by strength and return only the top few. Temporary? --- lib/fst280_decode.f90 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/fst280_decode.f90 b/lib/fst280_decode.f90 index 7347c5bc0..a0e0c73dd 100644 --- a/lib/fst280_decode.f90 +++ b/lib/fst280_decode.f90 @@ -410,7 +410,10 @@ contains complex c_bigfft(0:nfft1/2) integer hmod + integer indx(100) real candidates(100,4) + real candidates0(100,4) + real snr_cand(100) real s(18000) real s2(18000) data nfft1z/-1/ @@ -457,6 +460,17 @@ contains endif enddo + snr_cand=0. + snr_cand(1:ncand)=candidates(1:ncand,2) + call indexx(snr_cand,ncand,indx) + nmax=5 + do i=1,min(ncand,nmax) + j=indx(ncand+1-i) + candidates0(i,1:4)=candidates(j,1:4) + enddo + candidates(1:nmax,1:4)=candidates0(1:nmax,1:4) + candidates(nmax+1:,1:4)=0. + return end subroutine get_candidates_fst280