def test_run_normalise_by_current(self): initial_value = 17 prtn_charge = '10.0' expected_value = initial_value / float(prtn_charge) # Create two workspaces ws = mantid.CreateWorkspace(DataX=0, DataY=initial_value) # Add Good Proton Charge Log mantid.AddSampleLog(Workspace=ws, LogName='gd_prtn_chrg', LogText=prtn_charge, LogType='Number') self.assertEqual(initial_value, ws.dataY(0)[0]) common.run_normalise_by_current(ws) self.assertAlmostEqual(expected_value, ws.dataY(0)[0], delta=1e-8)
def test_run_normalise_by_current(self): initial_value = 17 prtn_charge = '10.0' expected_value = initial_value / float(prtn_charge) # Create two workspaces ws = mantid.CreateWorkspace(DataX=0, DataY=initial_value) # Add Good Proton Charge Log mantid.AddSampleLog(Workspace=ws, LogName='gd_prtn_chrg', LogText=prtn_charge, LogType='Number') self.assertEqual(initial_value, ws.dataY(0)[0]) common.run_normalise_by_current(ws) self.assertAlmostEqual(expected_value, ws.dataY(0)[0], delta=1e-8)
def _normalise_ws_current(self, ws_to_correct): """ Normalises the workspace by the beam current at the time it was taken using normalise by current unless the instrument overrides it with its own custom method of normalising by current. :param ws_to_correct: The workspace to normalise the current of :return: The normalised workspace """ return common.run_normalise_by_current(ws_to_correct)
def _normalise_ws_current(self, ws_to_correct): """ Normalises the workspace by the beam current at the time it was taken using normalise by current unless the instrument overrides it with its own custom method of normalising by current. :param ws_to_correct: The workspace to normalise the current of :return: The normalised workspace """ return common.run_normalise_by_current(ws_to_correct)