Commit b3236767 authored by Gonzalez, Miguel's avatar Gonzalez, Miguel
Browse files

Added test button and test function for testing and implementing new features.

parent f12509e2
......@@ -1853,6 +1853,33 @@ function read_lst, filename
end
pro test_function
@lamp.cbk
common EV_common1, EV_struct
common EV_common2, Counts, Xdet, Ydet, Dtimer, Ctimer, Stimer, Mtimer, Dtimer_trigger, Mtimer_trigger
; diff = dtimer[1:*] - dtimer[0:-2]
; time_intervals = (diff / EV_struct.clock) * 1e6 ;time-step in microseconds
; bin_size = 0.2 ;
; time_distrib = histogram(time_intervals, binsize = bin_size, min=0.0)
; time_axis = findgen(n_elements(time_distrib))* bin_size + 0.5 * bin_size
;select a single tube
ntube = 64
tube = where(xdet eq (ntube-1))
diff = (dtimer[tube])[1:*] - (dtimer[tube])[0:-2]
time_intervals = (diff / EV_struct.clock) * 1e6 ;time-step in microseconds
bin_size = 100
time_distrib = histogram(time_intervals, binsize = bin_size, min=0.0, max=1e5)
time_axis = findgen(n_elements(time_distrib))* bin_size + 0.5 * bin_size
;A = [600.0, 2.e-3]
;yfit = CURVEFIT(time_axis, time_distrib, weights, A, function_name='FIT_EXP')
stop
end
pro event_file_dying, ev
;+
;** ****************
......@@ -1889,6 +1916,7 @@ pro event_file_event, ev
; 'show_dist_events', 'show_dist_triggers', 'expcur', 'explst',
; 'quit', 'timecycle'
; ********************************************************
case uv of
'help' : help_eventfile
......@@ -2088,6 +2116,8 @@ pro event_file_event, ev
'explst': export_nxs_list ;Export a list of files
'test': test_function
'quit': begin & widget_control, ev.top,/destroy & return & end
else:
......@@ -2342,7 +2372,9 @@ pro event_file, instrument=instrument
bid = widget_button(bexpo, value='Current File', font=ft_propor, uv='expcur')
bid = widget_button(bexpo, value='Apply settings to a list of files and export', $
font=ft_propor, uv='explst')
bid = widget_label( brow6, value='', xsize=130, font=ft_propor)
bid = widget_label( brow6, value='', xsize=120, font=ft_propor)
bidtest = widget_button(brow6, value='Test', font=ft_b_normal, uv='test')
bid = widget_label( brow6, value='', xsize=10, font=ft_propor)
bidh = widget_button(brow6, value=' ? ', font=ft_b_normal, uv='help')
bid = widget_label( brow6, value='', xsize=10, font=ft_propor)
bquit = widget_button(brow6, value='Quit', font=ft_b_normal, uv='quit')
......
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