Sim/review simulation framework
Description
This MR introduces a new device class SimCamera
, and renames the existing monitor SynAxisMonitor
to SimMonitor
.
Both new classes can be configured to simulated data output from the same framework, sim_data
. While SynGaussBEC
is still available, SimMonitor
is capable of fully replacing the functionality of SynGaussBEC
and even extending it with additional features.
Related Issues
closes #26 (closed), #17 (closed)
Type of Change
- move signals to sim_signals.py
- add new class in sim_data.py which simulates and holds the
sim_state
of the devices in which current values of signals are stored. - SimCamera (e.g.
dev.eiger
) will send the full image upon being triggered, thus for each point in a scan, to the endpoint _device_monitor ("internal/devices/monitor/eiger"). Note, this is currently a bit slow ~1s per point (will be addressed by #29 (closed) )
Potential side effects
- There should be none. Throughout the init functions, I try to ensure current functionality in BEC.
- Once the new framework is tested, the
demo_config.yaml
can be refactor to use solely the new type of classesSimCamera
SimMonitor
SimPositioner
.
Screenshots / GIFs (if applicable)
[Include any relevant screenshots or GIFs to showcase the changes made.]
Additional Comments
How to use it:
The newly introduced classes have the property dev.<devname>.sim
, which is accessible via the CLI.
Currently, you can choose between 2 sim_type
with different sets of sim_params
.
To each return value, one can add noise via the parameters of the dictionary sim_params
.
I am happy for feedback on the usage.
SimMonitor
- Each monitor has a ref_motor
which can be assigned to any device, recommended a positioner e.g. samx, to compute the value for the gaussian signal.
SimCamera
Definition of Done
There are a few tasks that are pending and will be addressed in future with new MRs. These are:
- Documentation will be tackled in a sep merge #31 (closed)
- Clean up of repo is pending #30 (closed)
- Adding 1D Waveform as
SimWaveform
is also a pending task #32 (closed) - Extend sim framework to allow edge scans and pinhole scans #33 (closed)