3 #include <fwk/CentralConfig.h>
5 #include <utl/ErrorLogger.h>
6 #include <utl/Reader.h>
7 #include <utl/config.h>
8 #include <utl/TraceAlgorithm.h>
9 #include <utl/FFTDataContainerAlgorithm.h>
11 #include <evt/Event.h>
12 #include <revt/REvent.h>
13 #include <revt/Station.h>
14 #include <revt/Channel.h>
39 info <<
"RdChannelUpsampler set up with UpsamplingFactor of "
40 << fUpsamplingFactor <<
" and RemoveOffset " << fRemoveOffset <<
".";
51 if (fUpsamplingFactor < 2) {
52 WARNING(
"No upsampling will be done as UpsamplingFactor < 2!");
58 WARNING(
"No radio event found!");
62 REvent& rEvent =
event.GetREvent();
66 for (
auto& station : rEvent.StationsRange()) {
67 for (
auto& channel : station.ChannelsRange()) {
69 if (!channel.IsActive())
72 unsigned int upsamplingFactor = 0;
73 if (!fUseTargetFrequency)
74 upsamplingFactor = fUpsamplingFactor;
76 const double frequency = 1. / channel.GetChannelTimeSeries().GetBinning();
77 const double ratio = fTargetFrequency / frequency;
78 constexpr
double eps = 1e-6;
79 const unsigned int intratio = int(ratio + eps);
81 if (ratio <= 0 ||
abs(ratio - intratio) > eps) {
82 ERROR (
"Wrong target frequency!");
85 upsamplingFactor = intratio;
88 FFTDataContainerAlgorithm::UpsampleTimeSeries(channel.GetFFTDataContainer(),
89 upsamplingFactor, fRemoveOffset);
91 info <<
"Upsampling of channel " << channel.GetId()
92 <<
" of station " << channel.GetStationId()
93 <<
" by a factor of " << upsamplingFactor <<
".";
103 RdChannelUpsampler::Finish()
Interface class to access to the Radio part of an event.
void Init()
Initialise the registry.
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
#define INFOIntermediate(y)
Class representing a document branch.
double abs(const SVector< n, T > &v)
#define WARNING(message)
Macro for logging warning messages.
void GetData(bool &b) const
Overloads of the GetData member template function.
ResultFlag
Flag returned by module methods to the RunController.
static CentralConfig * GetInstance()
Use this the first time you get an instance of central configuration.
#define ERROR(message)
Macro for logging error messages.
utl::Branch GetTopBranch(const std::string &id)
Get top branch for moduleConfigLink with given id (XML files)