24 #include "cheetah/pipeline/test/DataExportTest.h" 25 #include "cheetah/pipeline/DataExport.h" 26 #include "cheetah/exporters/SpCclFileStreamerConfig.h" 27 #include "cheetah/exporters/SpCclSigProc.h" 28 #include <panda/test/TestDir.h> 37 DataExportTest::DataExportTest()
42 DataExportTest::~DataExportTest()
46 void DataExportTest::SetUp()
50 void DataExportTest::TearDown()
59 template<
typename... Args>
61 : Sink(std::forward<Args>(args)...)
66 template<
typename Ret,
typename... Args>
67 Ret operator()(Args&&... args) {
69 return Sink::operator()(std::forward<Args>(args)...);
72 unsigned call_count()
const {
73 return _test_call_count;
77 unsigned _test_call_count = 0;
83 panda::test::TestDir dir;
87 sink_config.
dir(dir.path());
88 std::string
const sink_id = sink_config.id();
89 config.add_sink(sink_config);
92 panda::ChannelId channel_id(
"active_channel_spccl");
93 panda::ChannelInfo channel_info(channel_id);
94 channel_info.activate(
true);
95 channel_info.sink(sink_id);
98 panda::ChannelId inactive_channel_id(
"inactive_channel_spccl");
99 panda::ChannelInfo inactive_channel_info(inactive_channel_id);
100 inactive_channel_info.activate(
false);
101 inactive_channel_info.sink(sink_id);
102 config.
channel(inactive_channel_info);
109 exporter.send(channel_id, data);
112 exporter.send(inactive_channel_id, data);
117 panda::test::TestDir dir;
121 sink_config.dir(dir.path().string());
122 std::string
const sink_id = sink_config.id();
123 config.add_sink(sink_config);
126 panda::ChannelId channel_id(
"active_channel_spccl_sigproc");
127 panda::ChannelInfo channel_info(channel_id);
128 channel_info.activate(
true);
129 channel_info.sink(sink_id);
136 data::TimeFrequency<Cpu, uint8_t>::TimeType interval(1.0 * boost::units::si::milli * boost::units::si::seconds);
137 data::SpCcl<uint8_t>::BlocksType blocks;
138 std::shared_ptr<TimeFrequencyType> block = std::make_shared<TimeFrequencyType>(data::DimensionSize<data::Time>(100000)
139 ,data::DimensionSize<data::Frequency>(10));
140 (*block).sample_interval(interval);
143 blocks.
push_back(std::make_shared<TimeFrequencyType>(data::DimensionSize<data::Time>(100),data::DimensionSize<data::Frequency>(10)));
145 typename data::SpCcl<uint8_t>::SpCandidateType::Dm dm(12.0 * data::parsecs_per_cube_cm);
147 data::SpCcl<uint8_t>::SpCandidateType::MsecTimeType width(0.001 * boost::units::si::seconds);
149 data::SpCcl<uint8_t>::SpCandidateType::MsecTimeType tstart(2.0 * boost::units::si::seconds);
153 for (
auto idx=0; idx<10; ++idx)
156 candidate.
duration_end(2000 * boost::units::si::milli * boost::units::si::seconds);
158 tstart += data::SpCcl<uint8_t>::SpCandidateType::MsecTimeType(4.5 * boost::units::si::seconds);
165 panda::ChannelId inactive_channel_id(
"inactive_channel_spccl_sigproc");
166 panda::ChannelInfo inactive_channel_info(inactive_channel_id);
167 inactive_channel_info.activate(
false);
168 inactive_channel_info.sink(sink_id);
169 config.
channel(inactive_channel_info);
177 panda::test::TestDir dir;
181 sink_config.dir(dir.path().string());
182 std::string
const sink_id = sink_config.id();
183 config.add_sink(sink_config);
186 panda::ChannelId channel_id(
"active_channel_spccl_sigproc");
187 panda::ChannelInfo channel_info(channel_id);
188 channel_info.activate(
true);
189 channel_info.sink(sink_id);
196 exporter.send(channel_id, data);
199 panda::ChannelId inactive_channel_id(
"inactive_channel_spccl_sigproc");
200 panda::ChannelInfo inactive_channel_info(inactive_channel_id);
201 inactive_channel_info.activate(
false);
202 inactive_channel_info.sink(sink_id);
203 config.
channel(inactive_channel_info);
206 exporter.send(inactive_channel_id, data);
A simple record to hold 'candidate' proprerties.
void push_back(SpCandidateType const &cand)
Push back method for inserting Single pulse Candidates but without calculating tend They will be ins...
Configuration Object for DataExport module.
void channel(panda::ChannelInfo const &)
explicity add a channel configuration
boost::filesystem::path const & dir() const
get the directory specified to store files
A configuration class for the dynamic spectrum of single pulse candidates.
Some limits and constants for FLDO.
User Configuration of the SpCclStreamer.
void duration_end(MsecTimeType c_tend)
Set the end time The end time is calculated based on the DM of the candidate and the start and end f...