mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-18 07:47:12 +02:00
Jf strixelmap with roi (#715)
* Fix ROI mapping, Formatting, Minor edit --------- Co-authored-by: vhinger182 <viktoria.hinger@psi.ch> Co-authored-by: vhinger182 <hinger_v@hv_home_lt1.localdomain>
This commit is contained in:
@ -74,7 +74,7 @@ namespace strixelSingleChip {
|
|||||||
constexpr int c6g1_yend = c6g2_yend + 64 - gr; //502
|
constexpr int c6g1_yend = c6g2_yend + 64 - gr; //502
|
||||||
|
|
||||||
//y shift due to faulty bonding (relevant for M408)
|
//y shift due to faulty bonding (relevant for M408)
|
||||||
constexpr int bond_shift_y = 0; //CHANGE IF YOU CHANGE MODULE!
|
constexpr int bond_shift_y = 1; //CHANGE IF YOU CHANGE MODULE!
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,21 +126,21 @@ class jungfrauLGADStrixelsData : public slsDetectorData<uint16_t> {
|
|||||||
x0 = 10+chip_x0; //9 gr + 1 sq pixel
|
x0 = 10+chip_x0; //9 gr + 1 sq pixel
|
||||||
x1 = 246+chip_x0;
|
x1 = 246+chip_x0;
|
||||||
y0 = 9+chip_y0;
|
y0 = 9+chip_y0;
|
||||||
y1 = 64+chip_y0;
|
y1 = 63+chip_y0;
|
||||||
shifty = 0;
|
shifty = 0;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
x0 = 12+chip_x0;
|
x0 = 12+chip_x0;
|
||||||
x1 = 247+chip_x0;
|
x1 = 247+chip_x0;
|
||||||
y0 = 64+chip_y0;
|
y0 = 64+chip_y0;
|
||||||
y1 = 128+chip_y0;
|
y1 = 127+chip_y0;
|
||||||
shifty = g1_nrows;
|
shifty = g1_nrows;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
x0 = 11+chip_x0;
|
x0 = 11+chip_x0;
|
||||||
x1 = 247+chip_x0;
|
x1 = 247+chip_x0;
|
||||||
y0 = 128+chip_y0;
|
y0 = 128+chip_y0;
|
||||||
y1 = 247+chip_y0;
|
y1 = 246+chip_y0;
|
||||||
shifty = g2_nrows+g1_nrows;
|
shifty = g2_nrows+g1_nrows;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -240,9 +240,9 @@ class jungfrauLGADStrixelsData : public slsDetectorData<uint16_t> {
|
|||||||
for ( int ipy=y0; ipy<=y1; ++ipy) {
|
for ( int ipy=y0; ipy<=y1; ++ipy) {
|
||||||
for ( int ipx=x0; ipx<=x1; ++ipx ) {
|
for ( int ipx=x0; ipx<=x1; ++ipx ) {
|
||||||
|
|
||||||
ix = int ((ipx-x0-xmin)/multiplicator);
|
ix = int ((ipx-x0/*-xmin*/)/multiplicator);
|
||||||
for ( int m=0; m<multiplicator;m++ ) {
|
for ( int m=0; m<multiplicator;m++ ) {
|
||||||
if ( (ipx-x0-xmin)%multiplicator==m ) iy=(ipy-y0-ymin)*multiplicator +m + shifty;
|
if ( (ipx-x0/*-xmin*/)%multiplicator==m ) iy=(ipy-y0/*-ymin*/)*multiplicator +m + shifty;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (iy< 40) cout << iy << " " << ix <<endl;
|
// if (iy< 40) cout << iy << " " << ix <<endl;
|
||||||
|
@ -38,21 +38,21 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
using namespace std;
|
//using namespace std;
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
if (argc < 5) {
|
if (argc < 5) {
|
||||||
cout << "Usage is " << argv[0]
|
std::cout << "Usage is " << argv[0]
|
||||||
<< "indir outdir fname(no extension) fextension [runmin] [runmax] [pedfile (raw or tiff)] [threshold] "
|
<< "indir outdir fname(with formatting, no extension) fextension [runmin] [runmax] [pedfile (raw or tiff)] [threshold] "
|
||||||
"[nframes] [xmin xmax ymin ymax] [gainmap]"
|
"[nframes] [xmin xmax ymin ymax] [gainmap]"
|
||||||
<< endl;
|
<< std::endl;
|
||||||
cout << "threshold <0 means analog; threshold=0 means cluster finder; "
|
std::cout << "threshold <0 means analog; threshold=0 means cluster finder; "
|
||||||
"threshold>0 means photon counting"
|
"threshold>0 means photon counting"
|
||||||
<< endl;
|
<< std::endl;
|
||||||
cout << "nframes <0 means sum everything; nframes=0 means one file per "
|
std::cout << "nframes <0 means sum everything; nframes=0 means one file per "
|
||||||
"run; nframes>0 means one file every nframes"
|
"run; nframes>0 means one file every nframes"
|
||||||
<< endl;
|
<< std::endl;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,6 +151,10 @@ int main(int argc, char *argv[]) {
|
|||||||
if ( filebin.read( (char *)&hbuffer, sizeof(header) ) ) {
|
if ( filebin.read( (char *)&hbuffer, sizeof(header) ) ) {
|
||||||
memcpy(&croi, &hbuffer.detHeader.detSpec1, 8);
|
memcpy(&croi, &hbuffer.detHeader.detSpec1, 8);
|
||||||
std::cout << "Read ROI [" << croi.xmin << ", " << croi.xmax << ", " << croi.ymin << ", " << croi.ymax << "]" << std::endl;
|
std::cout << "Read ROI [" << croi.xmin << ", " << croi.xmax << ", " << croi.ymin << ", " << croi.ymax << "]" << std::endl;
|
||||||
|
xxmin = croi.xmin;
|
||||||
|
xxmax = croi.xmax;
|
||||||
|
yymin = croi.ymin;
|
||||||
|
yymax = croi.ymax;
|
||||||
} else
|
} else
|
||||||
std::cout << "reading error" << std::endl;
|
std::cout << "reading error" << std::endl;
|
||||||
filebin.close();
|
filebin.close();
|
||||||
@ -158,7 +162,7 @@ int main(int argc, char *argv[]) {
|
|||||||
std::cout << "Could not open " << fname << " for reading " << std::endl;
|
std::cout << "Could not open " << fname << " for reading " << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
jungfrauLGADStrixelsData *decoder = new jungfrauLGADStrixelsData( croi.xmin, croi.xmax, croi.ymin, croi.ymax );
|
jungfrauLGADStrixelsData *decoder = new jungfrauLGADStrixelsData( xxmin, xxmax, yymin, yymax );
|
||||||
int nx = 1024/3, ny = 512*5;
|
int nx = 1024/3, ny = 512*5;
|
||||||
#endif
|
#endif
|
||||||
#ifdef JFSTRXCHIP1
|
#ifdef JFSTRXCHIP1
|
||||||
@ -231,7 +235,7 @@ int main(int argc, char *argv[]) {
|
|||||||
//int dsize = decoder->getDataSize();
|
//int dsize = decoder->getDataSize();
|
||||||
|
|
||||||
if (thr > 0) {
|
if (thr > 0) {
|
||||||
cout << "threshold is " << thr << endl;
|
std::cout << "threshold is " << thr << std::endl;
|
||||||
filter->setThreshold(thr);
|
filter->setThreshold(thr);
|
||||||
cf = 0;
|
cf = 0;
|
||||||
|
|
||||||
@ -287,7 +291,7 @@ int main(int argc, char *argv[]) {
|
|||||||
froot[pos]='\0';
|
froot[pos]='\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
cout << "PEDESTAL " << endl;
|
std::cout << "PEDESTAL " << std::endl;
|
||||||
// sprintf(imgfname, "%s/pedestals.tiff", outdir);
|
// sprintf(imgfname, "%s/pedestals.tiff", outdir);
|
||||||
|
|
||||||
if (string(pedfile).find(".tif") == std::string::npos) {
|
if (string(pedfile).find(".tif") == std::string::npos) {
|
||||||
|
Reference in New Issue
Block a user