From 5caf1966fb36122407b72331c48e80930d07bcdc Mon Sep 17 00:00:00 2001 From: Kirsty Paton Date: Mon, 22 Jan 2024 14:20:25 +0100 Subject: [PATCH] Introduced changes apply common mode correction - temporarily commented out along with other earlier changes to try an understand segmentation fault after one file processed. --- .../jungfrauRawDataProcess.cpp | 17 +++++++++++++---- slsDetectorCalibration/tiffio/src/tiffIO.cpp | 3 ++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/slsDetectorCalibration/jungfrauExecutables/jungfrauRawDataProcess.cpp b/slsDetectorCalibration/jungfrauExecutables/jungfrauRawDataProcess.cpp index 8eb5f9844..2cd64be9e 100644 --- a/slsDetectorCalibration/jungfrauExecutables/jungfrauRawDataProcess.cpp +++ b/slsDetectorCalibration/jungfrauExecutables/jungfrauRawDataProcess.cpp @@ -2,8 +2,12 @@ // Copyright (C) 2021 Contributors to the SLS Detector Package //#include "sls/ansi.h" #include -#undef CORR +//enable common mode subtraction +//#define CMS +//disable common mode subtraction +//#undef CMS +#undef CORR #define C_GHOST 0.0004 #define CM_ROWS 50 @@ -36,6 +40,7 @@ #include #include #include +//#include "jungfrauCommonMode.h" #include using namespace std; @@ -44,7 +49,7 @@ int main(int argc, char *argv[]) { if (argc < 6) { cout << "Usage is " << argv[0] - << "indir outdir fname(no extension) fextension csize [runmin] [runmax] [pedfile (raw or tiff)] [threshold]" + << " indir outdir fname(no extension) fextension csize [runmin] [runmax] [pedfile (raw or tiff)] [threshold]" "[nframes] [xmin xmax ymin ymax] [gainmap]" << endl; cout << "threshold <0 means analog; threshold=0 means cluster finder; " @@ -81,7 +86,7 @@ int main(int argc, char *argv[]) { cout << "Jungfrau strixel full module readout" << endl; jungfrauLGADStrixelsData *decoder = new jungfrauLGADStrixelsData(); int nx = 1024/5, ny = 512*5; -#endif +#endif #ifdef JFSTRXCHIP1 std::cout << "Jungfrau strixel LGAD single chip 1" << std::endl; jungfrauLGADStrixelsDataSingleChip *decoder = new jungfrauLGADStrixelsDataSingleChip(1); @@ -179,7 +184,11 @@ int main(int argc, char *argv[]) { cout << "Nframes is " << nframes << endl; uint32_t nnx, nny; - +// commonModeSubtraction *cm = NULL; +//#ifdef CMS +// cm = new commonModeSubtractionSuperColumnJF(); +// std::cout << "Enabled common mode subtraction" << std::endl; +//#endif singlePhotonDetector *filter = new singlePhotonDetector( decoder, 3, nsigma, 1, NULL, nped, 200, -1, -1, gainmap, NULL); diff --git a/slsDetectorCalibration/tiffio/src/tiffIO.cpp b/slsDetectorCalibration/tiffio/src/tiffIO.cpp index 0aa5cc786..6347ac3e3 100644 --- a/slsDetectorCalibration/tiffio/src/tiffIO.cpp +++ b/slsDetectorCalibration/tiffio/src/tiffIO.cpp @@ -3,7 +3,8 @@ #include "sls/tiffIO.h" #include -#include +#include "/usr/include/tiffio.h" +//#include void *WriteToTiff(float *imgData, const char *imgname, int ncol, int nrow) { constexpr uint32_t sampleperpixel = 1;