24 #ifndef SKA_CHEETAH_SIGPROC_SIGPROCWRITER_H 25 #define SKA_CHEETAH_SIGPROC_SIGPROCWRITER_H 27 #include "pss/astrotypes/sigproc/Header.h" 28 #include "cheetah/sigproc/WriterConfig.h" 29 #include "cheetah/data/TimeFrequency.h" 30 #include "cheetah/data/Spectrum.h" 31 #include <boost/filesystem.hpp> 44 template<
typename HeaderType=pss::astrotypes::sigproc::Header>
59 template<
typename Arch,
typename NumericalRep>
60 SigProcWriter& operator<<(data::TimeFrequency<Arch, NumericalRep>
const& tf);
62 template<
typename DerivedType,
typename NumericalRep,
typename Alloc>
63 SigProcWriter& operator<<(data::SpectrumBase<DerivedType, NumericalRep, Alloc>
const& spectrum_data);
73 template<
typename Arch,
typename NumericalRep>
80 typename std::enable_if<pss::astrotypes::has_exact_dimensions<T, data::Time, data::Frequency>::value,
SigProcWriter&>::type
81 write(HeaderType
const&, T
const& t);
85 void set_dir(boost::filesystem::path
const& path);
86 std::string next_file(data::TimeFrequency<Cpu, uint8_t>::TimePointType
const&);
88 void file_header(HeaderType
const&);
91 typename std::enable_if<pss::astrotypes::has_exact_dimensions<T, data::Time, data::Frequency>::value,
SigProcWriter&>::type
92 file_write(HeaderType
const&, T
const& t, std::size_t spectrum=0);
95 typename std::enable_if<pss::astrotypes::has_exact_dimensions<T, data::Frequency>::value,
SigProcWriter&>::type
96 file_write(HeaderType
const&, T
const& t);
99 boost::filesystem::path _dir;
101 std::ofstream _file_stream;
102 std::string _extension;
103 std::size_t _sample_count;
104 std::size_t _max_samples_per_file;
110 #include "cheetah/sigproc/detail/SigProcWriter.cpp" 112 #endif // SKA_CHEETAH_SIGPROC_SIGPROCWRITER_H
Configuration options for a SigProcWriter.
Some limits and constants for FLDO.
void flush()
close any existing data files
std::enable_if< pss::astrotypes::has_exact_dimensions< T, data::Time, data::Frequency >::value, SigProcWriter & >::type write(HeaderType const &, T const &t)
write the data out to file using the meta data from the header provided
Writes data types to a sigproc format file.
static void fill_header(HeaderType &header, data::TimeFrequency< Arch, NumericalRep > const &tf)
fill the sigproc header object with meta data taken from the TimeFrequency object ...