including stride and block for selecting hyperslab

This commit is contained in:
2022-02-07 14:01:19 +01:00
parent 20f3fb19af
commit f228fde6f7
2 changed files with 24 additions and 7 deletions

View File

@ -213,8 +213,9 @@ void DataProcessor::CreateVirtualFile(
if (virtualFile_) { if (virtualFile_) {
delete virtualFile_; delete virtualFile_;
} }
gotthard25um = ((detectorType_ == GOTTHARD || detectorType_ == GOTTHARD2) && bool gotthard25um =
(numModX * numModY) == 2); ((detectorType_ == GOTTHARD || detectorType_ == GOTTHARD2) &&
(numModX * numModY) == 2);
virtualFile_ = new HDF5VirtualFile(hdf5Lib, gotthard25um); virtualFile_ = new HDF5VirtualFile(hdf5Lib, gotthard25um);
uint64_t numImagesProcessed = GetProcessedIndex() + 1; uint64_t numImagesProcessed = GetProcessedIndex() + 1;

View File

@ -103,19 +103,35 @@ void HDF5VirtualFile::CreateVirtualFile(
((numImagesCaught - framesSaved) > maxFramesPerFile) ((numImagesCaught - framesSaved) > maxFramesPerFile)
? maxFramesPerFile ? maxFramesPerFile
: (numImagesCaught - framesSaved); : (numImagesCaught - framesSaved);
// starting location
hsize_t start[3] = {framesSaved, 0, 0}; hsize_t start[3] = {framesSaved, 0, 0};
hsize_t count[3] = {nDimx, nDimy, nDimz}; // number of elements separating each block
hsize_t stride[3] = {1, 1, 1};
// number of blocks
hsize_t count[3] = {1, 1, 1};
// block size
hsize_t block[3] = {nDimx, nDimy, nDimz};
// starting location
hsize_t startPara[2] = {framesSaved, 0}; hsize_t startPara[2] = {framesSaved, 0};
hsize_t countPara[2] = {nDimx, 1}; // number of elements separating each block
// loop through readouts hsize_t stridePara[3] = {1, 1};
// number of blocks
hsize_t countPara[2] = {1, 1};
// block size
hsize_t blockPara[3] = {nDimx, 1};
// loop through readouts (image)
for (unsigned int i = 0; i < numModY * numModZ; ++i) { for (unsigned int i = 0; i < numModY * numModZ; ++i) {
// setect data hyperslabs // setect data hyperslabs
vdsDataSpace.selectHyperslab(H5S_SELECT_SET, count, start); vdsDataSpace.selectHyperslab(H5S_SELECT_SET, count, start,
stride, block);
// select parameter hyperslabs // select parameter hyperslabs
vdsDataSpacePara.selectHyperslab(H5S_SELECT_SET, countPara, vdsDataSpacePara.selectHyperslab(H5S_SELECT_SET, countPara,
startPara); startPara, stridePara,
blockPara);
// source file name // source file name
std::ostringstream os; std::ostringstream os;