1 #ifndef SKA_CHEETAH_RFIM_LASTUNFLAGGED_H 2 #define SKA_CHEETAH_RFIM_LASTUNFLAGGED_H 4 #include "cheetah/data/TimeFrequency.h" 5 #include "panda/ModuloNumber.h" 17 template<
typename TimeFrequencyType>
20 template<
typename TimeFrequencyType>
22 static_assert(!std::is_const<TimeFrequencyType>::value,
"LastUnflagged must be able to modify the TimeFrequencyBlock yet has been passed a const");
23 typedef typename TimeFrequencyType::DataType NumericalRep;
24 typedef typename TimeFrequencyType::ConstSpectra Spectra;
25 typedef typename TimeFrequencyType::ConstChannel ConstChannel;
26 typedef typename TimeFrequencyType::Channel Channel;
27 typedef std::shared_ptr<TimeFrequencyType> ReturnType;
35 template<
typename SliceT>
36 typename std::enable_if<pss::astrotypes::is_slice<SliceT>::value,
void>::type
37 mark_good(SliceT
const&);
38 void mark_good(NumericalRep
const&, data::DimensionIndex<data::Frequency> channel_number);
40 template<
typename SliceType>
41 typename std::enable_if<pss::astrotypes::is_slice<SliceType>::value && std::remove_reference<SliceType>::type::rank != 1,
void>::type
42 mark_bad(SliceType
const& slice);
44 template<
typename SliceType>
45 typename std::enable_if<pss::astrotypes::is_slice<SliceType>::value && std::remove_reference<SliceType>::type::rank == 1,
void>::type
46 mark_bad(SliceType
const& slice);
48 void mark_bad(Channel
const& channel);
49 void mark_bad(ConstChannel
const& channel);
52 void mark_bad(data::DimensionIndex<data::Frequency> channel_number);
54 void mark_bad(NumericalRep
const&, data::DimensionIndex<data::Frequency> channel_number);
58 TimeFrequencyType* _data;
59 std::vector<NumericalRep> _replacement_sample;
60 NumericalRep
const* _last_good_spectrum;
63 template<
typename TimeFrequencyType>
66 typedef typename TimeFrequencyType::DataType NumericalRep;
67 typedef std::vector<NumericalRep> SampleType;
68 typedef typename TimeFrequencyType::Spectra Spectrum;
76 Adapter adapter(TimeFrequencyType& data);
79 void set_good_sample(Spectrum
const&);
80 void set_good_sample(NumericalRep
const& sample_start, std::size_t size);
81 SampleType& last_good_spectrum();
84 std::vector<SampleType> _replacement_sample;
85 panda::ModuloNumber<unsigned> _sample_index;
86 panda::ModuloNumber<unsigned> _read_index;
93 #include "detail/LastUnflagged.cpp" 95 #endif // SKA_CHEETAH_RFIM_LASTUNFLAGGED_H
Policy that replaces any bad specturm with the last unflagged spectrum value.
Some limits and constants for FLDO.