Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
8704b73
Modify KTFrequencySpectrumFFTW to use Eigen
MCFlowMace Apr 15, 2021
59e1487
Modify KTPhysicalArryComplex
MCFlowMace Apr 16, 2021
ec9a277
Modify KTMultiFSDataFFTW to use Eigen
MCFlowMace Apr 16, 2021
b5efc90
Modify KT2ROOT.cc
MCFlowMace Apr 16, 2021
f5d3ce7
Add functionality to KTPhysicalArrayComplex
MCFlowMace Apr 16, 2021
19a216b
Add new function to KTFrequencySpectrumFFTW
MCFlowMace Apr 19, 2021
5940f66
Add comment to KTFrequencySpectrumFFTW.hh
MCFlowMace Apr 19, 2021
31a10d1
Modify FFT processors
MCFlowMace Apr 20, 2021
35181ff
Modify files depending on KTFrequencySpectrumFFTW
MCFlowMace Apr 20, 2021
568cfb5
Fix in KTFrequencySpectrumFFTW
MCFlowMace Apr 20, 2021
2bd273b
Modify KTFrequenySpectrumFFTW
MCFlowMace Apr 20, 2021
7c4e3f7
Replace fft_complex in KTTimeSeriesFFTW
MCFlowMace Apr 20, 2021
53799f9
Modify KTTimeSeriesFFTW
MCFlowMace Apr 20, 2021
bf1f31c
Fix error in KTTimeSeriesFFTW and KTFrequencySpectrumFFTW
MCFlowMace Apr 20, 2021
187cb5e
Fix some remaining fftw_complex artifacts in KTTimeSeriesFFTW
MCFlowMace Apr 20, 2021
2436623
Add GetNorm to the virtual KTFrequencySpectrum
MCFlowMace Apr 21, 2021
f5277b7
Add GetNorm to the KTFrequencySpectrumPolar
MCFlowMace Apr 21, 2021
63799be
Add functions to KTTimeSeriesFFTW
MCFlowMace Apr 21, 2021
f41e79c
Modify FFT processors
MCFlowMace Apr 21, 2021
0642fe7
Modify files depending on KTTimeSeriesFFTW
MCFlowMace Apr 21, 2021
486e965
Fix bug in TestReverseFFTW
MCFlowMace Apr 21, 2021
ad47fef
Fix some some wrong usage of absolute values in place of norm
MCFlowMace Apr 22, 2021
3da235e
Fix missing sign in KTConvolution.cc
MCFlowMace Apr 27, 2021
bcc4863
Remove comments with old code
MCFlowMace Apr 27, 2021
ff3a8d5
Add new files
MCFlowMace Apr 28, 2021
fd65779
Add move operations to KTPhysicalArray
MCFlowMace May 1, 2021
b45c46d
Add new processor KTMatrixAggregator
MCFlowMace May 1, 2021
47dbf9d
Fix small issues in KTPhysicalArrayComplex
MCFlowMace May 1, 2021
c7ce37c
Add Test for MatrixAggregator
MCFlowMace May 4, 2021
2ac4eb0
Fix issues in TestMatrixAggregator
MCFlowMace May 4, 2021
4b898e0
Add better Debug capabilities to KTMatrixAggregator
MCFlowMace May 4, 2021
ccbd819
Remove unnecessary destructors
MCFlowMace May 5, 2021
daf8f93
Add processor to convert timeseries to normalized MF templates
MCFlowMace May 5, 2021
0465a5d
Add test for KTConvertToTemplate
MCFlowMace May 5, 2021
4f79736
Add TestMatchedFilter.cc to build
MCFlowMace May 5, 2021
1ab57e0
Add small fixes and debug output to KTConvertToTemplate
MCFlowMace May 5, 2021
caf06bb
Small fix for KTConvertToTemplate
MCFlowMace May 5, 2021
f88c8c1
Fix issue in KTConvertToTemplate
MCFlowMace May 6, 2021
3e08259
Add KTInnerProductOptimizer
MCFlowMace May 6, 2021
8885117
Add proper inner product processor
MCFlowMace May 11, 2021
503b8a4
Add complex conjugate to template conversion
MCFlowMace May 11, 2021
569fd8f
Add config file for Matched Filter
MCFlowMace May 12, 2021
a0369ea
Add better debug and progress messages
MCFlowMace May 12, 2021
9301f9e
Fix for KTEgg3Reader
MCFlowMace May 12, 2021
8285a9e
Add OpenMP to build
MCFlowMace May 12, 2021
9570e68
Add compiler optimizations for SIMD instructions
MCFlowMace May 12, 2021
13c6bb8
Fix for KTPhysicalArrayComplex
MCFlowMace May 12, 2021
62b870d
Update MatchedFilter test
MCFlowMace May 12, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
# Minimum cmake verison 3.1 required for the variable CMAKE_CXX_STANDARD
cmake_minimum_required (VERSION 3.1)

