Skip to content

Commit a1ff6a4

Browse files
committed
Hopefully improve naive detection of high-resolution detectors for peak fitting.
Previously HPGe was differentiated from scintillator based system base purely on number of channels; this failed for some HPGe that had smaller energy ranges or channels had been truncated. Slightly improved this to now also consider energy range for these cases. further obvious improvements are possible for the future. Also a few icon/version related cleanups.
1 parent 6e64ea8 commit a1ff6a4

20 files changed

+1513
-93
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,7 @@ set(sources
489489
src/CanvasForDragging.cpp
490490
src/SpecMeas.cpp
491491
src/PeakFit.cpp
492+
src/PeakFitUtils.cpp
492493
src/PeakDef.cpp
493494
src/SpectraFileModel.cpp
494495
src/AuxWindow.cpp
@@ -572,6 +573,7 @@ set(headers
572573
InterSpec/CanvasForDragging.h
573574
InterSpec/SpecMeas.h
574575
InterSpec/PeakFit.h
576+
InterSpec/PeakFitUtils.h
575577
InterSpec/PeakDef.h
576578
InterSpec/SpectraFileModel.h
577579
InterSpec/AuxWindow.h

InterSpec/InterSpec_config.h.in

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,5 @@ void log_developer_error( const char *location, const char *error );
135135

136136
#define DATE_TIME_FORMAT_STR "dd/MM/yy hh:mm:ss"
137137

138-
/** Define a number of channels where if the spectrum has more than this, we'll assume this is high-resolution.
139-
140-
TODO: should instead define an average keV per channel for this purpose. Some limited energy
141-
range HPGe detectors may only have 4096 channels.
142-
*/
143-
#define HIGH_RES_NUM_CHANNELS 5000
144-
145138

146139
#endif // InterSpec_config_h

InterSpec/PeakFitUtils.h

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#ifndef PeakFitUtils_h
2+
#define PeakFitUtils_h
3+
/* InterSpec: an application to analyze spectral gamma radiation data.
4+
5+
Copyright 2018 National Technology & Engineering Solutions of Sandia, LLC
6+
(NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
7+
Government retains certain rights in this software.
8+
For questions contact William Johnson via email at wcjohns@sandia.gov, or
9+
alternative emails of interspec@sandia.gov.
10+
11+
This library is free software; you can redistribute it and/or
12+
modify it under the terms of the GNU Lesser General Public
13+
License as published by the Free Software Foundation; either
14+
version 2.1 of the License, or (at your option) any later version.
15+
16+
This library is distributed in the hope that it will be useful,
17+
but WITHOUT ANY WARRANTY; without even the implied warranty of
18+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19+
Lesser General Public License for more details.
20+
21+
You should have received a copy of the GNU Lesser General Public
22+
License along with this library; if not, write to the Free Software
23+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24+
*/
25+
26+
#include "InterSpec_config.h"
27+
28+
#include <memory>
29+
30+
// Forward declarations
31+
namespace SpecUtils
32+
{
33+
class Measurement;
34+
}
35+
36+
37+
namespace PeakFitUtils
38+
{
39+
40+
/** Tries to guess if the passed in spectrum is from a high-resolution system (i.e., HPGe), or a lower resolution system.
41+
42+
Primarily intended to determine defaults for peak-fitting.
43+
44+
Currently looks at number of channels and/or average channel width, but may look at actual spectrum features for ambiguous cases
45+
in the future.
46+
47+
48+
*/
49+
bool is_high_res( const std::shared_ptr<const SpecUtils::Measurement> &meas );
50+
51+
}//namespace PeakFitUtils
52+
53+
#endif //PeakFitUtils_h

InterSpec_resources/ShieldingSourceDisplay.css

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -128,21 +128,6 @@
128128
border:2px solid #e1e1e1;
129129
}
130130

131-
.ShieldAddIcon,.ShieldAddIcon:hover
132-
{
133-
background-image: url('../InterSpec_resources/images/shield_add.png');
134-
background-position: 3px center;
135-
background-repeat: no-repeat;
136-
padding-left: 21px; /* width of the image plus a little extra padding */
137-
}
138-
139-
.ShapeSquareAddIcon,.ShapeSquareAddIcon:hover
140-
{
141-
background-image: url('../InterSpec_resources/images/shape_square_add.png');
142-
background-position: 3px center;
143-
background-repeat: no-repeat;
144-
padding-left: 21px; /* width of the image plus a little extra padding */
145-
}
146131

147132
.GearIcon,.GearIcon:hover
148133
{
-758 Bytes
Binary file not shown.

InterSpec_resources/static_text/copyright_and_about.xml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,9 @@ This InterSpec Software was developed with funds from the Science and Technology
168168
</div>
169169
</li>
170170

171-
<li><b><a href="http://www.famfamfam.com/lab/icons/silk/" target="_blank">FamFamFam Silk</a> 1.3:</b> free icon set.
172-
<div style="margin-left: 1em; font-size: small;">
173-
<b>Silk</b> provides many of the colorful icons used through <b>InterSpec</b>.
174-
<b>Silk</b> is licensed under the <a href="https://creativecommons.org/licenses/by/2.5/" target="_blank">Creative Commons 2.5 License</a>.
175-
</div>
176-
</li>
177-
178171
<li><b><a href="https://d3js.org/" target="_blank">d3.js</a>:</b> a JavaScript charting library.
179172
<div style="margin-left: 1em; font-size: small;">
180-
<b>d3.js</b> is potentially included when exporting spectrum files as HTML files.
173+
<b>d3.js</b> powers rendering and interactions of the spectrum chart, gross-count time chart, and decay tool.
181174
<b>d3.js</b> is licensed under the <a href="https://opensource.org/licenses/BSD-3-Clause" target="_blank">BSD License</a>.
182175
</div>
183176
</li>

0 commit comments

Comments
 (0)