mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-05-08 05:40:03 +02:00
merge fix
This commit is contained in:
commit
cace18e535
@ -30,6 +30,8 @@ This document describes the differences between v6.1.0 and v6.0.0.
|
||||
- mythen server kernel check incompatible (cet timezone)
|
||||
- rx_arping
|
||||
- rx_threadsids max is now 9 (breaking api)
|
||||
- m3 server crash (vthrehsold)
|
||||
|
||||
|
||||
|
||||
2. Resolved Issues
|
||||
|
@ -13,8 +13,8 @@ import subprocess
|
||||
|
||||
from parse import remove_comments
|
||||
|
||||
allow_bitwise_op = ["M3_GainCaps"]
|
||||
allow_bitwise_op = ["streamingInterface"]
|
||||
|
||||
allow_bitwise_op = ["streamingInterface", "M3_GainCaps"]
|
||||
|
||||
op_key = {"operator|": "|",
|
||||
"operator&" : "&"}
|
||||
|
@ -273,7 +273,8 @@ void init_enums(py::module &m) {
|
||||
slsDetectorDefs::timingSourceType::TIMING_EXTERNAL)
|
||||
.export_values();
|
||||
|
||||
py::enum_<slsDetectorDefs::M3_GainCaps>(Defs, "M3_GainCaps")
|
||||
py::enum_<slsDetectorDefs::M3_GainCaps>(Defs, "M3_GainCaps",
|
||||
py::arithmetic())
|
||||
.value("M3_C10pre", slsDetectorDefs::M3_GainCaps::M3_C10pre)
|
||||
.value("M3_C15sh", slsDetectorDefs::M3_GainCaps::M3_C15sh)
|
||||
.value("M3_C30sh", slsDetectorDefs::M3_GainCaps::M3_C30sh)
|
||||
|
@ -149,7 +149,7 @@ class interpolatingDetector : public singlePhotonDetector {
|
||||
{
|
||||
nph = addFrame(data, val, 1);
|
||||
if (interp)
|
||||
return interp->getFlatField();
|
||||
return interp->getFlatFieldDistribution();
|
||||
else
|
||||
return NULL;
|
||||
};
|
||||
|
@ -238,96 +238,96 @@ class eta2InterpolationBase : public virtual etaInterpolationBase {
|
||||
|
||||
// cout <<"******"<< etax << " " << etay << endl;
|
||||
|
||||
return addToFlatField(etax, etay);
|
||||
return addToFlatFieldDistribution(etax, etay);
|
||||
}
|
||||
|
||||
virtual int addToFlatField(double totquad, int quad, double *cl,
|
||||
double &etax, double &etay) {
|
||||
double cc[2][2];
|
||||
int xoff = 0, yoff = 0;
|
||||
/* virtual int addToFlatField(double totquad, int quad, double *cl, */
|
||||
/* double &etax, double &etay) { */
|
||||
/* double cc[2][2]; */
|
||||
/* int xoff = 0, yoff = 0; */
|
||||
|
||||
switch (quad) {
|
||||
case BOTTOM_LEFT:
|
||||
xoff = 0;
|
||||
yoff = 0;
|
||||
break;
|
||||
case BOTTOM_RIGHT:
|
||||
xoff = 1;
|
||||
yoff = 0;
|
||||
break;
|
||||
case TOP_LEFT:
|
||||
xoff = 0;
|
||||
yoff = 1;
|
||||
break;
|
||||
case TOP_RIGHT:
|
||||
xoff = 1;
|
||||
yoff = 1;
|
||||
break;
|
||||
default:;
|
||||
}
|
||||
cc[0][0] = cl[xoff + 3 * yoff];
|
||||
cc[1][0] = cl[(yoff + 1) * 3 + xoff];
|
||||
cc[0][1] = cl[yoff * 3 + xoff + 1];
|
||||
cc[1][1] = cl[(yoff + 1) * 3 + xoff + 1];
|
||||
/* switch (quad) { */
|
||||
/* case BOTTOM_LEFT: */
|
||||
/* xoff = 0; */
|
||||
/* yoff = 0; */
|
||||
/* break; */
|
||||
/* case BOTTOM_RIGHT: */
|
||||
/* xoff = 1; */
|
||||
/* yoff = 0; */
|
||||
/* break; */
|
||||
/* case TOP_LEFT: */
|
||||
/* xoff = 0; */
|
||||
/* yoff = 1; */
|
||||
/* break; */
|
||||
/* case TOP_RIGHT: */
|
||||
/* xoff = 1; */
|
||||
/* yoff = 1; */
|
||||
/* break; */
|
||||
/* default:; */
|
||||
/* } */
|
||||
/* cc[0][0] = cl[xoff + 3 * yoff]; */
|
||||
/* cc[1][0] = cl[(yoff + 1) * 3 + xoff]; */
|
||||
/* cc[0][1] = cl[yoff * 3 + xoff + 1]; */
|
||||
/* cc[1][1] = cl[(yoff + 1) * 3 + xoff + 1]; */
|
||||
|
||||
/* cout << cl[0] << " " << cl[1] << " " << cl[2] << endl; */
|
||||
/* cout << cl[3] << " " << cl[4] << " " << cl[5] << endl; */
|
||||
/* cout << cl[6] << " " << cl[7] << " " << cl[8] << endl; */
|
||||
/* cout <<"******"<<totquad << " " << quad << endl; */
|
||||
/* cout << cc[0][0]<< " " << cc[0][1] << endl; */
|
||||
/* cout << cc[1][0]<< " " << cc[1][1] << endl; */
|
||||
// calcMyEta(totquad,quad,cl,etax, etay);
|
||||
calcEta(totquad, cc, etax, etay);
|
||||
/* /\* cout << cl[0] << " " << cl[1] << " " << cl[2] << endl; *\/ */
|
||||
/* /\* cout << cl[3] << " " << cl[4] << " " << cl[5] << endl; *\/ */
|
||||
/* /\* cout << cl[6] << " " << cl[7] << " " << cl[8] << endl; *\/ */
|
||||
/* /\* cout <<"******"<<totquad << " " << quad << endl; *\/ */
|
||||
/* /\* cout << cc[0][0]<< " " << cc[0][1] << endl; *\/ */
|
||||
/* /\* cout << cc[1][0]<< " " << cc[1][1] << endl; *\/ */
|
||||
/* // calcMyEta(totquad,quad,cl,etax, etay); */
|
||||
/* calcEta(totquad, cc, etax, etay); */
|
||||
|
||||
// cout <<"******"<< etax << " " << etay << endl;
|
||||
/* // cout <<"******"<< etax << " " << etay << endl; */
|
||||
|
||||
return addToFlatField(etax, etay);
|
||||
}
|
||||
/* return addToFlatFieldDistribution(etax, etay); */
|
||||
/* } */
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
virtual int addToFlatField(double *cluster, double &etax, double &etay) {
|
||||
double sDum[2][2];
|
||||
double tot, totquad;
|
||||
// int corner;
|
||||
// corner=
|
||||
calcQuad(cluster, tot, totquad, sDum);
|
||||
/* virtual int addToFlatField(double *cluster, double &etax, double &etay) { */
|
||||
/* double sDum[2][2]; */
|
||||
/* double tot, totquad; */
|
||||
/* // int corner; */
|
||||
/* // corner= */
|
||||
/* calcQuad(cluster, tot, totquad, sDum); */
|
||||
|
||||
// double xpos_eta,ypos_eta;
|
||||
// double dX,dY;
|
||||
/* // double xpos_eta,ypos_eta; */
|
||||
/* // double dX,dY; */
|
||||
|
||||
calcEta(totquad, sDum, etax, etay);
|
||||
/* calcEta(totquad, sDum, etax, etay); */
|
||||
|
||||
return addToFlatField(etax, etay);
|
||||
};
|
||||
/* return addToFlatField(etax, etay); */
|
||||
/* }; */
|
||||
|
||||
virtual int addToFlatField(int *cluster, double &etax, double &etay) {
|
||||
double sDum[2][2];
|
||||
double tot, totquad;
|
||||
// int corner;
|
||||
// corner=
|
||||
calcQuad(cluster, tot, totquad, sDum);
|
||||
/* virtual int addToFlatField(int *cluster, double &etax, double &etay) { */
|
||||
/* double sDum[2][2]; */
|
||||
/* double tot, totquad; */
|
||||
/* // int corner; */
|
||||
/* // corner= */
|
||||
/* calcQuad(cluster, tot, totquad, sDum); */
|
||||
|
||||
// double xpos_eta,ypos_eta;
|
||||
// double dX,dY;
|
||||
/* // double xpos_eta,ypos_eta; */
|
||||
/* // double dX,dY; */
|
||||
|
||||
calcEta(totquad, sDum, etax, etay);
|
||||
/* calcEta(totquad, sDum, etax, etay); */
|
||||
|
||||
return addToFlatField(etax, etay);
|
||||
};
|
||||
/* return addToFlatField(etax, etay); */
|
||||
/* }; */
|
||||
|
||||
virtual int addToFlatField(double etax, double etay) {
|
||||
#ifdef MYROOT1
|
||||
heta->Fill(etax, etay);
|
||||
#endif
|
||||
#ifndef MYROOT1
|
||||
int ex, ey;
|
||||
ex = (etax - etamin) / etastepX;
|
||||
ey = (etay - etamin) / etastepY;
|
||||
if (ey < nbetaY && ex < nbetaX && ex >= 0 && ey >= 0)
|
||||
heta[ey * nbetaX + ex]++;
|
||||
#endif
|
||||
return 0;
|
||||
};
|
||||
/* virtual int addToFlatFieldDistribution(double etax, double etay) { */
|
||||
/* #ifdef MYROOT1 */
|
||||
/* heta->Fill(etax, etay); */
|
||||
/* #endif */
|
||||
/* #ifndef MYROOT1 */
|
||||
/* int ex, ey; */
|
||||
/* ex = (etax - etamin) / etastepX; */
|
||||
/* ey = (etay - etamin) / etastepY; */
|
||||
/* if (ey < nbetaY && ex < nbetaX && ex >= 0 && ey >= 0) */
|
||||
/* heta[ey * nbetaX + ex]++; */
|
||||
/* #endif */
|
||||
/* return 0; */
|
||||
/* }; */
|
||||
|
||||
virtual int *getInterpolatedImage() {
|
||||
int ipx, ipy;
|
||||
|
@ -205,44 +205,44 @@ class eta3InterpolationBase : public virtual etaInterpolationBase {
|
||||
double &etay) {
|
||||
|
||||
calcEta3(cl, etax, etay, totquad);
|
||||
return addToFlatField(etax, etay);
|
||||
return addToFlatFieldDistribution(etax, etay);
|
||||
}
|
||||
|
||||
virtual int addToFlatField(double totquad, int quad, double *cl,
|
||||
double &etax, double &etay) {
|
||||
/* virtual int addToFlatField(double totquad, int quad, double *cl, */
|
||||
/* double &etax, double &etay) { */
|
||||
|
||||
calcEta3(cl, etax, etay, totquad);
|
||||
return addToFlatField(etax, etay);
|
||||
}
|
||||
/* calcEta3(cl, etax, etay, totquad); */
|
||||
/* return addToFlatField(etax, etay); */
|
||||
/* } */
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
virtual int addToFlatField(double *cluster, double &etax, double &etay) {
|
||||
double totquad;
|
||||
calcEta3(cluster, etax, etay, totquad);
|
||||
return addToFlatField(etax, etay);
|
||||
};
|
||||
/* virtual int addToFlatField(double *cluster, double &etax, double &etay) { */
|
||||
/* double totquad; */
|
||||
/* calcEta3(cluster, etax, etay, totquad); */
|
||||
/* return addToFlatField(etax, etay); */
|
||||
/* }; */
|
||||
|
||||
virtual int addToFlatField(int *cluster, double &etax, double &etay) {
|
||||
/* virtual int addToFlatField(int *cluster, double &etax, double &etay) { */
|
||||
|
||||
double totquad;
|
||||
/* double totquad; */
|
||||
|
||||
calcEta3(cluster, etax, etay, totquad);
|
||||
return addToFlatField(etax, etay);
|
||||
};
|
||||
/* calcEta3(cluster, etax, etay, totquad); */
|
||||
/* return addToFlatField(etax, etay); */
|
||||
/* }; */
|
||||
|
||||
virtual int addToFlatField(double etax, double etay) {
|
||||
#ifdef MYROOT1
|
||||
heta->Fill(etax, etay);
|
||||
#endif
|
||||
#ifndef MYROOT1
|
||||
int ex, ey;
|
||||
ex = (etax - etamin) / etastepX;
|
||||
ey = (etay - etamin) / etastepY;
|
||||
if (ey < nbetaY && ex < nbetaX && ex >= 0 && ey >= 0)
|
||||
heta[ey * nbetaX + ex]++;
|
||||
#endif
|
||||
return 0;
|
||||
};
|
||||
/* virtual int addToFlatField(double etax, double etay) { */
|
||||
/* #ifdef MYROOT1 */
|
||||
/* heta->Fill(etax, etay); */
|
||||
/* #endif */
|
||||
/* #ifndef MYROOT1 */
|
||||
/* int ex, ey; */
|
||||
/* ex = (etax - etamin) / etastepX; */
|
||||
/* ey = (etay - etamin) / etastepY; */
|
||||
/* if (ey < nbetaY && ex < nbetaX && ex >= 0 && ey >= 0) */
|
||||
/* heta[ey * nbetaX + ex]++; */
|
||||
/* #endif */
|
||||
/* return 0; */
|
||||
/* }; */
|
||||
|
||||
/* protected: */
|
||||
|
||||
|
@ -128,7 +128,7 @@ class etaInterpolationBase : public slsInterpolation {
|
||||
return NULL;
|
||||
};
|
||||
|
||||
int readFlatField(const char *imgname, double emin = 1, double emax = 0) {
|
||||
void *readFlatField(const char *imgname, double emin = 1, double emax = 0) {
|
||||
if (emax >= 1)
|
||||
etamax = emax;
|
||||
if (emin <= 0)
|
||||
@ -169,9 +169,9 @@ class etaInterpolationBase : public slsInterpolation {
|
||||
}
|
||||
}
|
||||
delete[] gm;
|
||||
return 1;
|
||||
return heta;
|
||||
}
|
||||
return 0;
|
||||
return NULL;
|
||||
};
|
||||
|
||||
float *gethhx() {
|
||||
@ -183,12 +183,17 @@ class etaInterpolationBase : public slsInterpolation {
|
||||
// hhy->Scale((double)nSubPixels);
|
||||
return hhy;
|
||||
};
|
||||
virtual int addToFlatField(double etax, double etay) {
|
||||
virtual int addToFlatFieldDistribution(double etax, double etay) {
|
||||
#ifdef MYROOT1
|
||||
heta->Fill(etax, etay);
|
||||
#endif
|
||||
#ifndef MYROOT1
|
||||
int ex, ey;
|
||||
ex = (etax - etamin) / etastepX;
|
||||
ey = (etay - etamin) / etastepY;
|
||||
if (ey < nbetaY && ex < nbetaX && ex >= 0 && ey >= 0)
|
||||
heta[ey * nbetaX + ex]++;
|
||||
#endif
|
||||
return 0;
|
||||
};
|
||||
|
||||
|
@ -78,20 +78,20 @@ class noInterpolation : public slsInterpolation {
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
virtual int addToFlatField(double *cluster, double &etax, double &etay) {
|
||||
return 0;
|
||||
};
|
||||
/* virtual int addToFlatField(double *cluster, double &etax, double &etay) { */
|
||||
/* return 0; */
|
||||
/* }; */
|
||||
|
||||
virtual int addToFlatField(int *cluster, double &etax, double &etay) {
|
||||
return 0;
|
||||
};
|
||||
/* virtual int addToFlatField(int *cluster, double &etax, double &etay) { */
|
||||
/* return 0; */
|
||||
/* }; */
|
||||
|
||||
virtual int addToFlatField(double etax, double etay) { return 0; };
|
||||
virtual int addToFlatFieldDistribution(double etax, double etay) { return 0; };
|
||||
|
||||
virtual int addToFlatField(double totquad, int quad, double *cl,
|
||||
double &etax, double &etay) {
|
||||
return 0;
|
||||
};
|
||||
/* virtual int addToFlatField(double totquad, int quad, double *cl, */
|
||||
/* double &etax, double &etay) { */
|
||||
/* return 0; */
|
||||
/* }; */
|
||||
|
||||
virtual int addToFlatField(double totquad, int quad, int *cl, double &etax,
|
||||
double &etay) {
|
||||
|
@ -175,29 +175,31 @@ class slsInterpolation {
|
||||
return hint;
|
||||
};
|
||||
|
||||
virtual int addToFlatField(double *cluster, double &etax, double &etay) = 0;
|
||||
virtual int addToFlatField(int *cluster, double &etax, double &etay) = 0;
|
||||
//virtual int addToFlatField(double *cluster, double &etax, double &etay) = 0;
|
||||
//virtual int addToFlatField(int *cluster, double &etax, double &etay) = 0;
|
||||
virtual int addToFlatField(double totquad, int quad, int *cl, double &etax,
|
||||
double &etay) = 0;
|
||||
virtual int addToFlatField(double totquad, int quad, double *cluster,
|
||||
double &etax, double &etay) = 0;
|
||||
virtual int addToFlatField(double etax, double etay) = 0;
|
||||
//virtual int addToFlatField(double totquad, int quad, double *cluster,
|
||||
// double &etax, double &etay) = 0;
|
||||
virtual int addToFlatFieldDistribution(double etax, double etay) = 0;
|
||||
|
||||
virtual int *getFlatField() { return NULL; };
|
||||
virtual int *setFlatField(int *h, int nb = -1, double emin = -1,
|
||||
virtual int *getFlatFieldDistribution() { return NULL; };
|
||||
virtual int *setFlatField(int *h, int nbx = -1, int nby = -1,
|
||||
double emin = -1,
|
||||
double emax = -1) {
|
||||
return NULL;
|
||||
};
|
||||
virtual void *writeFlatField(const char *imgname) { return NULL; };
|
||||
virtual void *readFlatField(const char *imgname, int nb = -1,
|
||||
double emin = 1, double emax = 0) {
|
||||
virtual void *readFlatField(const char *imgname,
|
||||
double emin = 1, double emax = 0) {
|
||||
return NULL;
|
||||
};
|
||||
virtual int *getFlatField(int &nb, double &emin, double &emax) {
|
||||
nb = 0;
|
||||
virtual int *getFlatField(int &nbx, int &nby, double &emin, double &emax) {
|
||||
nbx = 0;
|
||||
nby=0;
|
||||
emin = 0;
|
||||
emax = 0;
|
||||
return getFlatField();
|
||||
return getFlatFieldDistribution();
|
||||
};
|
||||
|
||||
virtual void resetFlatField() = 0;
|
||||
|
@ -47,7 +47,6 @@ int main(int argc, char *argv[]) {
|
||||
#endif
|
||||
int iarg = 4;
|
||||
char infname[10000];
|
||||
char fname[10000];
|
||||
char outfname[10000];
|
||||
#ifndef FF
|
||||
iarg = 4;
|
||||
@ -74,18 +73,17 @@ int main(int argc, char *argv[]) {
|
||||
int etabins = 1000; // nsubpix*2*100;
|
||||
double etamin = -1, etamax = 2;
|
||||
// double etamin=-0.1, etamax=1.1;
|
||||
double eta3min = -2, eta3max = 2;
|
||||
int quad;
|
||||
// double eta3min = -2, eta3max = 2;
|
||||
double sum, totquad;
|
||||
double sDum[2][2];
|
||||
double etax, etay, int_x, int_y;
|
||||
double eta3x, eta3y, int3_x, int3_y, noint_x, noint_y;
|
||||
int ok;
|
||||
int f0 = -1;
|
||||
double etax, etay;
|
||||
// double eta3x, eta3y, int3_x, int3_y, noint_x, noint_y;
|
||||
|
||||
int ix, iy, isx, isy;
|
||||
int nframes = 0, lastframe = -1;
|
||||
double d_x, d_y, res = 5, xx, yy;
|
||||
int nph = 0, badph = 0, totph = 0;
|
||||
//double d_x, d_y, res = 5, xx, yy;
|
||||
int nph = 0, totph = 0;
|
||||
//badph = 0,
|
||||
FILE *f = NULL;
|
||||
|
||||
#ifdef DOUBLE_SPH
|
||||
@ -96,7 +94,8 @@ int main(int argc, char *argv[]) {
|
||||
single_photon_hit cl(3, 3);
|
||||
#endif
|
||||
|
||||
int nSubPixels = nsubpix;
|
||||
//int f0 = -1;
|
||||
// int nSubPixels = nsubpix;
|
||||
#ifndef NOINTERPOLATION
|
||||
eta2InterpolationPosXY *interp =
|
||||
new eta2InterpolationPosXY(NC, NR, nsubpix, etabins, etamin, etamax);
|
||||
@ -109,7 +108,12 @@ int main(int argc, char *argv[]) {
|
||||
#endif
|
||||
|
||||
#ifndef FF
|
||||
int quad;
|
||||
#ifndef NOINTERPOLATION
|
||||
char fname[10000];
|
||||
int ok;
|
||||
double int_x, int_y;
|
||||
int *img;
|
||||
cout << "read ff " << argv[2] << endl;
|
||||
sprintf(fname, "%s", argv[2]);
|
||||
interp->readFlatField(fname);
|
||||
@ -121,7 +125,6 @@ int main(int argc, char *argv[]) {
|
||||
cout << "Will write eta file " << argv[2] << endl;
|
||||
#endif
|
||||
|
||||
int *img;
|
||||
float *totimg = new float[NC * NR * nsubpix * nsubpix];
|
||||
for (ix = 0; ix < NC; ix++) {
|
||||
for (iy = 0; iy < NR; iy++) {
|
||||
@ -149,7 +152,7 @@ int main(int argc, char *argv[]) {
|
||||
if (f) {
|
||||
cout << infname << endl;
|
||||
nframes = 0;
|
||||
f0 = -1;
|
||||
//f0 = -1;
|
||||
|
||||
while (cl.read(f)) {
|
||||
totph++;
|
||||
@ -157,14 +160,21 @@ int main(int argc, char *argv[]) {
|
||||
lastframe = cl.iframe;
|
||||
// cout << cl.iframe << endl;
|
||||
// f0=cl.iframe;
|
||||
if (nframes == 0)
|
||||
f0 = lastframe;
|
||||
// if (nframes == 0)
|
||||
// f0 = lastframe;
|
||||
nframes++;
|
||||
}
|
||||
// quad=interp->calcQuad(cl.get_cluster(), sum, totquad, sDum);
|
||||
#ifndef FF
|
||||
quad = interp->calcEta(cl.get_cluster(), etax, etay, sum,
|
||||
totquad, sDum);
|
||||
if (sum > cmin && totquad / sum > 0.8 && totquad / sum < 1.2 &&
|
||||
#endif
|
||||
#ifdef FF
|
||||
interp->calcEta(cl.get_cluster(), etax, etay, sum,
|
||||
totquad, sDum);
|
||||
#endif
|
||||
|
||||
if (sum > cmin && totquad / sum > 0.8 && totquad / sum < 1.2 &&
|
||||
sum < cmax) {
|
||||
nph++;
|
||||
// if (sum>200 && sum<580) {
|
||||
@ -199,7 +209,7 @@ int main(int argc, char *argv[]) {
|
||||
// if (cl.x>50)
|
||||
// #endif
|
||||
// if (etax!=0 && etay!=0 && etax!=1 && etay!=1)
|
||||
interp->addToFlatField(etax, etay);
|
||||
interp->addToFlatFieldDistribution(etax, etay);
|
||||
// if (etax==0 || etay==0) cout << cl.x << " " << cl.y <<
|
||||
// endl;
|
||||
|
||||
@ -242,9 +252,9 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
}
|
||||
}
|
||||
cout << "Read " << nframes << " frames (first frame: " << f0
|
||||
<< " last frame: " << lastframe << " delta:" << lastframe - f0
|
||||
<< ") nph=" << nph << endl;
|
||||
// cout << "Read " << nframes << " frames (first frame: " << f0
|
||||
// << " last frame: " << lastframe << " delta:" << lastframe - f0
|
||||
// << ") nph=" << nph << endl;
|
||||
interp->clearInterpolatedImage();
|
||||
#endif
|
||||
|
||||
|
@ -502,13 +502,13 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
#ifdef INTERP
|
||||
else if (fMode == eFlat) {
|
||||
int nb;
|
||||
int nbx, nby;
|
||||
double emi = 0, ema = 1;
|
||||
int *ff = mt->getFlatField(nb, emi, ema);
|
||||
nnx = nb;
|
||||
nny = nb;
|
||||
dout = new int32_t[nb * nb];
|
||||
for (int ix = 0; ix < nb * nb; ix++) {
|
||||
int *ff = mt->getFlatField(nbx, nby, emi, ema);
|
||||
nnx = nbx;
|
||||
nny = nby;
|
||||
dout = new int32_t[nbx * nby];
|
||||
for (int ix = 0; ix < nbx * nby; ix++) {
|
||||
dout[ix] = ff[ix];
|
||||
}
|
||||
}
|
||||
|
@ -182,10 +182,10 @@ class threadedAnalogDetector {
|
||||
interp->prepareInterpolation(ok);
|
||||
}
|
||||
|
||||
virtual int *getFlatField() {
|
||||
virtual int *getFlatFieldDistribution() {
|
||||
slsInterpolation *interp = (det)->getInterpolation();
|
||||
if (interp)
|
||||
return interp->getFlatField();
|
||||
return interp->getFlatFieldDistribution();
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
@ -208,19 +208,19 @@ class threadedAnalogDetector {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void *readFlatField(const char *imgname, int nb = -1, double emin = 1,
|
||||
void *readFlatField(const char *imgname, double emin = 1,
|
||||
double emax = 0) {
|
||||
slsInterpolation *interp = (det)->getInterpolation();
|
||||
if (interp)
|
||||
return interp->readFlatField(imgname, nb, emin, emax);
|
||||
return interp->readFlatField(imgname, emin, emax);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
virtual int *getFlatField(int &nb, double emi, double ema) {
|
||||
virtual int *getFlatField(int &nbx, int &nby, double &emi, double &ema) {
|
||||
slsInterpolation *interp = (det)->getInterpolation();
|
||||
int *ff = NULL;
|
||||
if (interp) {
|
||||
ff = interp->getFlatField(nb, emi, ema);
|
||||
ff = interp->getFlatField(nbx, nby, emi, ema);
|
||||
}
|
||||
return ff;
|
||||
}
|
||||
|
@ -25,10 +25,10 @@ class multiThreadedInterpolatingDetector
|
||||
// }
|
||||
}
|
||||
|
||||
virtual int *getFlatField() { return (dets[0])->getFlatField(); }
|
||||
virtual int *getFlatFieldDistribution() { return (dets[0])->getFlatFieldDistribution(); }
|
||||
|
||||
virtual int *getFlatField(int &nb, double emi, double ema) {
|
||||
return (dets[0])->getFlatField(nb, emi, ema);
|
||||
virtual int *getFlatField(int &nbx, int &nby, double &emi, double &ema) {
|
||||
return (dets[0])->getFlatField(nbx, nby, emi, ema);
|
||||
}
|
||||
|
||||
virtual int *setFlatField(int *h = NULL, int nb = -1, double emin = 1,
|
||||
@ -40,9 +40,9 @@ class multiThreadedInterpolatingDetector
|
||||
return dets[0]->writeFlatField(imgname);
|
||||
};
|
||||
|
||||
void *readFlatField(const char *imgname, int nb = -1, double emin = 1,
|
||||
void *readFlatField(const char *imgname, double emin = 1,
|
||||
double emax = 0) {
|
||||
return (dets[0])->readFlatField(imgname, nb, emin, emax);
|
||||
return (dets[0])->readFlatField(imgname, emin, emax);
|
||||
};
|
||||
|
||||
/* virtual int setNSubPixels(int ns) { return
|
||||
|
Binary file not shown.
Binary file not shown.
@ -43,7 +43,7 @@ enum DACINDEX {
|
||||
#define DAC_NAMES \
|
||||
"VSvP", "Vtrim", "Vrpreamp", "Vrshaper", "VSvN", "Vtgstv", "Vcmp_ll", \
|
||||
"Vcmp_lr", "Vcal", "Vcmp_rl", "rxb_rb", "rxb_lb", "Vcmp_rr", "Vcp", \
|
||||
"Vcn", "Vishaper"
|
||||
"Vcn", "Vishaper", "Vthreshold"
|
||||
#define DEFAULT_DAC_VALS \
|
||||
{ \
|
||||
0, /* VSvP */ \
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -480,9 +480,6 @@ void setupDetector() {
|
||||
setInitialExtSignals();
|
||||
// 10G UDP
|
||||
enableTenGigabitEthernet(1);
|
||||
#ifdef VIRTUAL
|
||||
enableTenGigabitEthernet(0);
|
||||
#endif
|
||||
getModuleIdInFile(&initError, initErrorMessage, ID_FILE);
|
||||
if (initError == FAIL) {
|
||||
return;
|
||||
|
@ -95,7 +95,7 @@ enum DACINDEX {
|
||||
#define DAC_NAMES \
|
||||
"vcassh", "vth2", "vrshaper", "vrshaper_n", "vipre_out", "vth3", "vth1", \
|
||||
"vicin", "vcas", "vrpreamp", "vcal_n", "vipre", "vishaper", "vcal_p", \
|
||||
"vtrim", "vdcsh"
|
||||
"vtrim", "vdcsh", "vthreshold"
|
||||
#define DEFAULT_DAC_VALS \
|
||||
{ \
|
||||
1200, /* casSh */ \
|
||||
|
@ -55,9 +55,11 @@ int64_t Listener::GetNumMissingPacket(bool stoppedFlag,
|
||||
|
||||
bool Listener::GetStartedFlag() { return startedFlag; }
|
||||
|
||||
uint64_t Listener::GetCurrentFrameIndex() { return currentFrameIndex; }
|
||||
uint64_t Listener::GetCurrentFrameIndex() { return lastCaughtFrameIndex; }
|
||||
|
||||
uint64_t Listener::GetListenedIndex() { return currentFrameIndex - firstIndex; }
|
||||
uint64_t Listener::GetListenedIndex() {
|
||||
return lastCaughtFrameIndex - firstIndex;
|
||||
}
|
||||
|
||||
void Listener::SetFifo(Fifo *f) { fifo = f; }
|
||||
|
||||
@ -88,6 +90,7 @@ void Listener::ResetParametersforNewAcquisition() {
|
||||
void Listener::RecordFirstIndex(uint64_t fnum) {
|
||||
// listen to this fnum, later +1
|
||||
currentFrameIndex = fnum;
|
||||
lastCaughtFrameIndex = fnum;
|
||||
|
||||
startedFlag = true;
|
||||
firstIndex = fnum;
|
||||
|
@ -563,6 +563,8 @@ enum streamingInterface {
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
|
||||
//operators needed in ToString
|
||||
inline slsDetectorDefs::streamingInterface
|
||||
operator|(const slsDetectorDefs::streamingInterface &a,
|
||||
const slsDetectorDefs::streamingInterface &b) {
|
||||
@ -576,6 +578,9 @@ operator&(const slsDetectorDefs::streamingInterface &a,
|
||||
return slsDetectorDefs::streamingInterface(static_cast<int32_t>(a) &
|
||||
static_cast<int32_t>(b));
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -6,10 +6,10 @@
|
||||
#define APIRECEIVER 0x211124
|
||||
#define APIGUI 0x211124
|
||||
|
||||
#define APICTB 0x220131
|
||||
#define APIGOTTHARD 0x220131
|
||||
#define APIGOTTHARD2 0x220131
|
||||
#define APIJUNGFRAU 0x220131
|
||||
#define APIMYTHEN3 0x220131
|
||||
#define APIMOENCH 0x220131
|
||||
#define APIEIGER 0x220131
|
||||
#define APICTB 0x220203
|
||||
#define APIGOTTHARD 0x220203
|
||||
#define APIGOTTHARD2 0x220203
|
||||
#define APIJUNGFRAU 0x220203
|
||||
#define APIMYTHEN3 0x220203
|
||||
#define APIMOENCH 0x220202
|
||||
#define APIEIGER 0x220203
|
||||
|
Loading…
x
Reference in New Issue
Block a user