Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions SpecUtils/SpecFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,12 @@ enum class DetectorType : int
Falcon5000,
MicroDetective,
MicroRaider,
/** Scan-Electronics RadiaCode-10x detector with CsI(Tl) scintillator */
RadiaCode,
/** Scan-Electronics RadiaCode-10x detector with 10x10x10mm CsI(Tl) scintillator */
RadiaCodeCsI10,
/** Scan-Electronics RadiaCode-110 detector with 14x14x14mm CsI(Tl) scintillator */
RadiaCodeCsI14,
/** Scan-Electronics RadiaCode-103G detector with 10x10x10mm GAGG scintillator */
RadiaCodeGAGG10,

/** Raysid 5cm³ CsI/Tl detector */
Raysid,
Expand Down Expand Up @@ -1771,6 +1775,7 @@ class SpecFile
bool load_phd_file( const std::string &filename );
bool load_lzs_file( const std::string &filename );
bool load_radiacode_file( const std::string &filename );
bool guess_detector_from_radiacode_model( void );
bool load_xml_scan_data_file( const std::string &filename );
bool load_json_file( const std::string &filename );
bool load_caen_gxml_file(const std::string& filename);
Expand Down
4 changes: 2 additions & 2 deletions bindings/c/SpecUtils_c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ static_assert( static_cast<int>(SpecUtils_DetectorType::SpecUtils_Det_MicroDetec
static_assert( static_cast<int>(SpecUtils_DetectorType::SpecUtils_Det_MicroRaider)
== static_cast<int>(SpecUtils::DetectorType::MicroRaider),
"SpecUtils_DetectorType needs updating" );
static_assert( static_cast<int>(SpecUtils_DetectorType::SpecUtils_Det_RadiaCode)
== static_cast<int>(SpecUtils::DetectorType::RadiaCode),
static_assert( static_cast<int>(SpecUtils_DetectorType::SpecUtils_Det_RadiaCodeCsI10)
== static_cast<int>(SpecUtils::DetectorType::RadiaCodeCsI10),
"SpecUtils_DetectorType needs updating" );
static_assert( static_cast<int>(SpecUtils_DetectorType::SpecUtils_Det_Interceptor)
== static_cast<int>(SpecUtils::DetectorType::Interceptor),
Expand Down
3 changes: 2 additions & 1 deletion bindings/c/SpecUtils_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -459,14 +459,15 @@ enum SpecUtils_DetectorType
SpecUtils_Det_DetectiveEx, SpecUtils_Det_DetectiveEx100, SpecUtils_Det_DetectiveEx200,
SpecUtils_Det_DetectiveX, SpecUtils_Det_SAIC8, SpecUtils_Det_Falcon5000,
SpecUtils_Det_MicroDetective, SpecUtils_Det_MicroRaider,
SpecUtils_Det_RadiaCode, SpecUtils_Det_Interceptor, SpecUtils_Det_RadHunterNaI,
SpecUtils_Det_Interceptor, SpecUtils_Det_RadHunterNaI,
SpecUtils_Det_RadHunterLaBr3, SpecUtils_Det_Rsi701, SpecUtils_Det_Rsi705,
SpecUtils_Det_AvidRsi, SpecUtils_Det_OrtecRadEagleNai, SpecUtils_Det_OrtecRadEagleCeBr2Inch,
SpecUtils_Det_OrtecRadEagleCeBr3Inch, SpecUtils_Det_OrtecRadEagleLaBr, SpecUtils_Det_Sam940LaBr3,
SpecUtils_Det_Sam940, SpecUtils_Det_Sam945, SpecUtils_Det_Srpm210,
SpecUtils_Det_RIIDEyeNaI, SpecUtils_Det_RIIDEyeLaBr, SpecUtils_Det_RadSeekerNaI,
SpecUtils_Det_RadSeekerLaBr, SpecUtils_Det_VerifinderNaI, SpecUtils_Det_VerifinderLaBr,
SpecUtils_Det_KromekD3S, SpecUtils_Det_Fulcrum, SpecUtils_Det_Fulcrum40h, SpecUtils_Det_Sam950,
SpecUtils_Det_RadiaCodeCsI10, SpecUtils_Det_RadiaCodeCsI14, SpecUtils_Det_RadiaCodeGAGG10,
SpecUtils_Det_Unknown
};//enum SpecUtils_DetectorType

Expand Down
39 changes: 32 additions & 7 deletions src/SpecFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1400,7 +1400,9 @@ const std::string &detectorTypeToString( const DetectorType type )
static const string sm_UnknownDetectorStr = "Unknown";
static const string sm_MicroDetectiveDetectorStr = "MicroDetective";
static const string sm_MicroRaiderDetectorStr = "MicroRaider";
static const string sm_RadiaCodeDetectorStr = "RadiaCode-102";
static const string sm_RadiaCode10XDetectorStr = "RadiaCode-10X";
static const string sm_RadiaCode110DetectorStr = "RadiaCode-110";
static const string sm_RadiaCode103GDetectorStr = "RadiaCode-103G";
static const string sm_InterceptorStr = "Interceptor";
static const string sm_Sam940DetectorStr = "SAM940";
static const string sm_Sam940Labr3DetectorStr = "SAM940LaBr3";
Expand Down Expand Up @@ -1432,7 +1434,7 @@ const std::string &detectorTypeToString( const DetectorType type )

// GN3, InSpector 1000 LaBr3, Pager-S, SAM-Eagle-LaBr, GR130, SAM-Eagle-NaI-3x3
// InSpector 1000 NaI, RadPack, SpiR-ID LaBr3, Interceptor, Radseeker, SpiR-ID NaI
// GR135Plus, LRM, Raider, HRM, LaBr3PNNL, Transpec, Falcon 5000, Ranger, RadiaCode-102
// GR135Plus, LRM, Raider, HRM, LaBr3PNNL, Transpec, Falcon 5000, Ranger, RadiaCode-10X
// MicroDetective, FieldSpec, IdentiFINDER-NG, SAM-935, NaI 3x3, SAM-Eagle-LaBr3

switch( type )
Expand Down Expand Up @@ -1478,8 +1480,12 @@ const std::string &detectorTypeToString( const DetectorType type )
return sm_MicroDetectiveDetectorStr;
case DetectorType::MicroRaider:
return sm_MicroRaiderDetectorStr;
case DetectorType::RadiaCode:
return sm_RadiaCodeDetectorStr;
case DetectorType::RadiaCodeCsI10:
return sm_RadiaCode10XDetectorStr;
case DetectorType::RadiaCodeCsI14:
return sm_RadiaCode103GDetectorStr;
case DetectorType::RadiaCodeGAGG10:
return sm_RadiaCode10XDetectorStr;
case DetectorType::Interceptor:
return sm_InterceptorStr;
case DetectorType::Sam940:
Expand Down Expand Up @@ -5619,7 +5625,10 @@ void SpecFile::cleanup_after_load( const unsigned int flags )
&& meas->real_time() > 0.00000001
&& !meas->derived_data_properties() //make sure not derived data
&& ((meas->real_time() < 15.0) //20181108: some search systems will take one spectra every like ~10 seconds
|| ((detector_type_ == SpecUtils::DetectorType::RadiaCode) // Radiacode detectors can take like 30 second spectra
// Radiacode detectors can take spectra over many seconds or minutes
|| (((detector_type_ == SpecUtils::DetectorType::RadiaCodeCsI10)
|| (detector_type_ == SpecUtils::DetectorType::RadiaCodeCsI10)
|| (detector_type_ == SpecUtils::DetectorType::RadiaCodeGAGG10))
&& (meas->real_time() < 125.0)) ) )
{
++pt_num_items;
Expand Down Expand Up @@ -6847,12 +6856,28 @@ void SpecFile::set_detector_type_from_other_info()
detector_type_ = DetectorType::Fulcrum;
return;
}//if( icontains(instrument_model_, "Fulcrum") )


if( icontains(instrument_model_, "RadiaCode-103G") )
{
if( manufacturer_.empty() )
manufacturer_ = "Scan-Electronics";
detector_type_ = SpecUtils::DetectorType::RadiaCodeGAGG10;
return;
}

if( icontains(instrument_model_, "RadiaCode-110") )
{
if( manufacturer_.empty() )
manufacturer_ = "Scan-Electronics";
detector_type_ = SpecUtils::DetectorType::RadiaCodeCsI14;
return;
}

if( icontains(instrument_model_, "RadiaCode") )
{
if( manufacturer_.empty() )
manufacturer_ = "Scan-Electronics";
detector_type_ = SpecUtils::DetectorType::RadiaCode;
detector_type_ = SpecUtils::DetectorType::RadiaCodeCsI10;
return;
}

Expand Down
8 changes: 7 additions & 1 deletion src/SpecFile_n42.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -580,11 +580,17 @@ std::string determine_gamma_detector_kind_code( const SpecUtils::SpecFile &sf )
break;

case SpecUtils::DetectorType::KromekD3S:
case SpecUtils::DetectorType::RadiaCode:
case SpecUtils::DetectorType::RadiaCodeCsI10:
case SpecUtils::DetectorType::RadiaCodeCsI14:
case SpecUtils::DetectorType::Raysid:
det_kind = "CsI";
break;

// GAGG (gadolinium aluminum gallium garnet) is not defined in my copy of N42, but neither is CLLBC
case SpecUtils::DetectorType::RadiaCodeGAGG10:
det_kind = "GAGG";
break;

case SpecUtils::DetectorType::KromekD5:
det_kind = "CLLBC";

Expand Down
42 changes: 27 additions & 15 deletions src/SpecFile_radiacode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,28 @@ namespace

namespace SpecUtils {

// there are at least two places where this logic is done, make it a function
bool SpecFile::guess_detector_from_radiacode_model(void){
if( icontains( instrument_model_, "RadiaCode-103G" ) ) {
instrument_type_ = "Spectroscopic Personal Radiation Detector";
manufacturer_ = "Scan-Electronics";
detector_type_ = SpecUtils::DetectorType::RadiaCodeGAGG10;
return true;
} else if( icontains( instrument_model_, "RadiaCode-110" ) ) {
instrument_type_ = "Spectroscopic Personal Radiation Detector";
manufacturer_ = "Scan-Electronics";
detector_type_ = SpecUtils::DetectorType::RadiaCodeCsI14;
return true;
} else if( icontains( instrument_model_, "RadiaCode-" ) ) {
instrument_type_ = "Spectroscopic Personal Radiation Detector";
manufacturer_ = "Scan-Electronics";
detector_type_ = SpecUtils::DetectorType::RadiaCodeCsI10;
return true;
} else {
return false;
}
} // bool SpecFile::guess_detector_from_radiacode_model(void)

bool SpecFile::load_radiacode_file(const std::string& filename) {
#ifdef _WIN32
ifstream input(convert_from_utf8_to_utf16(filename).c_str(),
Expand Down Expand Up @@ -438,17 +460,9 @@ bool SpecFile::load_from_radiacode(std::istream& input) {
}
}//if( background_node )
}//XML_FOREACH_CHILD( n_root, data_list_node, "ResultData" )

if( icontains( instrument_model_, "RadiaCode-" ) )
{
instrument_type_ = "Spectroscopic Personal Radiation Detector";
manufacturer_ = "Scan-Electronics";
detector_type_ = SpecUtils::DetectorType::RadiaCode;
}else
{
// File probably made with BecqMoni
}


guess_detector_from_radiacode_model();

cleanup_after_load();
}catch( std::exception & )
{
Expand Down Expand Up @@ -558,7 +572,7 @@ bool SpecFile::load_from_radiacode_spectrogram( std::istream& input )
uint64_t last_timestamp = timestamp;
size_t skipped_lines = 0, total_lines = 0;
string line;
bool line_warning = true;
bool line_warning = true;
while( safe_get_line(input, line, 64*1024) )
{
total_lines += 1;
Expand Down Expand Up @@ -724,9 +738,7 @@ bool SpecFile::load_from_radiacode_spectrogram( std::istream& input )
if( !comment.empty() )
remarks_.push_back( "Comment: " + comment );

instrument_type_ = "Spectroscopic Personal Radiation Detector";
manufacturer_ = "Scan-Electronics";
detector_type_ = SpecUtils::DetectorType::RadiaCode;
guess_detector_from_radiacode_model();

cleanup_after_load();
}catch( std::exception & )
Expand Down
4 changes: 3 additions & 1 deletion src/SpecFile_spc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1388,7 +1388,9 @@ bool SpecFile::write_binary_spc( std::ostream &output,
case DetectorType::Raysid:
case DetectorType::KromekGR1:
case DetectorType::KromekD5:
case DetectorType::RadiaCode:
case DetectorType::RadiaCodeCsI10:
case DetectorType::RadiaCodeCsI14:
case DetectorType::RadiaCodeGAGG10:
case DetectorType::Fulcrum:
case DetectorType::Fulcrum40h:
case DetectorType::Sam950:
Expand Down
Loading