Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
redpitaya-MCPHA
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Günter Quast
redpitaya-MCPHA
Commits
d514b83f
Commit
d514b83f
authored
10 months ago
by
Guenter Quast
Browse files
Options
Downloads
Patches
Plain Diff
working config for RedPitaya pulse generator
parent
8cdc60de
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
config/spectrum_config.yaml
+21
-14
21 additions, 14 deletions
config/spectrum_config.yaml
modules/spectrum_filter.py
+2
-1
2 additions, 1 deletion
modules/spectrum_filter.py
redPoscdaq.py
+3
-3
3 additions, 3 deletions
redPoscdaq.py
setup.yaml
+9
-9
9 additions, 9 deletions
setup.yaml
with
35 additions
and
27 deletions
config/spectrum_config.yaml
+
21
−
14
View file @
d514b83f
...
@@ -2,28 +2,34 @@
...
@@ -2,28 +2,34 @@
general
:
general
:
runtime
:
600
# desired runtime in seconds
runtime
:
600
# desired runtime in seconds
runevents
:
&number_of_events
100000
runevents
:
&number_of_events
100000
number_of_samples
:
&number_of_samples
2048
number_of_samples
:
&number_of_samples
1000
analogue_offset
:
&analogue_offset
0
analogue_offset
:
&analogue_offset
0
sample_time_ns
:
&sample_time_ns
32
# special settings for RedPitaya
decimation_index
:
&decimation
4
# decimation 0:1, i:2^(i+1) # data decimation factor, 0 is 8 ns/sample
sample_time_ns
:
&sample_time_ns
256
# for decimation 4
invert_channel1
:
&invert1
0
invert_channel2
:
&invert2
0
trigger_level
:
&trigger_level
50
trigger_level
:
&trigger_level
50
trigger_channel
:
&trigger_channel
'
1'
trigger_channel
:
&trigger_channel
'
1'
trigger_direction
:
&trigger_direction
'
rising
'
trigger_direction
:
&trigger_direction
"
rising
"
# or "falling"
pre_trigger_samples
:
&pre_trigger_samples
103
# 5%
pre_trigger_samples
:
&pre_trigger_samples
103
# 5%
# dict for spectrum_filter, function find_peaks
find_peaks
:
find_peaks
:
# signal_characteristics: 256ns/sample, duration 50µs ( ~200 samples)
sample_time_ns
:
*sample_time_ns
sample_time_ns
:
*sample_time_ns
analogue_offset
:
*analogue_offset
analogue_offset
:
*analogue_offset
number_of_samples
:
*number_of_samples
number_of_samples
:
*number_of_samples
pre_trigger_samples
:
*pre_trigger_samples
pre_trigger_samples
:
*pre_trigger_samples
peak_minimal_prominence
:
5
0
# has to be positive and higher than avg. noise peaks to not cause havoc!
peak_minimal_prominence
:
20
0
# has to be positive and higher than avg. noise peaks to not cause havoc!
trigger_channel
:
*trigger_channel
trigger_channel
:
*trigger_channel
peak_minimal_distance
:
1
0
# minimal distance between two peaks in number of samples
peak_minimal_distance
:
40
0
# minimal distance between two peaks in number of samples
peak_minimal_width
:
7
# in number of samples
peak_minimal_width
:
100
# in number of samples
trigger_channel
:
*trigger_channel
trigger_channel
:
*trigger_channel
trigger_position_tolerance
:
7
# in number of samples
trigger_position_tolerance
:
20
# in number of samples
# dict for RedPitaya redPosc
i
daq
# dict for RedPitaya redPoscdaq
redP_to_rb
:
redP_to_rb
:
ip_address
:
'
192.168.0.103'
ip_address
:
'
192.168.0.103'
eventcount
:
*number_of_events
eventcount
:
*number_of_events
...
@@ -32,10 +38,11 @@ redP_to_rb:
...
@@ -32,10 +38,11 @@ redP_to_rb:
pre_trigger_samples
:
*pre_trigger_samples
pre_trigger_samples
:
*pre_trigger_samples
trigger_channel
:
*trigger_channel
trigger_channel
:
*trigger_channel
trigger_level
:
*trigger_level
trigger_level
:
*trigger_level
trigger_mode
:
'
norm'
trigger_mode
:
"
norm"
# or "auto"
decimation_index
:
0
# special settings for RedPitaya
invert_channel1
:
0
decimation_index
:
*decimation
invert_channel2
:
0
invert_channel1
:
*invert1
invert_channel2
:
*invert2
# Dict for simul_source.py
# Dict for simul_source.py
simul_source
:
simul_source
:
...
@@ -79,5 +86,5 @@ plot_histograms:
...
@@ -79,5 +86,5 @@ plot_histograms:
# define histograms
# define histograms
histograms
:
histograms
:
# name min max nbins ymax name lin/log
# name min max nbins ymax name lin/log
ch
A
_height
:
[
50.
,
3000.
,
250
,
5.9
,
"
ph
1A"
,
0
]
ch
1
_height
:
[
50.
,
3000.
,
250
,
20.
,
"
ph
1A"
,
0
]
ch
B
_height
:
[
50.
,
3000.
,
250
,
5.9
,
"
ph
1B"
,
0
]
ch
2
_height
:
[
50.
,
3000.
,
250
,
20.
,
"
ph
1B"
,
0
]
This diff is collapsed.
Click to expand it.
modules/spectrum_filter.py
+
2
−
1
View file @
d514b83f
...
@@ -53,7 +53,8 @@ def find_peaks(source_list=None, sink_list=None, observe_list=None, config_dict=
...
@@ -53,7 +53,8 @@ def find_peaks(source_list=None, sink_list=None, observe_list=None, config_dict=
peak_minimal_width
=
config_dict
[
"
peak_minimal_width
"
]
peak_minimal_width
=
config_dict
[
"
peak_minimal_width
"
]
pre_trigger_samples
=
config_dict
[
"
pre_trigger_samples
"
]
pre_trigger_samples
=
config_dict
[
"
pre_trigger_samples
"
]
trigger_channel
=
config_dict
[
"
trigger_channel
"
]
trigger_channel
=
config_dict
[
"
trigger_channel
"
]
if
trigger_channel
not
in
[
'
A
'
,
'
B
'
,
'
C
'
,
'
D
'
]:
# if trigger_channel not in ['A','B','C','D']:
if
trigger_channel
not
in
[
'
1
'
,
'
2
'
]:
trigger_channel
=
None
trigger_channel
=
None
trigger_position_tolerance
=
config_dict
[
"
trigger_position_tolerance
"
]
trigger_position_tolerance
=
config_dict
[
"
trigger_position_tolerance
"
]
...
...
This diff is collapsed.
Click to expand it.
redPoscdaq.py
+
3
−
3
View file @
d514b83f
...
@@ -103,7 +103,7 @@ class rpControl(QMainWindow, Ui_MCPHA):
...
@@ -103,7 +103,7 @@ class rpControl(QMainWindow, Ui_MCPHA):
"""
"""
Args:
Args:
callback: function receiving recorded waveforms
callback: function receiving recorded waveforms
conf_dict: a configuration dictionary
conf_dict: a configuration dictionary
"""
"""
super
(
rpControl
,
self
).
__init__
()
super
(
rpControl
,
self
).
__init__
()
...
@@ -190,12 +190,12 @@ class rpControl(QMainWindow, Ui_MCPHA):
...
@@ -190,12 +190,12 @@ class rpControl(QMainWindow, Ui_MCPHA):
self
.
pretrigger_fraction
=
0.05
if
"
pre_trigger_samples
"
not
in
self
.
confd
\
self
.
pretrigger_fraction
=
0.05
if
"
pre_trigger_samples
"
not
in
self
.
confd
\
else
self
.
confd
[
"
pre_trigger_samples
"
]
/
self
.
sample_size
else
self
.
confd
[
"
pre_trigger_samples
"
]
/
self
.
sample_size
self
.
trigger_mode
=
0
if
"
trigger_mode
"
not
in
self
.
confd
\
self
.
trigger_mode
=
0
if
"
trigger_mode
"
not
in
self
.
confd
\
else
1
if
self
.
confd
[
"
trigger_mode
"
]
==
"
auto
"
else
0
else
1
if
self
.
confd
[
"
trigger_mode
"
]
==
"
auto
"
or
self
.
confd
[
"
trigger_mode
"
]
==
1
else
0
self
.
trigger_source
=
0
if
"
trigger_channel
"
not
in
self
.
confd
\
self
.
trigger_source
=
0
if
"
trigger_channel
"
not
in
self
.
confd
\
else
int
(
self
.
confd
[
"
trigger_channel
"
])
-
1
else
int
(
self
.
confd
[
"
trigger_channel
"
])
-
1
self
.
trigger_level
=
500
if
"
trigger_level
"
not
in
self
.
confd
else
self
.
confd
[
"
trigger_level
"
]
self
.
trigger_level
=
500
if
"
trigger_level
"
not
in
self
.
confd
else
self
.
confd
[
"
trigger_level
"
]
self
.
trigger_slope
=
0
if
"
trigger_direction
"
not
in
self
.
confd
else
\
self
.
trigger_slope
=
0
if
"
trigger_direction
"
not
in
self
.
confd
else
\
0
if
self
.
confd
[
"
trigger_direction
"
]
==
"
rising
"
else
1
0
if
self
.
confd
[
"
trigger_direction
"
]
==
"
rising
"
or
self
.
confd
[
"
trigger_direction
"
]
==
"
1
"
else
1
self
.
decimation_index
=
1
if
"
decimation_index
"
not
in
self
.
confd
else
\
self
.
decimation_index
=
1
if
"
decimation_index
"
not
in
self
.
confd
else
\
self
.
confd
[
"
decimation_index
"
]
self
.
confd
[
"
decimation_index
"
]
self
.
invert1
=
0
if
"
invert_channel1
"
not
in
self
.
confd
else
self
.
confd
[
"
invert_channel1
"
]
self
.
invert1
=
0
if
"
invert_channel1
"
not
in
self
.
confd
else
self
.
confd
[
"
invert_channel1
"
]
...
...
This diff is collapsed.
Click to expand it.
setup.yaml
+
9
−
9
View file @
d514b83f
...
@@ -24,22 +24,22 @@ RingBuffer:
...
@@ -24,22 +24,22 @@ RingBuffer:
-
RB_1
:
-
RB_1
:
# raw input data buffer (from picoScope, file or simulation)
# raw input data buffer (from picoScope, file or simulation)
number_of_slots
:
16
number_of_slots
:
16
channel_per_slot
:
2048
channel_per_slot
:
1000
data_type
:
data_type
:
1
:
[
'
ch
A
'
,
"
float32"
]
1
:
[
'
ch
1
'
,
"
float32"
]
2
:
[
'
ch
B
'
,
"
float32"
]
2
:
[
'
ch
2
'
,
"
float32"
]
-
RB_2
:
-
RB_2
:
# buffer with correct signature double pulse parameters
# buffer with correct signature double pulse parameters
number_of_slots
:
16
number_of_slots
:
16
channel_per_slot
:
1
channel_per_slot
:
1
data_type
:
data_type
:
data_type
:
data_type
:
1
:
[
'
ch
A
_height'
,
"
float32"
]
1
:
[
'
ch
1
_height'
,
"
float32"
]
2
:
[
'
ch
A
_position'
,
"
int32"
]
2
:
[
'
ch
1
_position'
,
"
int32"
]
3
:
[
'
ch
A
_integral'
,
"
float32"
]
3
:
[
'
ch
1
_integral'
,
"
float32"
]
4
:
[
'
ch
B
_height'
,
"
float32"
]
4
:
[
'
ch
2
_height'
,
"
float32"
]
5
:
[
'
ch
B
_position'
,
"
int32"
]
5
:
[
'
ch
2
_position'
,
"
int32"
]
6
:
[
'
ch
B
_integral'
,
"
float32"
]
6
:
[
'
ch
2
_integral'
,
"
float32"
]
Functions
:
Functions
:
# define functions and ringbuffer assignment
# define functions and ringbuffer assignment
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment