From afbc414afeebaabdc4580cf8203fcd810490ff0b Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Thu, 17 Mar 2022 13:08:40 +0100 Subject: [PATCH] works for both g25 and normal --- slsReceiverSoftware/src/HDF5VirtualFile.cpp | 26 +++++++++++++++------ 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/slsReceiverSoftware/src/HDF5VirtualFile.cpp b/slsReceiverSoftware/src/HDF5VirtualFile.cpp index 519dfe1f0..03ab02008 100644 --- a/slsReceiverSoftware/src/HDF5VirtualFile.cpp +++ b/slsReceiverSoftware/src/HDF5VirtualFile.cpp @@ -104,8 +104,10 @@ void HDF5VirtualFile::CreateVirtualFile( ? maxFramesPerFile : (numImagesCaught - framesSaved); + // starting location + hsize_t start[3] = {framesSaved, 0, 0}; // number of elements separating each block - hsize_t stride[3] = {1, 1, 2}; + hsize_t stride[3] = {1, 1, 1}; // number of blocks hsize_t count[3] = {nDimx, nDimy, nDimz}; // block size @@ -120,11 +122,18 @@ void HDF5VirtualFile::CreateVirtualFile( // block size hsize_t blockPara[3] = {nDimx, 1}; + // interleaving for g2 + if (gotthard25um) { + stride[2] = 2; + } + // loop through readouts (image) for (unsigned int i = 0; i < numModY * numModZ; ++i) { - // starting location - hsize_t start[3] = {framesSaved, 0, i}; + // interleaving for g2 + if (gotthard25um) { + start[2] = i; + } // setect data hyperslabs vdsDataSpace.selectHyperslab(H5S_SELECT_SET, count, start, @@ -183,10 +192,13 @@ void HDF5VirtualFile::CreateVirtualFile( // H5Sclose(srcDataspace); // H5Sclose(srcDataspace_para); - start[2] += nDimz; - if (start[2] >= (numModZ * nDimz)) { - start[2] = 0; - start[1] += nDimy; + + if (!gotthard25um) { + start[2] += nDimz; + if (start[2] >= (numModZ * nDimz)) { + start[2] = 0; + start[1] += nDimy; + } } startPara[1]++; }