#probably shouldn't go here like that but I don't know where it has to go
#feel free to fix it
add_compile_options(-march=native -mfma)


# Define the project
cmake_policy( SET CMP0048 NEW ) # version in project()
Expand Down Expand Up @@ -212,7 +216,8 @@ else (DLIB_FOUND)
endif (DLIB_FOUND)

# OpenMP
#find_package (OpenMP)
find_package (OpenMP)

if (OPENMP_FOUND AND NOT Katydid_SINGLETHREADED)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
Expand Down
97 changes: 97 additions & 0 deletions Examples/ConfigFiles/MatchedFilterConfig.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
processor-toolbox:

processors:

- type: egg-processor
name: egg1
- type: matrix-aggregator
name: matrix1
- type: template-converter
name: to-template

- type: egg-processor
name: egg2
- type: matrix-aggregator
name: matrix2

- type: inner-product
name: prod
- type: inner-product-optimizer
name: optimize

connections:

# First egg processing
- signal: "egg1:ts"
slot: "matrix1:ts-fftw"

- signal: "matrix1:matrix"
slot: "to-template:ts-matrix"

- signal: "to-template:template-matrix"
slot: "prod:template-matrix"

# Second egg processing
- signal: "egg2:ts"
slot: "matrix2:ts-fftw"

- signal: "matrix2:matrix"
slot: "prod:data-matrix"

- signal: "prod:snr-matrix"
slot: "optimize:snr-matrix"


run-queue:
- egg1
- egg2


egg1:
filenames: ["locust_mc_Seed395_LO25.8781G_Radius0.100_Pos0.009.egg",
"locust_mc_Seed385_LO25.8781G_Radius0.100_Pos0.009.egg",
"locust_mc_Seed390_LO25.8781G_Radius0.100_Pos0.009.egg",
"locust_mc_Seed395_LO25.8781G_Radius0.100_Pos0.009.egg",
"locust_mc_Seed390_LO25.8781G_Radius0.100_Pos0.009.egg",
"locust_mc_Seed395_LO25.8781G_Radius0.100_Pos0.009.egg",
"locust_mc_Seed385_LO25.8781G_Radius0.100_Pos0.009.egg",
"locust_mc_Seed385_LO25.8781G_Radius0.100_Pos0.009.egg",
"locust_mc_Seed385_LO25.8781G_Radius0.100_Pos0.009.egg",
"locust_mc_Seed385_LO25.8781G_Radius0.100_Pos0.009.egg",
"locust_mc_Seed385_LO25.8781G_Radius0.100_Pos0.009.egg",
"locust_mc_Seed385_LO25.8781G_Radius0.100_Pos0.009.egg",
"locust_mc_Seed385_LO25.8781G_Radius0.100_Pos0.009.egg",
"locust_mc_Seed385_LO25.8781G_Radius0.100_Pos0.009.egg",
"locust_mc_Seed385_LO25.8781G_Radius0.100_Pos0.009.egg"]
egg-reader: egg3
slice-size: 8192

