mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-11 12:27:14 +02:00
minor modifications for interpolation and mythe data structure
This commit is contained in:
@ -92,16 +92,23 @@ int main(int argc, char *argv[]) {
|
||||
#endif
|
||||
|
||||
int nSubPixels=nsubpix;
|
||||
//eta2InterpolationPosXY *interp=new eta2InterpolationPosXY(NC, NR, nsubpix, etabins, etamin, etamax);
|
||||
eta2InterpolationCleverAdaptiveBins *interp=new eta2InterpolationCleverAdaptiveBins(NC, NR, nsubpix, etabins, etamin, etamax);
|
||||
|
||||
#ifndef NOINTERPOLATION
|
||||
eta2InterpolationPosXY *interp=new eta2InterpolationPosXY(NC, NR, nsubpix, etabins, etamin, etamax);
|
||||
//eta2InterpolationCleverAdaptiveBins *interp=new eta2InterpolationCleverAdaptiveBins(NC, NR, nsubpix, etabins, etamin, etamax);
|
||||
#endif
|
||||
#ifdef NOINTERPOLATION
|
||||
noInterpolation *interp=new noInterpolation(NC, NR, nsubpix);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifndef FF
|
||||
#ifndef NOINTERPOLATION
|
||||
cout << "read ff " << argv[2] << endl;
|
||||
sprintf(fname,"%s",argv[2]);
|
||||
interp->readFlatField(fname);
|
||||
interp->prepareInterpolation(ok, MAX_ITERATIONS);
|
||||
interp->prepareInterpolation(ok);//, MAX_ITERATIONS);
|
||||
#endif
|
||||
// return 0;
|
||||
#endif
|
||||
#ifdef FF
|
||||
@ -146,8 +153,9 @@ int main(int argc, char *argv[]) {
|
||||
if (nframes==0) f0=lastframe;
|
||||
nframes++;
|
||||
}
|
||||
quad=interp->calcQuad(cl.get_cluster(), sum, totquad, sDum);
|
||||
if (sum>cmin && totquad/sum>0.8 && totquad/sum<1.2 && sum<cmax ) {
|
||||
//quad=interp->calcQuad(cl.get_cluster(), sum, totquad, sDum);
|
||||
quad=interp->calcEta(cl.get_cluster(), etax, etay, sum, totquad, sDum);
|
||||
if (sum>cmin && totquad/sum>0.8 && totquad/sum<1.2 && sum<cmax ) {
|
||||
nph++;
|
||||
// if (sum>200 && sum<580) {
|
||||
// interp->getInterpolatedPosition(cl.x,cl.y, totquad,quad,cl.get_cluster(),int_x, int_y);
|
||||
@ -155,16 +163,32 @@ int main(int argc, char *argv[]) {
|
||||
// if (cl.x>210 && cl.x<240 && cl.y>210 && cl.y<240) {
|
||||
// #endif
|
||||
#ifndef FF
|
||||
interp->getInterpolatedPosition(cl.x,cl.y, cl.get_cluster(),int_x, int_y);
|
||||
// interp->getInterpolatedPosition(cl.x,cl.y, cl.get_cluster(),int_x, int_y);
|
||||
interp->getInterpolatedPosition(cl.x,cl.y, etax, etay, quad,int_x, int_y);
|
||||
// cout <<"**************"<< endl;
|
||||
// cout << cl.x << " " << cl.y << " " << sum << endl;
|
||||
// cl.print();
|
||||
// cout << int_x << " " << int_y << endl;
|
||||
// cout <<"**************"<< endl;
|
||||
interp->addToImage(int_x, int_y);
|
||||
// if (etax!=0 && etay!=0 && etax!=1 && etay!=1)
|
||||
interp->addToImage(int_x, int_y);
|
||||
if (int_x<0 || int_y<0 || int_x>400 || int_y>400) {
|
||||
cout <<"**************"<< endl;
|
||||
cout << cl.x << " " << cl.y << " " << sum << endl;
|
||||
cl.print();
|
||||
cout << int_x << " " << int_y << endl;
|
||||
cout <<"**************"<< endl;
|
||||
}
|
||||
#endif
|
||||
#ifdef FF
|
||||
interp->addToFlatField(cl.get_cluster(), etax, etay);
|
||||
// interp->addToFlatField(cl.get_cluster(), etax, etay);
|
||||
// #ifdef UCL
|
||||
// if (cl.x>50)
|
||||
// #endif
|
||||
// if (etax!=0 && etay!=0 && etax!=1 && etay!=1)
|
||||
interp->addToFlatField(etax, etay);
|
||||
// if (etax==0 || etay==0) cout << cl.x << " " << cl.y << endl;
|
||||
|
||||
#endif
|
||||
// #ifdef SOLEIL
|
||||
// }
|
||||
@ -179,12 +203,12 @@ int main(int argc, char *argv[]) {
|
||||
interp->writeFlatField(outfname);
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
fclose(f);
|
||||
#ifdef FF
|
||||
interp->writeFlatField(outfname);
|
||||
@ -203,7 +227,7 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
}
|
||||
}
|
||||
cout << "Read " << nframes << " frames (first frame: " << f0 << " last frame: " << lastframe << " delta:" << lastframe-f0 << ")"<<endl;
|
||||
cout << "Read " << nframes << " frames (first frame: " << f0 << " last frame: " << lastframe << " delta:" << lastframe-f0 << ") nph="<< nph <<endl;
|
||||
interp->clearInterpolatedImage();
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user