From 07fb50c5ca3efeeeb323ad8c0962849ad568684f Mon Sep 17 00:00:00 2001 From: sldesnoo-Delft <s.l.desnoo@tudelft.nl> Date: Tue, 14 Jan 2025 13:46:11 +0100 Subject: [PATCH] Added example --- examples/demo_station/data_writer_demo.py | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 examples/demo_station/data_writer_demo.py diff --git a/examples/demo_station/data_writer_demo.py b/examples/demo_station/data_writer_demo.py new file mode 100644 index 00000000..ccc6f478 --- /dev/null +++ b/examples/demo_station/data_writer_demo.py @@ -0,0 +1,25 @@ +import core_tools as ct +import numpy as np + +ct.configure("./setup_config/ct_config_measurement.yaml") + +# %% + +from core_tools.data.data_writer import write_data, Axis, Data + +write_data( + 'Demo_WriteData', + Axis('x', 'x-array', 'a.u.', [1, 2, 3, 4]), + Data('y', 'y-array', 'a.u.', [3, 1, 4, 6]), +) + +write_data( + 'Demo_WriteData2D', + Axis('f', 'frequency', 'Hz', np.linspace(100e6, 200e6, 11)), + Axis('e12', 'detuning', 'mv', np.linspace(-10, 10, 5)), + Data('SD1', 'Sensor 1', 'mV', np.linspace(10, 20, 55).reshape((11, 5))), + Data('SD2', 'Sensor 2', 'mV', np.linspace(0, -20, 55).reshape((11, 5))), +) + + +#%% \ No newline at end of file -- GitLab