diff --git a/slsDetectorCalibration/eigerHalfModuleData.h b/slsDetectorCalibration/eigerHalfModuleData.h index 1c878af8c..f81426bde 100644 --- a/slsDetectorCalibration/eigerHalfModuleData.h +++ b/slsDetectorCalibration/eigerHalfModuleData.h @@ -81,6 +81,57 @@ public: }; + /** + + Returns the value of the selected channel for the given dataset. Virtual function, can be overloaded. + \param data pointer to the dataset (including headers etc) + \param ix pixel number in the x direction + \param iy pixel number in the y direction + \param dr dynamic range + \returns data for the selected channel, with inversion if required + + */ + virtual dataType getChannel(char *data, int ix, int iy=0, int dr=0) { + dataType m=0, d=0; + uint64_t t; + int numBytes,divFactor,newix,pixelval; + + + if (ix>=0 && ix=0 && iy=0 && dataMap[iy][ix]> (pixelval*4); cout <<"value:"<< value << endl; + return ((t >> (pixelval*4)) & 0xf)^m; + else if(dr == 8) + //uint8_t value = t >> (pixelval*8); cout <<"value:"<< value << endl; + return ((t >> (pixelval*8)) & 0xff)^m; + else if(dr == 16){ + //uint16_t value = t >> (pixelval*16); cout <<"value:"<< value << endl; + return ((t >> (pixelval*16)) & 0xffff)^m; + }else{ + //uint32_t value = t >> (pixelval*32); cout <<"value:"<< value << endl; + return ((t >> (pixelval*32)) & 0xffffffff)^m; + } + }; + /** Returns the frame number for the given dataset. \param buff pointer to the dataset @@ -91,6 +142,12 @@ public: }; + + + + + + /** gets the packets number (last packet is labelled with 0 and is replaced with 40) \param buff pointer to the memory \returns packet number diff --git a/slsDetectorCalibration/slsDetectorData.h b/slsDetectorCalibration/slsDetectorData.h index 04ddc43d5..f5e42022c 100644 --- a/slsDetectorCalibration/slsDetectorData.h +++ b/slsDetectorCalibration/slsDetectorData.h @@ -18,7 +18,8 @@ class slsDetectorData { int **dataMap; /**< Array of size nx*ny storing the pointers to the data in the dataset (as offset)*/ dataType **dataMask; /**< Array of size nx*ny storing the polarity of the data in the dataset (should be 0 if no inversion is required, 0xffffffff is inversion is required) */ int **dataROIMask; /**< Array of size nx*ny 1 if channel is good (or in the ROI), 0 if bad channel (or out of ROI) */ - + int *xmap; + int *ymap; public: @@ -55,7 +56,9 @@ class slsDetectorData { for (int j=0; j=0 && ix=0 && iy=0 && dataMap[iy][ix]=0 && ix=0 && iy=0 && dataMap[iy][ix]> (pixelval*4); cout <<"value:"<< value << endl; - return ((t >> (pixelval*4)) & 0xf)^m; - else if(dr == 8) - //uint8_t value = t >> (pixelval*8); cout <<"value:"<< value << endl; - return ((t >> (pixelval*8)) & 0xff)^m; - else if(dr == 16){ - //uint16_t value = t >> (pixelval*16); cout <<"value:"<< value << endl; - return ((t >> (pixelval*16)) & 0xffff)^m; - }else{ - //uint32_t value = t >> (pixelval*32); cout <<"value:"<< value << endl; - return ((t >> (pixelval*32)) & 0xffffffff)^m; - } - }; - /** Returns the value of the selected channel for the given dataset as double.