Commit c3cd3d64 authored by Simon Heybrock's avatar Simon Heybrock
Browse files

Add example without frame summing.

parent 91deafd5
from wfm_stitching import WFMProcessor, load, save_fits_stack, normalize, make_frame_shifts
# frame_parameters = ['12540,64,22170', '23330,64,32600', '33500,64,42220',
# '42900,64,50270', '51800,64,58540', '60354,64,69000']
frame_parameters = ['18454,64,27522', '28645,64,37670', '38836,64,46479',
'47731,64,54510', '56324,64,62680', '64485,64,68890']
frame_shifts = make_frame_shifts(-6630)
wfm_position = 28.55
sample_position = 51.39
detector_position = 51.4
instrument_filename = 'sample-data/HZB_V20_Definition_512.xml'
sample_filename = 'sample-data/Spectrum472_Y2O3_Zmin_36000sec01_ch5.asc'
vanadium_filename = 'sample-data/Spectrum468_Vanadium_36000sec01_ch5.asc'
for frame,shift in zip(frame_parameters, frame_shifts):
p = WFMProcessor(wfm_position, sample_position, detector_position, [frame], [shift])
sample_workspace = load('sample', sample_filename)
sample_processed = p.process(
sample_workspace, instrument_filename, '0,64,70000', scale=1e3,
delete_temporary_workspaces=True)
vanadium_workspace = load('vanadium', vanadium_filename)
vanadium_processed = p.process(
vanadium_workspace, instrument_filename, '0,64,70000', scale=1e3,
delete_temporary_workspaces=True)
normalized = Divide(sample_processed, vanadium_processed)
RenameWorkspace(normalized, '{}-frame-{}'.format(normalized.getName(), frame))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment