mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-24 07:20:01 +02:00
replacing out of range trimbits with edge values
This commit is contained in:
parent
997e5dd96c
commit
1eb70f63ad
@ -351,6 +351,23 @@ void Module::setAllThresholdEnergy(std::array<int, 3> e_eV,
|
|||||||
myMod.reg = isettings;
|
myMod.reg = isettings;
|
||||||
std::copy(e_eV.begin(), e_eV.end(), myMod.eV);
|
std::copy(e_eV.begin(), e_eV.end(), myMod.eV);
|
||||||
LOG(logDEBUG) << "ev:" << ToString(myMod.eV);
|
LOG(logDEBUG) << "ev:" << ToString(myMod.eV);
|
||||||
|
|
||||||
|
//check for trimbits that are out of range
|
||||||
|
bool out_of_range = false;
|
||||||
|
for(int i = 0; i!=myMod.nchan; ++i){
|
||||||
|
if (myMod.chanregs[i]<0){
|
||||||
|
myMod.chanregs[i] = 0;
|
||||||
|
out_of_range = true;
|
||||||
|
}else if(myMod.chanregs[i]>63){
|
||||||
|
myMod.chanregs[i]=63;
|
||||||
|
out_of_range = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (out_of_range){
|
||||||
|
LOG(logWARNING) << "Some trimbits were out of range after interpolation, these have been replaced with 0 or 63.";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
setModule(myMod, trimbits);
|
setModule(myMod, trimbits);
|
||||||
if (getSettings() != isettings) {
|
if (getSettings() != isettings) {
|
||||||
throw RuntimeError("setThresholdEnergyAndSettings: Could not set "
|
throw RuntimeError("setThresholdEnergyAndSettings: Could not set "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user