diff --git a/CMakeLists.txt b/CMakeLists.txt index fabade50..ed6a38d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ if (CMAKE_VERSION GREATER_EQUAL "3.3") cmake_policy(SET CMP0167 NEW) endif () -project(musrfit VERSION 1.11.2 LANGUAGES C CXX) +project(musrfit VERSION 1.11.3 LANGUAGES C CXX) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) diff --git a/ChangeLog b/ChangeLog index 080ef98f..663c3fbf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,12 @@ or https://bitbucket.org/muonspin/musrfit +Release of V1.11.3, 2026/07/15 +============================== + +Add Red/Green mode handling for NeXus, especially HDF5 IDF V2. Offset between the +routed histograms is 10000 (for LEM it is 20). + Release of V1.11.2, 2026/06/27 ============================== diff --git a/src/include/PRunDataHandler.h b/src/include/PRunDataHandler.h index 203beaf7..fa2fa2c8 100644 --- a/src/include/PRunDataHandler.h +++ b/src/include/PRunDataHandler.h @@ -865,7 +865,7 @@ Bool_t PRunDataHandler::ReadNexusFileIdf2(T& nxs_file) // data with its metadata if (nxs_file->HasDataset("/raw_data_1/instrument/detector_1/counts")) { - int t0_bin{-1}, fgb{-1}, lgb{-1}, noOfHistos{-1}, histoLength{-1}; + int t0_bin{-1}, fgb{-1}, lgb{-1}, noOfPeriods{-1}, noOfHistos{-1}, histoLength{-1}; auto count_ds = nxs_file->template GetDataset("/raw_data_1/instrument/detector_1/counts"); auto count = count_ds.GetData(); auto dims = count_ds.GetDimensions(); @@ -873,6 +873,7 @@ Bool_t PRunDataHandler::ReadNexusFileIdf2(T& nxs_file) std::cerr << std::endl << "**ERROR** PNeXus data dimension error! dims.size()=" << dims.size() << ", expecting == 3." << std::endl; return false; } + noOfPeriods = dims[0]; noOfHistos = dims[1]; histoLength = dims[2]; // get all necessary attributes @@ -882,24 +883,26 @@ Bool_t PRunDataHandler::ReadNexusFileIdf2(T& nxs_file) fgb = std::any_cast(count_ds.GetAttribute("first_good_bin")); if (count_ds.HasAttribute("last_good_bin")) lgb = std::any_cast(count_ds.GetAttribute("last_good_bin")); - if (static_cast(count.size()) != noOfHistos*histoLength) { - std::cerr << std::endl << "**ERROR** PNeXus data size error! count.size()=" << count.size() << ", #histos=" << noOfHistos << ", length=" << histoLength << "." << std::endl; + if (static_cast(count.size()) != noOfPeriods*noOfHistos*histoLength) { + std::cerr << std::endl << "**ERROR** PNeXus data size error! count.size()=" << count.size() << ", #periods=" << noOfPeriods << ", #histos=" << noOfHistos << ", length=" << histoLength << "." << std::endl; return false; } // fill dataSet PDoubleVector data; - for (int i=0; i