Commit 265fca61 authored by Purves, Murray's avatar Purves, Murray
Browse files

Amending SPE channel count calculation to reflect clearer documentation

parent 2953dc58
Pipeline #16189 passed with stages
in 9 minutes and 12 seconds
......@@ -199,7 +199,7 @@ bool SpectrumSPEStream<data_type>::write_to(const std::string &file) const
radix_line(" number of channels: " << numberOfChannels);
radix_line(" counts by channel array size: " << countsByChannel.size());
fprintf(stream, "$DATA:\n");
fprintf(stream, "0 %d\n", numberOfChannels);
fprintf(stream, "0 %d\n", numberOfChannels - 1);
for (int i = 0; i < countsByChannel.size(); ++i)
{
fprintf(stream, "%d\n", int(countsByChannel[i]));
......@@ -307,8 +307,13 @@ void SpectrumSPEStream<data_type>::readData(std::ifstream &stream,
<< ") - returning");
return;
}
firstChannel = std::stoi(trim_string(parts[0]));
totalEntries = std::stoi(trim_string(parts[1]));
firstChannel = std::stoi(trim_string(parts[0]));
int lastChannel = std::stoi(trim_string(parts[1]));
totalEntries = lastChannel - firstChannel + 1;
radix_line(" Reading channel data:");
radix_line(" first channel: " << firstChannel);
radix_line(" last channel: " << lastChannel);
radix_line(" number of channels: " << totalEntries);
// Read the rest of the entries
radix(" ");
for (int entry = 0; entry < totalEntries; ++entry)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment