mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
more debugging at the beamline
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@538 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
@ -4546,7 +4546,7 @@ int slsDetector::setBadChannelCorrection(string fname){
|
||||
|
||||
|
||||
int slsDetector::setBadChannelCorrection(int nch, int *chs, int ff) {
|
||||
#ifdef VERBOSE
|
||||
#ifdef VERBOSE
|
||||
cout << "setting " << nch << " bad chans " << endl;
|
||||
#endif
|
||||
if (ff==0) {
|
||||
@ -4554,9 +4554,10 @@ int slsDetector::setBadChannelCorrection(int nch, int *chs, int ff) {
|
||||
thisDetector->correctionMask|=(1<<DISCARD_BAD_CHANNELS);
|
||||
thisDetector->nBadChans=0;
|
||||
for (int ich=0 ;ich<nch; ich++) {
|
||||
if (chs[ich]<getMaxNumberOfChannels()) {
|
||||
if (chs[ich]>=0 && chs[ich]<getMaxNumberOfChannels()) {
|
||||
thisDetector->badChansList[ich]=chs[ich];
|
||||
thisDetector->nBadChans++;
|
||||
// cout << "det : " << thisDetector->nBadChans << " " << thisDetector->badChansList[ich] << endl;
|
||||
}
|
||||
}
|
||||
} else
|
||||
@ -4572,7 +4573,7 @@ int slsDetector::setBadChannelCorrection(int nch, int *chs, int ff) {
|
||||
#ifdef VERBOSE
|
||||
cout << "badchans flag is "<< (thisDetector->correctionMask&(1<< DISCARD_BAD_CHANNELS)) << endl;
|
||||
#endif
|
||||
fillBadChannelMask();
|
||||
// fillBadChannelMask();
|
||||
if (thisDetector->correctionMask&(1<< DISCARD_BAD_CHANNELS)) {
|
||||
return thisDetector->nBadChans+thisDetector->nBadFF;
|
||||
} else
|
||||
|
@ -1512,7 +1512,7 @@ string slsDetectorCommand::cmdFlatField(int narg, char *args[], int action){
|
||||
sval=string(args[1]);
|
||||
else
|
||||
sval="none";
|
||||
double corr[24*1280], ecorr[24*1280];
|
||||
double corr[ myDet->getMaxNumberOfChannels()], ecorr[myDet->getMaxNumberOfChannels()];
|
||||
if (myDet->getFlatFieldCorrection(corr,ecorr)) {
|
||||
if (sval!="none") {
|
||||
myDet->writeDataFile(sval,corr,ecorr,NULL,'i');
|
||||
@ -1612,7 +1612,7 @@ string slsDetectorCommand::cmdBadChannels(int narg, char *args[], int action){
|
||||
sval=string(args[1]);
|
||||
else
|
||||
sval="none";
|
||||
int bch[24*1280], nbch;
|
||||
int bch[myDet->getMaxNumberOfChannels()], nbch;
|
||||
if ((nbch=myDet->getBadChannelCorrection(bch))) {
|
||||
if (sval!="none") {
|
||||
ofstream outfile;
|
||||
@ -2105,16 +2105,18 @@ string slsDetectorCommand::cmdScans(int narg, char *args[], int action) {
|
||||
}
|
||||
}
|
||||
ns=myDet->getScanSteps(is);
|
||||
values=new double[ns];
|
||||
ns=myDet->getScanSteps(is, values);
|
||||
int p=myDet->getScanPrecision(is);
|
||||
char format[1000];
|
||||
sprintf(format, "%%s %%0.%df",p);
|
||||
sprintf(answer,"%d ",ns);
|
||||
for (int i=0; i<ns; i++) {
|
||||
sprintf(answer,format,answer,values[i]);
|
||||
if (ns>0) {
|
||||
values=new double[ns];
|
||||
ns=myDet->getScanSteps(is, values);
|
||||
int p=myDet->getScanPrecision(is);
|
||||
char format[1000];
|
||||
sprintf(format, "%%s %%0.%df",p);
|
||||
for (int i=0; i<ns; i++) {
|
||||
sprintf(answer,format,answer,values[i]);
|
||||
}
|
||||
delete [] values;
|
||||
}
|
||||
delete [] values;
|
||||
return string(answer);
|
||||
}
|
||||
if (cmd.find("range")!=string::npos) {
|
||||
|
@ -519,7 +519,7 @@ int slsDetectorUtils::setBadChannelCorrection(string fname, int &nbadtot, int *b
|
||||
//int ich;
|
||||
//int chmin,chmax;
|
||||
#ifdef VERBOSE
|
||||
std::cout << "Setting bad channel correction to " << fname << std::endl;
|
||||
std::cout << "utils: Setting bad channel correction to " << fname << std::endl;
|
||||
#endif
|
||||
// int modmi=0;
|
||||
int modma=1;
|
||||
|
Reference in New Issue
Block a user