Skip to content

Commit

Permalink
Undo changes to LoadBankFromDiskTask
Browse files Browse the repository at this point in the history
  • Loading branch information
peterfpeterson committed Jan 17, 2025
1 parent 9a3c697 commit e0f0ffe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ class MANTID_DATAHANDLING_DLL LoadBankFromDiskTask : public Kernel::Task {

void run() override;

// this is public for other things to use
static int64_t recalculateDataSize(const int64_t size);

private:
void loadPulseTimes(::NeXus::File &file);
std::unique_ptr<std::vector<uint64_t>> loadEventIndex(::NeXus::File &file);
Expand All @@ -46,6 +43,7 @@ class MANTID_DATAHANDLING_DLL LoadBankFromDiskTask : public Kernel::Task {
std::unique_ptr<std::vector<uint32_t>> loadEventId(::NeXus::File &file);
std::unique_ptr<std::vector<float>> loadTof(::NeXus::File &file);
std::unique_ptr<std::vector<float>> loadEventWeights(::NeXus::File &file);
int64_t recalculateDataSize(const int64_t size);

/// Algorithm being run
DefaultEventLoader &m_loader;
Expand Down
8 changes: 6 additions & 2 deletions Framework/DataHandling/src/LoadBankFromDiskTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,14 @@ std::unique_ptr<std::vector<float>> LoadBankFromDiskTask::loadTof(::NeXus::File
// Get the list of event_time_of_flight's
file.openData(m_timeOfFlightFieldName);

// This is the data size
::NeXus::Info id_info = file.getInfo();
const int64_t dim0 = recalculateDataSize(id_info.dims[0]);

// Check that the required space is there in the file.
::NeXus::Info tof_info = file.getInfo();
int64_t dim0 = recalculateDataSize(tof_info.dims[0]);
if (dim0 < m_loadSize[0] + m_loadStart[0]) {
int64_t tof_dim0 = recalculateDataSize(tof_info.dims[0]);
if (tof_dim0 < m_loadSize[0] + m_loadStart[0]) {
m_loader.alg->getLogger().warning() << "Entry " << entry_name
<< "'s event_time_offset field is too small "
"to load the desired data.\n";
Expand Down

0 comments on commit e0f0ffe

Please sign in to comment.