From 8c8060f30563bce06f0daaa6ec82c43e79e0c327 Mon Sep 17 00:00:00 2001 From: Vickie Lynch <lynchve@ornl.gov> Date: Wed, 3 May 2017 11:18:44 -0400 Subject: [PATCH] Refs #19478 option for h5 file --- MantidQt/CustomInterfaces/src/MantidEV.cpp | 2 +- scripts/SCD_Reduction/ReduceSCD_OneRun.py | 20 +++++++++++--------- scripts/SCD_Reduction/ReduceSCD_Parallel.py | 13 ++++++++----- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/MantidQt/CustomInterfaces/src/MantidEV.cpp b/MantidQt/CustomInterfaces/src/MantidEV.cpp index 2eb775c44f5..6d0a080f76e 100644 --- a/MantidQt/CustomInterfaces/src/MantidEV.cpp +++ b/MantidQt/CustomInterfaces/src/MantidEV.cpp @@ -638,7 +638,7 @@ void MantidEV::loadEventFile_slot() { QString file_path = getFilePath(last_event_file); QString Qfile_name = QFileDialog::getOpenFileName(this, tr("Load event file"), file_path, - tr("Nexus Files (*.nxs);; All files(*)")); + tr("Nexus Files (*.nxs *.h5);; All files(*)")); if (Qfile_name.length() > 0) { m_uiForm.EventFileName_ledt->setText(Qfile_name); diff --git a/scripts/SCD_Reduction/ReduceSCD_OneRun.py b/scripts/SCD_Reduction/ReduceSCD_OneRun.py index 46015e45642..53d327913ef 100644 --- a/scripts/SCD_Reduction/ReduceSCD_OneRun.py +++ b/scripts/SCD_Reduction/ReduceSCD_OneRun.py @@ -125,9 +125,11 @@ optimize_UB = params_dictionary[ "optimize_UB" ] # Get the fully qualified input run file name, either from a specified data # directory or from findnexus # -short_filename = "%s_%s_event.nxs" % (instrument_name, str(run)) +short_filename = "%s_%s" % (instrument_name, str(run)) if data_directory is not None: - full_name = data_directory + "/" + short_filename + full_name = data_directory + "/" + short_filename + ".nxs.h5" + if not os.path.exists(full_name): + full_name = data_directory + "/" + short_filename + "_event.nxs" else: candidates = FileFinder.findRuns(short_filename) full_name = "" @@ -135,7 +137,7 @@ else: if os.path.exists(item): full_name = str(item) - if not full_name.endswith('nxs'): + if not full_name.endswith('nxs') and not full_name.endswith('h5'): print("Exiting since the data_directory was not specified and") print("findnexus failed for event NeXus file: " + instrument_name + " " + str(run)) exit(0) @@ -362,12 +364,12 @@ else: CellType=cell_type, Centering=centering, AllowPermutations=allow_perm, Apply=True, Tolerance=tolerance ) - if output_nexus: - SaveNexus(InputWorkspace=peaks_ws, Filename=run_conventional_integrate_file ) - else: - SaveIsawPeaks(InputWorkspace=peaks_ws, AppendFile=False, - Filename=run_conventional_integrate_file ) - SaveIsawUB(InputWorkspace=peaks_ws, Filename=run_conventional_matrix_file ) + if output_nexus: + SaveNexus(InputWorkspace=peaks_ws, Filename=run_conventional_integrate_file ) + else: + SaveIsawPeaks(InputWorkspace=peaks_ws, AppendFile=False, + Filename=run_conventional_integrate_file ) + SaveIsawUB(InputWorkspace=peaks_ws, Filename=run_conventional_matrix_file ) end_time = time.time() print('\nReduced run ' + str(run) + ' in ' + str(end_time - start_time) + ' sec') diff --git a/scripts/SCD_Reduction/ReduceSCD_Parallel.py b/scripts/SCD_Reduction/ReduceSCD_Parallel.py index 3e9b2bbdd77..193dbc1e7b2 100644 --- a/scripts/SCD_Reduction/ReduceSCD_Parallel.py +++ b/scripts/SCD_Reduction/ReduceSCD_Parallel.py @@ -168,20 +168,23 @@ first_time = True if output_nexus: #Only need this for instrument for peaks_total - short_filename = "%s_%s_event.nxs" % (instrument_name, str(run_nums[0])) + short_filename = "%s_%s" % (instrument_name, str(run_nums[0])) if data_directory is not None: - full_name = data_directory + "/" + short_filename + full_name = data_directory + "/" + short_filename + ".nxs.h5" + if not os.path.exists(full_name): + full_name = data_directory + "/" + short_filename + "_event.nxs" else: candidates = FileFinder.findRuns(short_filename) full_name = "" for item in candidates: if os.path.exists(item): full_name = str(item) - - if not full_name.endswith('nxs'): + + if not full_name.endswith('nxs') and not full_name.endswith('h5'): print("Exiting since the data_directory was not specified and") - print("findnexus failed for event NeXus file: " + instrument_name + " " + str(run)) + print("findnexus failed for event NeXus file: " + instrument_name + " " + str(run_nums[0])) exit(0) + # # Load the first data file to find instrument # -- GitLab