From cfc802b51b25461567e87f194fce804fc11e582e Mon Sep 17 00:00:00 2001 From: Leonardo Sala Date: Thu, 14 Sep 2017 12:02:44 +0200 Subject: [PATCH] Script execution --- script/bpm1s_TimestampTable.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 script/bpm1s_TimestampTable.py diff --git a/script/bpm1s_TimestampTable.py b/script/bpm1s_TimestampTable.py new file mode 100644 index 0000000..4338162 --- /dev/null +++ b/script/bpm1s_TimestampTable.py @@ -0,0 +1,18 @@ +import datetime + + + +def after(rec, scan): + path = get_exec_pars().group+"/TimeIOC" + if rec.index==0: + create_dataset(path, 's') + nanos = bpm1s_4ch.timestampNanos + dt = datetime.datetime.fromtimestamp(nanos/1e9) + time_str = str(dt).ljust(26,'0') + str(int(nanos % 1e3)).zfill(3) + append_dataset(path, time_str , type = 's') + +mscan(bpm1s_4ch, bpm1s_ch, -1, 1000.0, after_read = after) +#mscan(bpm6b, bpm6b, 5) + +#tscan(bpm6a, b5, 2.0) +