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