fixed probelm with interpolation of rectangular pixels

This commit is contained in:
2019-12-10 11:10:58 +01:00
parent 545684c8e3
commit 27f2321d64
3 changed files with 7 additions and 10 deletions

View File

@ -195,11 +195,11 @@ class eta2InterpolationBase : public virtual etaInterpolationBase {
ex=nbetaX-1; ex=nbetaX-1;
} }
if (ey<0) { if (ey<0) {
cout << "y*"<< ey << endl; cout << "y*"<< ey << " " << nbetaY << endl;
ey=0; ey=0;
} }
if (ey>=nbetaY) { if (ey>=nbetaY) {
cout << "y?"<< ey << endl; cout << "y?"<< ey << " " << nbetaY << endl;
ey=nbetaY-1; ey=nbetaY-1;
} }

View File

@ -152,7 +152,7 @@ class etaInterpolationBase : public slsInterpolation {
/* return 0; */ /* return 0; */
/* } */ /* } */
nbetaX=nnx; nbetaX=nnx;
nbetaY=nnx; nbetaY=nny;
if (gm) { if (gm) {
if (heta) { if (heta) {
delete [] heta; delete [] heta;

View File

@ -119,7 +119,7 @@ int main(int argc, char *argv[]) {
#ifndef NOINTERPOLATION #ifndef NOINTERPOLATION
cout << "read ff " << argv[2] << endl; cout << "read ff " << argv[2] << endl;
sprintf(fname,"%s",argv[2]); sprintf(fname,"%s",argv[2]);
interp->readFlatField(fname); interp->readFlatField(fname, etamin, etamax);
interp->prepareInterpolation(ok);//, MAX_ITERATIONS); interp->prepareInterpolation(ok);//, MAX_ITERATIONS);
#endif #endif
// return 0; // return 0;
@ -161,23 +161,20 @@ int main(int argc, char *argv[]) {
totph++; totph++;
if (lastframe!=cl.iframe) { if (lastframe!=cl.iframe) {
lastframe=cl.iframe; lastframe=cl.iframe;
// cout << cl.iframe << endl;
// f0=cl.iframe;
if (nframes==0) f0=lastframe; if (nframes==0) f0=lastframe;
nframes++; nframes++;
} }
//quad=interp->calcQuad(cl.get_cluster(), sum, totquad, sDum);
quad=interp->calcEta(cl.get_cluster(), etax, etay, 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 ) { if (sum>cmin && totquad/sum>0.8 && totquad/sum<1.2 && sum<cmax ) {
nph++; nph++;
// if (sum>200 && sum<580) { // if (sum>200 && sum<580) {
// interp->getInterpolatedPosition(cl.x,cl.y, totquad,quad,cl.get_cluster(),int_x, int_y); // interp->getInterpolatedPosition(cl.x,cl.y, totquad,quad,cl.get_cluster(),int_x, int_y);
// #ifdef SOLEIL // #ifdef SOLEIL
// if (cl.x>210 && cl.x<240 && cl.y>210 && cl.y<240) { // if (cl.x>210 && cl.x<240 && cl.y>210 && cl.y<240) {
// #endif // #endif
#ifndef FF #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); interp->getInterpolatedPosition(cl.x,cl.y, etax, etay, quad,int_x, int_y);
// cout <<"**************"<< endl; // cout <<"**************"<< endl;
// cout << cl.x << " " << cl.y << " " << sum << endl; // cout << cl.x << " " << cl.y << " " << sum << endl;
// cl.print(); // cl.print();