Skip to content
Snippets Groups Projects
Commit 7a5c06f8 authored by Alexander van Amesfoort's avatar Alexander van Amesfoort
Browse files

Task #5441: COBALT RSP raw support: OutputProc: harden against div by 0 (=...

Task #5441: COBALT RSP raw support: OutputProc: harden against div by 0 (= shows up as floating point exception), which was observed in a test on the observational system, but not so clear if this really fixes it.
parent c28cd5f7
No related branches found
No related tags found
No related merge requests found
......@@ -1144,7 +1144,7 @@ namespace LOFAR
}
size_t ObservationSettings::nrRspRawBlocks() const {
return static_cast<size_t>(floor((rspRaw.stopTime - rspRaw.startTime) * subbandWidth() / blockSize));
return static_cast<size_t>(floor(((double)rspRaw.stopTime - rspRaw.startTime) * subbandWidth() / blockSize));
}
double ObservationSettings::subbandWidth() const {
......
......@@ -74,7 +74,7 @@ namespace LOFAR
}
// report statistics
const float didNotReceivePerc = 100.0 - 100.0 * itsNrIntegrationsReceived / itsNrIntegrations;
const float didNotReceivePerc = itsNrIntegrations == 0 ? 0.0 : 100.0 - 100.0 * itsNrIntegrationsReceived / itsNrIntegrations;
const float didNotSendPerc = didNotReceivePerc;
if (didNotReceivePerc > 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment