Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Scientific Software
LAMP
Commits
b3236767
Commit
b3236767
authored
Feb 15, 2019
by
Gonzalez, Miguel
Browse files
Added test button and test function for testing and implementing new features.
parent
f12509e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
lamp_mac/readers/event_file.pro
View file @
b3236767
...
...
@@ -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
)
*
1
e6
;
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
)
*
1
e6
;
time
-
step
in
microseconds
bin_size
=
100
time_distrib
=
histogram
(
time_intervals
,
binsize
=
bin_size
,
min
=
0.0
,
max
=
1
e5
)
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'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment