dataReady called

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@288 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
bergamaschi
2012-10-10 08:12:42 +00:00
parent 7f8f89f89d
commit b75b09cc7b
10 changed files with 160 additions and 58 deletions

View File

@ -238,6 +238,9 @@ multiSlsDetector::multiSlsDetector(int id) : slsDetectorUtils(), shmId(-1)
flatFieldFile=thisMultiDetector->flatFieldFile;
badChanFile=thisMultiDetector->badChanFile;
timerValue=thisMultiDetector->timerValue;
expTime=&timerValue[ACQUISITION_TIME];
currentSettings=&thisMultiDetector->currentSettings;
currentThresholdEV=&thisMultiDetector->currentThresholdEV;
filePath=thisMultiDetector->filePath;
@ -1675,8 +1678,9 @@ int multiSlsDetector::setFlatFieldCorrection(string fname){
chpm[im]=getChansPerMod(im);
mMask[im]=im;
}
if ((postProcessingFuncs::calculateFlatField(&nm, chpm, mMask, badChannelMask, data, ffcoefficients, fferrors))) {
fillModuleMask(mMask);
if ((postProcessingFuncs::calculateFlatField(&nm, chpm, mMask, badChannelMask, data, ffcoefficients, fferrors))>=0) {
strcpy(thisMultiDetector->flatFieldFile,fname.c_str());
@ -1684,7 +1688,8 @@ int multiSlsDetector::setFlatFieldCorrection(string fname){
setFlatFieldCorrection(ffcoefficients, fferrors);
}
} else
std::cout<< "Calculated flat field from file " << fname << " is not valid " << nch << std::endl;
} else {
std::cout<< "Flat field from file " << fname << " is not valid " << nch << std::endl;
}
@ -1693,6 +1698,25 @@ int multiSlsDetector::setFlatFieldCorrection(string fname){
return thisMultiDetector->correctionMask&(1<<FLAT_FIELD_CORRECTION);
}
int multiSlsDetector::fillModuleMask(int *mM) {
int imod=0, off=0;
if (mM) {
for (int i=0; i<thisMultiDetector->numberOfDetectors; i++) {
if (detectors[i]) {
for (int im=0; im<detectors[i]->getNMods(); im++) {
mM[imod]=im+off;
imod++;
}
off+=detectors[i]->getMaxMods();
}
}
}
return getNMods();
}
int multiSlsDetector::setFlatFieldCorrection(double *corr, double *ecorr) {
int ichdet=0;