egg2:
filenames: ["locust_mc_Seed395_LO25.8781G_Radius0.100_Pos0.009.egg",
"locust_mc_Seed385_LO25.8781G_Radius0.100_Pos0.009.egg",
"locust_mc_Seed390_LO25.8781G_Radius0.100_Pos0.009.egg",
"locust_mc_Seed395_LO25.8781G_Radius0.100_Pos0.009.egg",
"locust_mc_Seed390_LO25.8781G_Radius0.100_Pos0.009.egg",
"locust_mc_Seed395_LO25.8781G_Radius0.100_Pos0.009.egg",
"locust_mc_Seed385_LO25.8781G_Radius0.100_Pos0.009.egg",
"locust_mc_Seed385_LO25.8781G_Radius0.100_Pos0.009.egg",
"locust_mc_Seed385_LO25.8781G_Radius0.100_Pos0.009.egg",
"locust_mc_Seed385_LO25.8781G_Radius0.100_Pos0.009.egg",
"locust_mc_Seed385_LO25.8781G_Radius0.100_Pos0.009.egg",
"locust_mc_Seed385_LO25.8781G_Radius0.100_Pos0.009.egg",
"locust_mc_Seed385_LO25.8781G_Radius0.100_Pos0.009.egg",
"locust_mc_Seed385_LO25.8781G_Radius0.100_Pos0.009.egg",
"locust_mc_Seed385_LO25.8781G_Radius0.100_Pos0.009.egg"]
egg-reader: egg3
slice-size: 8192

matrix1:
max-cols: 400

matrix2:
max-cols: 400

to-template:

