mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-24 23:30:03 +02:00
added xmap and ymap in moench02Ctb.h
This commit is contained in:
parent
22ba839ad5
commit
0841467dc9
@ -9,10 +9,15 @@ class moench02CtbData : public slsDetectorData<uint16_t> {
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
int iframe;
|
int iframe;
|
||||||
int *xmap, *ymap;
|
// int *xmap, *ymap;
|
||||||
int nadc;
|
int nadc;
|
||||||
int sc_width;
|
int sc_width;
|
||||||
int sc_height;
|
int sc_height;
|
||||||
|
|
||||||
|
int maplength;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
||||||
@ -29,34 +34,55 @@ class moench02CtbData : public slsDetectorData<uint16_t> {
|
|||||||
moench02CtbData(int ns=6400): slsDetectorData<uint16_t>(160, 160, ns*2*32, NULL, NULL) , nadc(4), sc_width(40), sc_height(160) {
|
moench02CtbData(int ns=6400): slsDetectorData<uint16_t>(160, 160, ns*2*32, NULL, NULL) , nadc(4), sc_width(40), sc_height(160) {
|
||||||
|
|
||||||
|
|
||||||
int adc_nr[4]={0,40,40,120};
|
int adc_nr[4]={120,0,80,40};
|
||||||
int row, col;
|
int row, col;
|
||||||
|
|
||||||
int isample;
|
int isample;
|
||||||
int iadc;
|
int iadc;
|
||||||
int ix, iy;
|
int ix, iy;
|
||||||
|
maplength=this->getDataSize()/2;
|
||||||
|
cerr<<"Map Array Length: "<<maplength<<endl;
|
||||||
|
|
||||||
|
|
||||||
for (iadc=0; iadc<nadc; iadc++) {
|
for (iadc=0; iadc<nadc; iadc++) {
|
||||||
for (int i=0; i<sc_width*sc_height; i++) {
|
for (int i=0; i<sc_width*sc_height; i++) {
|
||||||
col=adc_nr[iadc]+(i%sc_width);
|
col=adc_nr[iadc]+(i%sc_width);
|
||||||
row=i/sc_width;
|
row=i/sc_width;
|
||||||
dataMap[row][col]=(32*i+iadc)*2;
|
dataMap[row][col]=(32*i+iadc+2)*2;
|
||||||
if (dataMap[row][col]<0 || dataMap[row][col]>=dataSize) {
|
if (dataMap[row][col]<0 || dataMap[row][col]>=dataSize) {
|
||||||
cout << "Error: pointer " << dataMap[row][col] << " out of range "<< endl;
|
cout << "Error: pointer " << dataMap[row][col] << " out of range "<< endl;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i=0; i<maplength; i++) {
|
||||||
|
isample=i/32;
|
||||||
|
iadc=i%32;
|
||||||
|
ix=isample%sc_width;
|
||||||
|
iy=isample/sc_width;
|
||||||
|
if(iadc>1 && iadc<6){
|
||||||
|
xmap[i]=adc_nr[iadc-2]+ix;
|
||||||
|
ymap[i]=iy;
|
||||||
|
}else{
|
||||||
|
xmap[i]=-1;
|
||||||
|
ymap[i]=-1;
|
||||||
|
}
|
||||||
|
}
|
||||||
iframe=0;
|
iframe=0;
|
||||||
// cout << "data struct created" << endl;
|
// cout << "data struct created" << endl;
|
||||||
};
|
};
|
||||||
|
|
||||||
void getPixel(int ip, int &x, int &y) {if (ip>=0 && ip<nx*ny) {x=xmap[ip]; y=ymap[ip];}};
|
void getPixel(int ip, int &x, int &y) {
|
||||||
|
if(ip>=0 && ip<maplength){
|
||||||
|
x=xmap[ip];
|
||||||
|
y=ymap[ip];
|
||||||
|
}else{
|
||||||
|
cerr<<"WRONG ARRAY LENGTH"<<endl;
|
||||||
|
cerr<<"Trying to access the "<<ip<<"-th element"<<endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -43,6 +43,7 @@ class slsDetectorData {
|
|||||||
xmap=new int[dsize/sizeof(dataType)];
|
xmap=new int[dsize/sizeof(dataType)];
|
||||||
ymap=new int[dsize/sizeof(dataType)];
|
ymap=new int[dsize/sizeof(dataType)];
|
||||||
|
|
||||||
|
|
||||||
dataMask=new dataType*[ny];
|
dataMask=new dataType*[ny];
|
||||||
for(int i = 0; i < ny; i++) {
|
for(int i = 0; i < ny; i++) {
|
||||||
dataMask[i] = new dataType[nx];
|
dataMask[i] = new dataType[nx];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user