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
6ab8b7eb
Commit
6ab8b7eb
authored
9 months ago
by
GuenterQuast
Browse files
Options
Downloads
Patches
Plain Diff
deleted backup file
parent
120c2c18
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/#redPitaya_source.py#
+0
-64
0 additions, 64 deletions
modules/#redPitaya_source.py#
with
0 additions
and
64 deletions
modules/#redPitaya_source.py#
deleted
100644 → 0
+
0
−
64
View file @
120c2c18
"""
**redPitaya_source**: mimoCoRB source compatible to redPoscdaq
Input data is provided as numpy-arry of shape (number_of_channels, number_of_samples).
"""
from mimocorb.buffer_control import rbImport
import numpy as np
import sys, time
from mutiprocessing import Event
def simul_source(source_list=None, sink_list=None, observe_list=None, config_dict=None, **rb_info):
"""
Generate simulated data and pass data to buffer
The class mimocorb.buffer_control/rbImport is used to interface to the
newBuffer and Writer classes of the package mimoCoRB.mimo_buffer
This example may serve as a template for other data sources
:param config_dict: configuration dictionary
- events_required: number of events to be simulated or 0 for infinite
- sleeptime: (mean) time between events
- random: random time between events according to a Poission process
- number_of_samples, sample_time_ns, pretrigger_samples and analogue_offset
describe the waveform data to be generated (as for oscilloscope setup)
Internal parameters of the simulated physics process (the decay of a muon)
are (presently) not exposed to user.
"""
global databuffer
data_ready = Event()
data_ready.clear()
run_rpControl(callback=rp_data)
def rp_data(data):
while data_ready.is_set():
time.sleep(0.01)
databuffer = data
data_ready.set()
events_required = 1000 if "eventcount" not in config_dict else config_dict["eventcount"]
def yield_data():
"""generate simulated data, called by instance of class mimoCoRB.rbImport"""
event_count = 0
while events_required == 0 or event_count < events_required:
data_ready.wait()
# deliver pulse data and no metadata
yield (databuffer, None)
data_ready.clear()
event_count += 1
datasource = rbImport(config_dict=config_dict, sink_list=sink_list, ufunc=yield_data, **rb_info)
# possibly check consistency of provided dtype with simulation !
# TODO: Change to logger!
# print("** simul_source ** started, config_dict: \n", config_dict)
# print("?> sample interval: {:02.1f}ns".format(osci.time_interval_ns.value))
datasource()
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