Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LEFEBVREJP email
radix
Commits
3defde8f
Commit
3defde8f
authored
Oct 10, 2018
by
Purves, Murray
Browse files
Amending SPE format to use float instead of int values for counts
parent
265fca61
Pipeline
#16206
passed with stages
in 9 minutes and 15 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
radixio/spectrumspestream.i.hh
View file @
3defde8f
...
...
@@ -202,7 +202,7 @@ bool SpectrumSPEStream<data_type>::write_to(const std::string &file) const
fprintf
(
stream
,
"0 %d
\n
"
,
numberOfChannels
-
1
);
for
(
int
i
=
0
;
i
<
countsByChannel
.
size
();
++
i
)
{
fprintf
(
stream
,
"%
d
\n
"
,
int
(
countsByChannel
[
i
])
)
;
fprintf
(
stream
,
"%
10.6f
\n
"
,
countsByChannel
[
i
]);
}
radix_line
(
" Wrote "
<<
countsByChannel
.
size
()
<<
" data entries"
);
...
...
@@ -321,7 +321,7 @@ void SpectrumSPEStream<data_type>::readData(std::ifstream &stream,
std
::
getline
(
stream
,
line
);
try
{
countsByChannel
.
push_back
(
std
::
sto
i
(
trim_string
(
line
)));
countsByChannel
.
push_back
(
std
::
sto
f
(
trim_string
(
line
)));
}
catch
(...)
{
...
...
radixio/tests/tstSpectrum.cc
View file @
3defde8f
...
...
@@ -292,7 +292,8 @@ TEST(RadixIO, PCFToSPE)
ASSERT_EQ
(
countsByChannel1
.
size
(),
countsByChannel2
.
size
());
for
(
size_t
j
=
0
;
j
<
countsByChannel1
.
size
();
++
j
)
{
EXPECT_NEAR
(
int
(
countsByChannel1
[
j
]),
int
(
countsByChannel2
[
j
]),
1
);
EXPECT_NEAR
(
countsByChannel1
[
j
],
countsByChannel2
[
j
],
fabs
(
countsByChannel1
[
j
]
*
tolerance
));
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment