Ticket #2237 (closed: fixed)
Inelastic absolute units produces incorrect values from the GUI
| Reported by: | Martyn Gigg | Owned by: | Martyn Gigg |
|---|---|---|---|
| Priority: | major | Milestone: | Iteration 27 |
| Component: | Mantid | Keywords: | |
| Cc: | Blocked By: | ||
| Blocking: | Tester: | Brett Tully |
Description
When running the inelastic convert to energy with absolute units turned on from the GUI you get incorrect scaling factors calculated.
A script with the same information gives the correct answer though.
Attachments
Change History
comment:2 Changed 10 years ago by Martyn Gigg
Test script
import sys
import os
sys.path.append(os.environ['MANTIDPATH'])
from MantidFramework import *
mtd.initialise()
import time
from DirectEnergyConversion import setup_reducer
def iliad_abs(wb_run,sample_run,mono_van,ei_guess,rebin):
try:
n,r=lhs('both')
wksp_out=r[0]
except:
wksp_out=str(sample_run)+'.spe'
start_time=time.clock()
reducer = setup_reducer('MARI')
reducer.normalise_method = 'monitor-1'
reducer.background = False
reducer.fix_ei = False
reducer.save_formats = ['.spe']
#Set parameters for these runs
reducer.map_file = 'mari_res.map'
reducer.energy_bins = rebin
#monovan info
reducer.abs_map_file='mari_res.map'
reducer.monovan_integr_range=[-40,40]
#reducer.van_rmm =50.94
reducer.van_mass=32.58
#sample info
reducer.sample_mass=5.00
reducer.sample_rmm =109.00
sample = sample_run
white = wb_run
mono=mono_van
# Note this isn't in the Mantid code yet
# The function definition looks like this
# def diagnose(sample_run, white_run, other_white = None, remove_zero=False,
# tiny=1e-10, large=1e10, median_lo=0.1, median_hi=3.0, signif=3.3,
# bkgd_threshold=5.0, bkgd_range=None, effic_var=1.1):
#
# Masking is then a MaskWorkspace that contains an accumulation of the results
masking = reducer.diagnose(white, sample,other_white = None, remove_zero=False,
tiny=1e-10, large=1e10, median_lo=0.1, median_hi=3.0, signif=3.3,
bkgd_threshold=5.0, bkgd_range=None, variation=1.1)
reducer.spectra_masks=masking
#Run the conversion
deltaE_wkspace = reducer.convert_to_energy(sample, ei_guess, white, mono,ei_guess,white)
end_time=time.clock()
results_name=str(sample)+'.spe'
ei= (deltaE_wkspace.getSampleDetails().getLogData("Ei").value)
print 'Incident energy found ',ei,' meV'
print 'Elapsed time =',end_time-start_time, 's'
#get the name that convert to energy will use
if results_name<>wksp_out:
RenameWorkspace(results_name,wksp_out)
return mtd[wksp_out]
if __name__ == '__main__':
iliad_abs(11060,11015,11001,11,[-11,0.05,10])
comment:3 Changed 10 years ago by Martyn Gigg
To the tester:
The files attached to this ticket show the settings on the GUI that will match the script above. Running the script and the GUI should produce a workspace ending in '.spe' and comparing these with CheckWorkspacesMatch should give a successful result.
comment:6 Changed 10 years ago by Martyn Gigg
- Status changed from accepted to verify
- Resolution set to fixed
comment:7 Changed 10 years ago by Brett Tully
- Status changed from verify to verifying
- Tester set to Brett Tully
Note: See
TracTickets for help on using
tickets.
