diff --git a/slsDetectorCalibration/analogDetector.h b/slsDetectorCalibration/analogDetector.h index 800bfed5c..b05761181 100644 --- a/slsDetectorCalibration/analogDetector.h +++ b/slsDetectorCalibration/analogDetector.h @@ -199,7 +199,7 @@ template class analogDetector { \param nns reference to number of subpixels for interpolating detector, will always be 1 in this case \returns number of pixels of the detector image */ - virtual int getImageSize(int &nnx, int &nny, int &nns){nnx=nx; nny=ny; nns=1; return nx*ny;}; + virtual int getImageSize(int &nnx, int &nny, int &nnsx, int &nnsy){nnx=nx; nny=ny; nnsx=1; nnsy=1; return nx*ny;}; /** Returns data size of the detector image matrix \param nnx reference to pixel size in x diff --git a/slsDetectorCalibration/interpolatingDetector.h b/slsDetectorCalibration/interpolatingDetector.h index a91fe5dbe..973bd57ed 100644 --- a/slsDetectorCalibration/interpolatingDetector.h +++ b/slsDetectorCalibration/interpolatingDetector.h @@ -107,11 +107,11 @@ class interpolatingDetector : public singlePhotonDetector { singlePhotonDetector::clearImage(); }; - int getImageSize(int &nnx, int &nny, int &ns) { + int getImageSize(int &nnx, int &nny, int &nsx, int &nsy) { if (interp) - return interp->getImageSize(nnx, nny, ns); + return interp->getImageSize(nnx, nny, nsx, nsy); else - return analogDetector::getImageSize(nnx, nny, ns); + return analogDetector::getImageSize(nnx, nny, nsx, nsy); }; @@ -251,6 +251,7 @@ int addFrame(char *data, int *ph=NULL, int ff=0) { } virtual int getNSubPixels(){ if (interp) return interp->getNSubPixels(); else return 1;} + virtual int setNSubPixels(int ns) { if (interp) { pthread_mutex_lock(fi); diff --git a/slsDetectorCalibration/moenchExecutables/moenchZmqProcess.cpp b/slsDetectorCalibration/moenchExecutables/moenchZmqProcess.cpp index 18761ef21..4d7ece7c2 100644 --- a/slsDetectorCalibration/moenchExecutables/moenchZmqProcess.cpp +++ b/slsDetectorCalibration/moenchExecutables/moenchZmqProcess.cpp @@ -288,7 +288,7 @@ int main(int argc, char *argv[]) { char fname[10000]; // int length; int *detimage=NULL; - int nnx, nny,nns; + int nnx, nny,nnsx, nnsy; //uint32_t imageSize = 0, nPixelsX = 0, nPixelsY = 0, //uint32_t dynamicRange = 0; // infinite loop @@ -326,7 +326,7 @@ int main(int argc, char *argv[]) { frameMode fMode=eFrame; double *ped; - filter->getImageSize(nnx, nny,nns); + filter->getImageSize(nnx, nny,nnsx, nnsy); @@ -424,11 +424,13 @@ int main(int argc, char *argv[]) { if (fMode==ePedestal) { cprintf(MAGENTA,"Get pedestal!\n"); - nns=1; + nnsx=1; + nnsy=1; + nnx=npx; nny=npy; //dout= new int16_t[nnx*nny*nns*nns]; - dout= new int32_t[nnx*nny*nns*nns]; + dout= new int32_t[nnx*nny*nnsx*nnsy]; // cout << "get pedestal " << endl; ped=mt->getPedestal(); // cout << "got pedestal " << endl; @@ -454,9 +456,9 @@ int main(int argc, char *argv[]) { } #endif else { - detimage=mt->getImage(nnx,nny,nns); + detimage=mt->getImage(nnx,nny,nnsx, nnsy); cprintf(MAGENTA,"Get image!\n"); - cout << nnx << " " << nny << " " << nns << endl; + cout << nnx << " " << nny << " " << nnsx << " " << nnsy << endl; // nns=1; // nnx=npx; // nny=npy; @@ -821,7 +823,7 @@ int main(int argc, char *argv[]) { if (subframes>0 && insubframe>=subframes && fMode==eFrame) { while (mt->isBusy()) {;}//wait until all data are processed from the queues - detimage=mt->getImage(nnx,nny,nns); + detimage=mt->getImage(nnx,nny,nnsx, nnsy); cprintf(MAGENTA,"Get image!\n"); dout= new int32_t[nnx*nny]; doutf= new float[nnx*nny]; diff --git a/slsDetectorCalibration/multiThreadedAnalogDetector.h b/slsDetectorCalibration/multiThreadedAnalogDetector.h index 73f28653b..eb1a64b5f 100644 --- a/slsDetectorCalibration/multiThreadedAnalogDetector.h +++ b/slsDetectorCalibration/multiThreadedAnalogDetector.h @@ -95,7 +95,7 @@ public: virtual int *getImage() { return det->getImage(); } - virtual int getImageSize(int &nnx, int &nny, int &ns) {return det->getImageSize(nnx, nny, ns);}; + virtual int getImageSize(int &nnx, int &nny, int &nsx,int &nsy) {return det->getImageSize(nnx, nny, nsx, nsy);}; virtual int getDetectorSize(int &nnx, int &nny) {return det->getDetectorSize(nnx, nny);}; virtual ~threadedAnalogDetector() {StopThread(); delete fifoFree; delete fifoData;} @@ -320,11 +320,11 @@ public: virtual void newDataSet(){for (int i=0; inewDataSet();}; - virtual int *getImage(int &nnx, int &nny, int &ns) { + virtual int *getImage(int &nnx, int &nny, int &ns, int &nsy) { int *img; // int nnx, nny, ns; // int nnx, nny, ns; - int nn=dets[0]->getImageSize(nnx, nny,ns); + int nn=dets[0]->getImageSize(nnx, nny,ns, nsy); if (image) { delete image; image=NULL; @@ -369,10 +369,10 @@ public: /* dets[ii]->writeImage(tit); */ /* } */ /* #endif */ - int nnx, nny, ns; - getImage(nnx, nny, ns); + int nnx, nny, ns, nsy; + getImage(nnx, nny, ns, nsy); //int nnx, nny, ns; - int nn=dets[0]->getImageSize(nnx, nny, ns); + int nn=dets[0]->getImageSize(nnx, nny, ns, nsy); float *gm=new float[nn]; if (gm) { for (int ix=0; ixsetNSubPixels(ns);}; + /* virtual int setNSubPixels(int ns) { return (dets[0])->setNSubPixels(ns);}; */ virtual void resetFlatField() {(dets[0])->resetFlatField();}; @@ -69,13 +69,13 @@ public: - virtual int *getImage(int &nnx, int &nny, int &ns) { - if (getInterpolation()==NULL) return multiThreadedAnalogDetector::getImage(nnx,nny,ns); + virtual int *getImage(int &nnx, int &nny, int &nsx, int &nsy) { + if (getInterpolation()==NULL) return multiThreadedAnalogDetector::getImage(nnx,nny,nsx, nsy); //if one interpolates, the whole image is stored in detector 0; int *img; // int nnx, nny, ns; // int nnx, nny, ns; - int nn=dets[0]->getImageSize(nnx, nny,ns); + int nn=dets[0]->getImageSize(nnx, nny,nsx, nsy); if (image) { delete image; image=NULL;