14 #include <evt/Event.h>
16 #include <fwk/CentralConfig.h>
18 #include <utl/ErrorLogger.h>
19 #include <utl/Reader.h>
20 #include <utl/config.h>
21 #include <utl/Trace.h>
22 #include <utl/TraceAlgorithm.h>
24 #include <revt/REvent.h>
25 #include <revt/Header.h>
26 #include <revt/Station.h>
27 #include <revt/Channel.h>
40 RdChannelSpectrumAverager::~RdChannelSpectrumAverager()
53 INFO(
"RdChannelSpectrumAverager::Init()");
68 WARNING(
"No radio event found!");
72 REvent& rEvent =
event.GetREvent();
82 stringstream fMessage(
"");
83 fMessage <<
"Replacing amplitude spectrum by mean ampltitude spectrum for channel "
91 pair<int,int> key(station.
GetId(), channel.
GetId());
103 if (fCounter.find(key) == fCounter.end()) {
105 fMeanAmplitude[key] = amplitude;
108 if (fMeanAmplitude[key].GetSize() != amplitude.
GetSize()) {
109 ERROR(
"Size of current spectrum and mean spectrum do not match!");
110 return eContinueLoop;
115 fMeanAmplitude[key] = (amplitude + double(fCounter[key]-1)*fMeanAmplitude[key]) /
double(fCounter[key]);
120 if (amplitude[i] > 0)
121 spectrum[i] *= fMeanAmplitude[key][i]/amplitude[i];
124 spectrum[i] = fMeanAmplitude[key][i];
133 RdChannelSpectrumAverager::Finish()
138 INFO(
"RdChannelSpectrumAverager::Finish()");
int GetId() const
Return Id of the Channel.
Interface class to access to the Radio part of an event.
#define INFO(message)
Macro for logging informational messages.
StationIterator StationsEnd()
StationIterator StationsBegin()
void Init()
Initialise the registry.
ChannelIterator ChannelsBegin()
begin Channel iterator for read/write
boost::filter_iterator< StationFilter, AllStationIterator > StationIterator
Iterator over all (non-exculded) stations.
int GetStationId() const
Return Id of the station to which this Channel belongs.
ChannelIterator ChannelsEnd()
end Channel iterator for read/write
class to hold data at the radio Station level.
std::vector< std::complex< double > >::size_type SizeType
double abs(const SVector< n, T > &v)
#define WARNING(message)
Macro for logging warning messages.
int GetId() const
Get the station Id.
ResultFlag
Flag returned by module methods to the RunController.
ChannelFrequencySpectrum & GetChannelFrequencySpectrum()
retrieve Channel Frequency Spectrum (write access, only use this if you intend to change the data) ...
Class that holds the data associated to an individual radio channel.
void PushBack(const T &value)
Insert a single value at the end.
#define ERROR(message)
Macro for logging error messages.