24 #include "cheetah/pipeline/test/RfiDetectionPipelineTest.h" 25 #include "cheetah/pipeline/RfiDetectionPipeline.h" 26 #include "cheetah/generators/GaussianNoise.h" 27 #include "cheetah/generators/GaussianNoiseConfig.h" 29 #include <condition_variable> 38 RfiDetectionPipelineTest::RfiDetectionPipelineTest()
43 RfiDetectionPipelineTest::~RfiDetectionPipelineTest()
47 void RfiDetectionPipelineTest::SetUp()
51 void RfiDetectionPipelineTest::TearDown()
55 template<
typename NumericalT>
59 typedef typename TimeFrequencyType::TimePointType TimePointType;
66 template<
typename TimeFrequencyT>
67 void operator()(std::shared_ptr<TimeFrequencyT>& data) {
71 template<
typename TimeFrequencyT>
73 ASSERT_LT(_start_time, data.start_time());
74 _start_time = data.start_time();
75 std::lock_guard<std::mutex> lk(_mutex);
78 PANDA_LOG_DEBUG <<
"test handler called: count=" << _count;
81 void wait(std::size_t count) {
82 std::unique_lock<std::mutex> lk(_mutex);
83 _cv.wait(lk, [
this, count]() {
return _count == count; });
87 TimePointType _start_time;
89 std::condition_variable _cv;
97 auto f_low = data::TimeFrequency<Cpu, uint8_t>::FrequencyType(1.2 * boost::units::si::giga * boost::units::si::hertz);
98 auto f_high = data::TimeFrequency<Cpu, uint8_t>::FrequencyType(1.8 * boost::units::si::giga * boost::units::si::hertz);
99 typename data::TimeFrequency<Cpu, NumericalT>::TimeType t_samp(64.0 * boost::units::si::micro * data::seconds);
100 data::DimensionSize<data::Time> number_of_samples(1<<15);
101 data::DimensionSize<data::Frequency> number_of_channels(1024);
102 typename utils::ModifiedJulianClock::time_point epoch(utils::julian_day(50000.0));
103 auto delta = (f_low - f_high)/ (
double)number_of_channels;
108 noise_config.mean(96.0);
109 noise_config.std_deviation(10.0);
115 std::size_t loop_count=4;
116 for (std::size_t ii=0; ii<loop_count; ++ii)
118 auto tf = std::make_shared<data::TimeFrequency<Cpu, uint8_t>>(number_of_samples, number_of_channels);
119 tf->set_channel_frequencies_const_width( f_high, delta );
120 tf->sample_interval(t_samp);
121 tf->start_time(epoch);
122 epoch += std::chrono::duration<double>(tf->sample_interval().value()*number_of_samples);
RfimOutputHandler & output_handler()
access to the output handler object
Some limits and constants for FLDO.
NumericalT DataType
the underlying data storage type for the amplitude of the signal
Parse configuration parameters for a single beam in the pipeline instance of cheetah.
void operator()(TimeFrequencyType &) override
called each time data becomes available
Pipeline that performs only RFI detection.