mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 21:07:13 +02:00
now updating max number of modules when reading the number of modules
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@265 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
@ -2893,9 +2893,16 @@ int multiSlsDetector::getMaxMods() {
|
|||||||
for (int idet=0; idet<thisMultiDetector->numberOfDetectors; idet++) {
|
for (int idet=0; idet<thisMultiDetector->numberOfDetectors; idet++) {
|
||||||
if (detectors[idet]) {
|
if (detectors[idet]) {
|
||||||
ret1=detectors[idet]->getMaxMods();
|
ret1=detectors[idet]->getMaxMods();
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << "detector " << idet << " maxmods " << ret1 << endl;
|
||||||
|
#endif
|
||||||
ret+=ret1;
|
ret+=ret1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << "max mods is " << ret << endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2948,14 +2955,15 @@ int multiSlsDetector::setNumberOfModules(int p, dimension d) {
|
|||||||
|
|
||||||
int multiSlsDetector::decodeNMod(int i, int &id, int &im) {
|
int multiSlsDetector::decodeNMod(int i, int &id, int &im) {
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << " Module " << i << " belongs to detector " << id ;
|
cout << " Module " << i << " belongs to detector " << id << endl;;
|
||||||
|
cout << getMaxMods();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (i<0 || i>=getMaxMods()) {
|
if (i<0 || i>=getMaxMods()) {
|
||||||
id=-1;
|
id=-1;
|
||||||
im=-1;
|
im=-1;
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "A---------" << id << " position " << im << endl;
|
cout << " A---------" << id << " position " << im << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@ -2968,7 +2976,7 @@ int multiSlsDetector::decodeNMod(int i, int &id, int &im) {
|
|||||||
id=idet;
|
id=idet;
|
||||||
im=i;
|
im=i;
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "B---------" <<id << " position " << im << endl;
|
cout << " B---------" <<id << " position " << im << endl;
|
||||||
#endif
|
#endif
|
||||||
return im;
|
return im;
|
||||||
} else {
|
} else {
|
||||||
@ -2979,7 +2987,7 @@ int multiSlsDetector::decodeNMod(int i, int &id, int &im) {
|
|||||||
id=-1;
|
id=-1;
|
||||||
im=-1;
|
im=-1;
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout <<"C---------" << id << " position " << im << endl;
|
cout <<" C---------" << id << " position " << im << endl;
|
||||||
#endif
|
#endif
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
@ -1324,6 +1324,25 @@ int slsDetector::setNumberOfModules(int n, dimension d){
|
|||||||
} else {
|
} else {
|
||||||
thisDetector->nMod[d]=retval;
|
thisDetector->nMod[d]=retval;
|
||||||
thisDetector->nMods=thisDetector->nMod[X]*thisDetector->nMod[Y];
|
thisDetector->nMods=thisDetector->nMod[X]*thisDetector->nMod[Y];
|
||||||
|
|
||||||
|
|
||||||
|
if (thisDetector->nModsMax<thisDetector->nMods)
|
||||||
|
thisDetector->nModsMax=thisDetector->nMods;
|
||||||
|
|
||||||
|
if (thisDetector->nModMax[X]<thisDetector->nMod[X])
|
||||||
|
thisDetector->nModMax[X]=thisDetector->nMod[X];
|
||||||
|
|
||||||
|
if (thisDetector->nModMax[Y]<thisDetector->nMod[Y])
|
||||||
|
thisDetector->nModMax[Y]=thisDetector->nMod[Y];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int dr=thisDetector->dynamicRange;
|
int dr=thisDetector->dynamicRange;
|
||||||
if (dr==24)
|
if (dr==24)
|
||||||
dr=32;
|
dr=32;
|
||||||
@ -2848,6 +2867,14 @@ int slsDetector::updateDetectorNoWait() {
|
|||||||
n = controlSocket->ReceiveDataOnly( &nm,sizeof(nm));
|
n = controlSocket->ReceiveDataOnly( &nm,sizeof(nm));
|
||||||
thisDetector->nMod[Y]=nm;
|
thisDetector->nMod[Y]=nm;
|
||||||
thisDetector->nMods=thisDetector->nMod[Y]*thisDetector->nMod[X];
|
thisDetector->nMods=thisDetector->nMod[Y]*thisDetector->nMod[X];
|
||||||
|
if (thisDetector->nModsMax<thisDetector->nMods)
|
||||||
|
thisDetector->nModsMax=thisDetector->nMods;
|
||||||
|
|
||||||
|
if (thisDetector->nModMax[X]<thisDetector->nMod[X])
|
||||||
|
thisDetector->nModMax[X]=thisDetector->nMod[X];
|
||||||
|
|
||||||
|
if (thisDetector->nModMax[Y]<thisDetector->nMod[Y])
|
||||||
|
thisDetector->nModMax[Y]=thisDetector->nMod[Y];
|
||||||
|
|
||||||
n = controlSocket->ReceiveDataOnly( &nm,sizeof(nm));
|
n = controlSocket->ReceiveDataOnly( &nm,sizeof(nm));
|
||||||
thisDetector->dynamicRange=nm;
|
thisDetector->dynamicRange=nm;
|
||||||
|
@ -94,10 +94,17 @@ fname=createFileName();
|
|||||||
if(*correctionMask&(1<<WRITE_FILE))
|
if(*correctionMask&(1<<WRITE_FILE))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << "writing raw data " << endl;
|
||||||
|
|
||||||
|
#endif
|
||||||
//uses static function?!?!?!?
|
//uses static function?!?!?!?
|
||||||
writeDataFile (fname+string(".raw"),fdata, NULL, NULL, 'i');
|
writeDataFile (fname+string(".raw"),fdata, NULL, NULL, 'i');
|
||||||
|
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << "done " << endl;
|
||||||
|
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
doProcessing(fdata,delflag, fname);
|
doProcessing(fdata,delflag, fname);
|
||||||
@ -146,10 +153,16 @@ void postProcessing::doProcessing(double *lfdata, int delflag, string fname) {
|
|||||||
|
|
||||||
/** rate correction */
|
/** rate correction */
|
||||||
if (*correctionMask&(1<<RATE_CORRECTION)) {
|
if (*correctionMask&(1<<RATE_CORRECTION)) {
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << "rate correcting " << endl;
|
||||||
|
#endif
|
||||||
rcdata=new double[getTotalNumberOfChannels()];
|
rcdata=new double[getTotalNumberOfChannels()];
|
||||||
rcerr=new double[getTotalNumberOfChannels()];
|
rcerr=new double[getTotalNumberOfChannels()];
|
||||||
rateCorrect(lfdata,NULL,rcdata,rcerr);
|
rateCorrect(lfdata,NULL,rcdata,rcerr);
|
||||||
delete [] lfdata;
|
delete [] lfdata;
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << "done " << endl;
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
rcdata=lfdata;
|
rcdata=lfdata;
|
||||||
}
|
}
|
||||||
@ -161,6 +174,9 @@ void postProcessing::doProcessing(double *lfdata, int delflag, string fname) {
|
|||||||
/** flat field correction */
|
/** flat field correction */
|
||||||
if (*correctionMask&(1<<FLAT_FIELD_CORRECTION)) {
|
if (*correctionMask&(1<<FLAT_FIELD_CORRECTION)) {
|
||||||
|
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << "ff correcting " << endl;
|
||||||
|
#endif
|
||||||
ffcdata=new double[getTotalNumberOfChannels()];
|
ffcdata=new double[getTotalNumberOfChannels()];
|
||||||
ffcerr=new double[getTotalNumberOfChannels()];
|
ffcerr=new double[getTotalNumberOfChannels()];
|
||||||
flatFieldCorrect(rcdata,rcerr,ffcdata,ffcerr);
|
flatFieldCorrect(rcdata,rcerr,ffcdata,ffcerr);
|
||||||
@ -169,6 +185,10 @@ void postProcessing::doProcessing(double *lfdata, int delflag, string fname) {
|
|||||||
if (rcerr)
|
if (rcerr)
|
||||||
delete [] rcerr;
|
delete [] rcerr;
|
||||||
rcerr=NULL;
|
rcerr=NULL;
|
||||||
|
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << "done " << endl;
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
ffcdata=rcdata;
|
ffcdata=rcdata;
|
||||||
ffcerr=rcerr;
|
ffcerr=rcerr;
|
||||||
@ -179,9 +199,19 @@ void postProcessing::doProcessing(double *lfdata, int delflag, string fname) {
|
|||||||
// writes angualr converted files
|
// writes angualr converted files
|
||||||
|
|
||||||
if (*correctionMask!=0) {
|
if (*correctionMask!=0) {
|
||||||
if (*correctionMask&(1<< ANGULAR_CONVERSION))
|
if (*correctionMask&(1<< ANGULAR_CONVERSION)) {
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << "ang conv " << endl;
|
||||||
|
#endif
|
||||||
ang=convertAngles();
|
ang=convertAngles();
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << "done - write position data file " << endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
writeDataFile (fname+ext, ffcdata, ffcerr,ang);
|
writeDataFile (fname+ext, ffcdata, ffcerr,ang);
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << "done " << endl;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (*correctionMask&(1<< ANGULAR_CONVERSION) && getNumberOfPositions()>0) {
|
// if (*correctionMask&(1<< ANGULAR_CONVERSION) && getNumberOfPositions()>0) {
|
||||||
|
Reference in New Issue
Block a user