diff --git a/RTCP/Interface/include/Interface/FakeData.h b/RTCP/Interface/include/Interface/FakeData.h index 0b78cc96cf4f990542dc93a23768cbae62240a2b..66ad40b2d50e28a82013807f5d3ff1ee4e7ab58a 100644 --- a/RTCP/Interface/include/Interface/FakeData.h +++ b/RTCP/Interface/include/Interface/FakeData.h @@ -19,6 +19,8 @@ class FakeData { void check( const FilteredData *data ) const; void check( const FinalBeamFormedData *data, unsigned pol ) const; + void check( const StreamableData *data, OutputType outputType, unsigned streamNr ) const; + private: const Parset &itsParset; static const double TOLERANCE = 1e-6; @@ -38,7 +40,8 @@ template<> bool FakeData::equal( const fcomplex a, const fcomplex b ) const { return equal(real(a), real(b)) && equal(imag(a), imag(b)); } -void FakeData::fill( FilteredData *data ) const { +void FakeData::fill( FilteredData *data ) const +{ for (unsigned s = 0; s < itsParset.nrStations(); s++) { for (unsigned c = 0; c < itsParset.nrChannelsPerSubband(); c++) for (unsigned t = 0; t < itsParset.CNintegrationSteps(); t++) { @@ -50,7 +53,8 @@ void FakeData::fill( FilteredData *data ) const { } } -void FakeData::check( const FilteredData *data ) const { +void FakeData::check( const FilteredData *data ) const +{ for (unsigned s = 0; s < itsParset.nrStations(); s++) { for (unsigned c = 0; c < itsParset.nrChannelsPerSubband(); c++) for (unsigned t = 0; t < itsParset.CNintegrationSteps(); t++) { @@ -62,7 +66,8 @@ void FakeData::check( const FilteredData *data ) const { } } -void FakeData::check( const FinalBeamFormedData *data, unsigned pol ) const { +void FakeData::check( const FinalBeamFormedData *data, unsigned pol ) const +{ // TODO: support other configurations than just 1 station equal to reference phase center for (unsigned t = 0; t < itsParset.CNintegrationSteps(); t++) { @@ -76,6 +81,22 @@ void FakeData::check( const FinalBeamFormedData *data, unsigned pol ) const { } } +void FakeData::check( const StreamableData *data, OutputType outputType, unsigned streamNr ) const +{ + switch (outputType) { + case FILTERED_DATA: + check( static_cast<const FilteredData *>(data) ); + break; + + case BEAM_FORMED_DATA: + check( static_cast<const FinalBeamFormedData *>(data), streamNr % NR_POLARIZATIONS ); + break; + + default: + return; + } +} + } // namespace RTCP } // namespace LOFAR diff --git a/RTCP/Interface/include/Interface/Parset.h b/RTCP/Interface/include/Interface/Parset.h index 62c147eadbe9d5a76432cda729431e1c10e35423..597d6ca8448033e21e2533ea44142de90e38b8a6 100644 --- a/RTCP/Interface/include/Interface/Parset.h +++ b/RTCP/Interface/include/Interface/Parset.h @@ -145,6 +145,7 @@ class Parset: public ParameterSet std::string getDirectoryName(OutputType, unsigned streamNr) const; bool fakeInputData() const; + bool checkFakeInputData() const; unsigned nrCoherentStokes() const; unsigned nrIncoherentStokes() const; @@ -395,6 +396,11 @@ inline bool Parset::fakeInputData() const return getBool("OLAP.CNProc.fakeInputData", false); } +inline bool Parset::checkFakeInputData() const +{ + return getBool("OLAP.CNProc.checkFakeInputData", false); +} + inline double Parset::CNintegrationTime() const { return nrSubbandSamples() / sampleRate(); diff --git a/RTCP/Run/src/RTCP.parset b/RTCP/Run/src/RTCP.parset index 25a3f337d16966eeba7ea105cf44145d04798e7e..0906b183d63541307fefb2bb2bb534a768f28904 100644 --- a/RTCP/Run/src/RTCP.parset +++ b/RTCP/Run/src/RTCP.parset @@ -110,6 +110,7 @@ OLAP.OLAP_Conn.IONProc_CNProc_Transport = FCNP # generate fake station input, overriding any real data OLAP.CNProc.fakeInputData = F +OLAP.CNProc.checkFakeInputData = F OLAP.CNProc.nrPPFTaps = 16 diff --git a/RTCP/Storage/include/Storage/OutputThread.h b/RTCP/Storage/include/Storage/OutputThread.h index b2dbde04cf89d3b7749cdd3367f9cfea27bff299..8f8f68325419cd1f422158b321d9fc5c3f75f058 100644 --- a/RTCP/Storage/include/Storage/OutputThread.h +++ b/RTCP/Storage/include/Storage/OutputThread.h @@ -61,6 +61,7 @@ class OutputThread const unsigned itsStreamNr; const bool itsIsBigEndian; const std::string itsLogPrefix; + const bool itsCheckFakeData; Queue<SmartPtr<StreamableData> > &itsFreeQueue, &itsReceiveQueue; diff --git a/RTCP/Storage/src/OutputThread.cc b/RTCP/Storage/src/OutputThread.cc index e1e0251b392b02ea28974abce30d33884d373bfe..6d71b09d0f8723bf9e35f28fffc26c56cd1960dc 100644 --- a/RTCP/Storage/src/OutputThread.cc +++ b/RTCP/Storage/src/OutputThread.cc @@ -99,6 +99,7 @@ OutputThread::OutputThread(const Parset &parset, OutputType outputType, unsigned itsStreamNr(streamNr), itsIsBigEndian(isBigEndian), itsLogPrefix(logPrefix + "[OutputThread] "), + itsCheckFakeData(parset.checkFakeInputData()), itsFreeQueue(freeQueue), itsReceiveQueue(receiveQueue), itsBlocksWritten(0),