Skip to content
Snippets Groups Projects
Unverified Commit f6558fdf authored by Gigg, Martyn Anthony's avatar Gigg, Martyn Anthony Committed by GitHub
Browse files

Merge pull request #28497 from mantidproject/wand_duration

LoadWAND should add the duration log
parents a3b28090 684ba3b5
No related branches found
No related tags found
No related merge requests found
......@@ -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']
......
......@@ -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))
......
......@@ -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>`
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment