mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-13 21:37:13 +02:00
Bad channels correction separated from postProcessing
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@241 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
@ -66,69 +66,6 @@ int postProcessing::flatFieldCorrect(double datain, double errin, double &dataou
|
||||
|
||||
|
||||
|
||||
int postProcessing::setBadChannelCorrection(ifstream &infile, int &nbad, int *badlist, int moff){
|
||||
|
||||
int interrupt=0;
|
||||
int ich;
|
||||
int chmin,chmax;
|
||||
string str;
|
||||
|
||||
|
||||
|
||||
nbad=0;
|
||||
while (infile.good() and interrupt==0) {
|
||||
getline(infile,str);
|
||||
#ifdef VERBOSE
|
||||
std::cout << str << std::endl;
|
||||
#endif
|
||||
istringstream ssstr;
|
||||
ssstr.str(str);
|
||||
if (ssstr.bad() || ssstr.fail() || infile.eof()) {
|
||||
interrupt=1;
|
||||
break;
|
||||
}
|
||||
if (str.find('-')!=string::npos) {
|
||||
ssstr >> chmin ;
|
||||
ssstr.str(str.substr(str.find('-')+1,str.size()));
|
||||
ssstr >> chmax;
|
||||
#ifdef VERBOSE
|
||||
std::cout << "channels between"<< chmin << " and " << chmax << std::endl;
|
||||
#endif
|
||||
for (ich=chmin; ich<=chmax; ich++) {
|
||||
if (nbad<MAX_BADCHANS) {
|
||||
badlist[nbad]=ich;
|
||||
nbad++;
|
||||
#ifdef VERBOSE
|
||||
std::cout<< nbad << " Found bad channel "<< ich << std::endl;
|
||||
#endif
|
||||
} else
|
||||
interrupt=1;
|
||||
}
|
||||
} else {
|
||||
ssstr >> ich;
|
||||
#ifdef VERBOSE
|
||||
std::cout << "channel "<< ich << std::endl;
|
||||
#endif
|
||||
if (nbad<MAX_BADCHANS) {
|
||||
badlist[nbad]=ich;
|
||||
nbad++;
|
||||
#ifdef VERBOSE
|
||||
std::cout << nbad << " Found bad channel "<< ich << std::endl;
|
||||
#endif
|
||||
} else
|
||||
interrupt=1;
|
||||
}
|
||||
}
|
||||
|
||||
for (int ich=0; ich<nbad; ich++) {
|
||||
badlist[ich]=badlist[ich]+moff;
|
||||
}
|
||||
return nbad;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user