Skip to content

Commit efa43cd

Browse files
committed
Switch to always using zero compression in N42-2012 files, for consistencies sake.
1 parent 8a78e36 commit efa43cd

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/SpecFile_n42.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,10 +1135,13 @@ void add_spectra_to_measurement_node_in_2012_N42_xml( ::rapidxml::xml_node<char>
11351135

11361136
const string detnam = !m->detector_name().empty() ? m->detector_name() : s_unnamed_det_placeholder;
11371137

1138-
//Below choice of zero compressing if the gamma sum is less than 15 times the
1139-
// number of gamma channels is arbitrarily chosen, and has not been
1140-
// benchmarked or checked it is a reasonable value
1141-
const bool zerocompressed = (!!m->gamma_counts() && (m->gamma_count_sum()<15.0*m->gamma_counts()->size()));
1138+
// Zero compression can increase the length of the XML if there are a lot of zero channels
1139+
// right next to non-zero channels. We could use a simple heuristic, like is commented
1140+
// out below, to try to pick the shorter option, but for now we'll just be consistent and
1141+
// always use it.
1142+
//const bool zerocompressed = (!!m->gamma_counts() && (m->gamma_count_sum()<15.0*m->gamma_counts()->size()));
1143+
const bool zerocompressed = true;
1144+
11421145
vector<float> compressedchannels;
11431146

11441147
if( zerocompressed )

0 commit comments

Comments
 (0)