T: 10
bandwidth: 200.0e6
8 changes: 8 additions & 0 deletions Source/Data/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ set (DATA_HEADERFILES
SpectrumAnalysis/KTTimeSeriesDistData.hh
SpectrumAnalysis/KTWV2DData.hh
SpectrumAnalysis/KTWignerVilleData.hh
SpectrumAnalysis/KTInnerProductData.hh
SpectrumAnalysis/KTInnerProductOptimizerData.hh
EventAnalysis/KTClassifierResultsData.hh
EventAnalysis/KTFrequencyCandidate.hh
EventAnalysis/KTFrequencyCandidateData.hh
Expand Down Expand Up @@ -68,6 +70,8 @@ set (DATA_HEADERFILES
Transform/KTTimeFrequency.hh
Transform/KTTimeFrequencyDataPolar.hh
Transform/KTTimeFrequencyPolar.hh
Transform/KTAggregatedTSMatrixData.hh
Transform/KTAggregatedTemplateMatrixData.hh
)

set (DATA_SOURCEFILES
Expand All @@ -89,6 +93,8 @@ set (DATA_SOURCEFILES
SpectrumAnalysis/KTTimeSeriesDistData.cc
SpectrumAnalysis/KTWV2DData.cc
SpectrumAnalysis/KTWignerVilleData.cc
SpectrumAnalysis/KTInnerProductOptimizerData.cc
SpectrumAnalysis/KTInnerProductData.cc
EventAnalysis/KTClassifierResultsData.cc
EventAnalysis/KTFrequencyCandidate.cc
EventAnalysis/KTFrequencyCandidateData.cc
Expand Down Expand Up @@ -134,6 +140,8 @@ set (DATA_SOURCEFILES
Transform/KTTimeFrequency.cc
Transform/KTTimeFrequencyDataPolar.cc
Transform/KTTimeFrequencyPolar.cc
Transform/KTAggregatedTSMatrixData.cc
Transform/KTAggregatedTemplateMatrixData.cc
)

if (NOT FFTW_FOUND)
Expand Down
15 changes: 15 additions & 0 deletions Source/Data/SpectrumAnalysis/KTInnerProductData.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* KTInnerProductData.cc
*
* Created on: Apr 28, 2021
* Author: F. Thomas
*/

#include "KTInnerProductData.hh"


namespace Katydid
{
const std::string KTInnerProductData::sName("snr-matrix");

} /* namespace Katydid */
28 changes: 28 additions & 0 deletions Source/Data/SpectrumAnalysis/KTInnerProductData.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* KTInnerProductData.hh
*
* Created on: Apr 28, 2021
* Author: F. Thomas
*/

#ifndef KTINNERPRODUCTDATA_HH_
#define KTINNERPRODUCTDATA_HH_

#include "KTData.hh"
#include "KTPhysicalArrayComplex.hh"


namespace Katydid
{

class KTInnerProductData: public KTPhysicalArray<2, std::complex<double>>, public Nymph::KTExtensibleData< KTInnerProductData >
{
public:

static const std::string sName;

};

} /* namespace Katydid */

#endif /* KTINNERPRODUCTDATA_HH_ */
15 changes: 15 additions & 0 deletions Source/Data/SpectrumAnalysis/KTInnerProductOptimizerData.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* KTInnerProductOptimizerData.cc
*
* Created on: May 5, 2021
* Author: F. Thomas
*/

#include "KTInnerProductOptimizerData.hh"


namespace Katydid
{
const std::string KTInnerProductOptimizerData::sName("match-result");

} /* namespace Katydid */
33 changes: 33 additions & 0 deletions Source/Data/SpectrumAnalysis/KTInnerProductOptimizerData.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* KTInnerProductOptimizerData.hh
*
* Created on: May 5, 2021
* Author: F. Thomas
*/

#ifndef KTINNERPRODUCTOPTIMIZERDATA_HH_
#define KTINNERPRODUCTOPTIMIZERDATA_HH_

#include "KTData.hh"
#include "KTPhysicalArrayComplex.hh"

#include <eigen3/Eigen/Dense>


namespace Katydid
{

class KTInnerProductOptimizerData: public Nymph::KTExtensibleData< KTInnerProductOptimizerData >
{
public:

static const std::string sName;

Eigen::ArrayXd fMaxVals;
Eigen::Array< Eigen::MatrixXf::Index, Eigen::Dynamic, 1> fMaxInds;

};

} /* namespace Katydid */

#endif /* KTINNERPRODUCTOPTIMIZERDATA_HH_ */
31 changes: 8 additions & 23 deletions Source/Data/Time/KTTimeSeriesFFTW.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ namespace Katydid

KTTimeSeriesFFTW::KTTimeSeriesFFTW() :
KTTimeSeries(),
KTPhysicalArray< 1, fftw_complex >()
KTPhysicalArray< 1, std::complex<double> >()
{
}

KTTimeSeriesFFTW::KTTimeSeriesFFTW(size_t nBins, double rangeMin, double rangeMax) :
KTTimeSeries(),
KTPhysicalArray< 1, fftw_complex >(nBins, rangeMin, rangeMax)
KTPhysicalArray< 1, std::complex<double> >(nBins, rangeMin, rangeMax)
{
}

Expand All @@ -42,26 +42,11 @@ namespace Katydid
}
for (unsigned iBin = 0; iBin < nBins; ++iBin)
{
std::copy(value.begin(), value.end(), fData[iBin]);
std::copy(value.begin(), value.end(), &fData[iBin]);
}

}

KTTimeSeriesFFTW::KTTimeSeriesFFTW(const KTTimeSeriesFFTW& orig) :
KTTimeSeries(),
KTPhysicalArray< 1, fftw_complex >(orig)
{
}

KTTimeSeriesFFTW::~KTTimeSeriesFFTW()
{
}

KTTimeSeriesFFTW& KTTimeSeriesFFTW::operator=(const KTTimeSeriesFFTW& rhs)
{
KTPhysicalArray< 1, fftw_complex >::operator=(rhs);
return *this;
}


void KTTimeSeriesFFTW::Print(unsigned startPrint, unsigned nToPrint) const
{
stringstream printStream;
Expand All @@ -81,7 +66,7 @@ namespace Katydid
TH1D* hist = new TH1D(name.c_str(), "Time Series", (int)nBins, GetRangeMin(), GetRangeMax());
for (unsigned iBin=0; iBin<nBins; ++iBin)
{
hist->SetBinContent((int)iBin+1, (*this)(iBin)[0]);
hist->SetBinContent((int)iBin+1, (*this)(iBin).real());
}
hist->SetXTitle("Time (s)");
hist->SetYTitle("Voltage (V)");
Expand All @@ -96,7 +81,7 @@ namespace Katydid
double value;
for (unsigned iBin=0; iBin<nBins; ++iBin)
{
value = (*this)(iBin)[0];
value = (*this)(iBin).real();
//value *= value;
if (value < tMinMag) tMinMag = value;
if (value > tMaxMag) tMaxMag = value;
Expand All @@ -107,7 +92,7 @@ namespace Katydid
{
//value = (*this)(iBin)[0];
//hist->Fill(value*value);
hist->Fill((*this)(iBin)[0]);
hist->Fill((*this)(iBin).real());
}
hist->SetXTitle("Voltage (V)");
return hist;
Expand Down
Loading