diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/LoadWAND.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/LoadWAND.py index ec051e4bd68dda761a5051a8fd41526667b61bb1..0d49460fe02302b82b6c0fe0f00d3711d0b56479 100644 --- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/LoadWAND.py +++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/LoadWAND.py @@ -61,6 +61,7 @@ class LoadWAND(DataProcessorAlgorithm): data = np.zeros((512*480*8),dtype=np.int64) with h5py.File(run, 'r') as f: monitor_count = f['/entry/monitor1/total_counts'].value[0] + duration = f['/entry/duration'].value[0] run_number = f['/entry/run_number'].value[0] for b in range(8): data += np.bincount(f['/entry/bank'+str(b+1)+'_events/event_id'].value,minlength=512*480*8) @@ -90,6 +91,8 @@ class LoadWAND(DataProcessorAlgorithm): AddSampleLog('__tmp_load', LogName="Ei", LogType='Number', NumberType='Double', LogText=str(UnitConversion.run('Wavelength', 'Energy', wavelength, 0, 0, 0, Elastic, 0)), EnableLogging=False) AddSampleLog('__tmp_load', LogName="run_number", LogText=run_number, EnableLogging=False) + AddSampleLog('__tmp_load', LogName="duration", LogType='Number', + LogText=str(duration), NumberType='Double', EnableLogging=False) if grouping > 1: # Fix detector IDs per spectrum before loading instrument __tmp_load = mtd['__tmp_load'] diff --git a/Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/LoadWANDTest.py b/Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/LoadWANDTest.py index 8e7c10fad6f6c3b935077f3c1ab8ce4604773851..15008b456bda507a49a55c0bbf9cbf9c6fa45ed7 100644 --- a/Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/LoadWANDTest.py +++ b/Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/LoadWANDTest.py @@ -20,6 +20,7 @@ class LoadWANDTest(unittest.TestCase): self.assertAlmostEqual(ws.run().getGoniometer().getEulerAngles()[0], -142.6) self.assertEqual(ws.run().getLogData('Wavelength').value, 1.488) self.assertAlmostEqual(ws.run().getLogData('Ei').value, 36.94619794) + self.assertAlmostEqual(ws.run().getLogData('duration').value, 40.05) # Check masking self.assertTrue(ws.detectorInfo().isMasked(0)) diff --git a/docs/source/release/v5.1.0/diffraction.rst b/docs/source/release/v5.1.0/diffraction.rst index 8b1ec10c3b76d07df22cc015ec6b5faafc092173..7f4d0b3cb96576a7e2282995309ca1452f3320a0 100644 --- a/docs/source/release/v5.1.0/diffraction.rst +++ b/docs/source/release/v5.1.0/diffraction.rst @@ -15,6 +15,7 @@ Powder Diffraction - Polaris.create_total_scattering_pdf output workspaces now have the run number in the names. - Polaris.create_total_scattering_pdf no longer takes `output_binning` as a parameter, instead binning of the output pdf can be controlled with `delta_r` - Polaris.create_total_scattering_pdf can rebin the Q space workspace before calculating the PDF by being given an input `delta_q` +- :ref:`LoadWAND <algm-LoadWAND>` now adds `duration` log to the workspace Engineering Diffraction ----------------------- @@ -31,4 +32,4 @@ Single Crystal Diffraction Imaging ------- -:ref:`Release 5.1.0 <v5.1.0>` \ No newline at end of file +:ref:`Release 5.1.0 <v5.1.0>`