From 3b7c69dcf4cdfa36fcd1e48a24fbcb46583ac8ca Mon Sep 17 00:00:00 2001 From: Tony Johnson Date: Thu, 4 Nov 2021 10:38:05 -0700 Subject: [PATCH 1/2] Start work on LSSTTD-1575 (untested) --- examples/bias10-LSSTTD-1575.cfg | 20 ++++++++++++++++++++ lib/acquire.py | 5 +++++ lib/config.py | 4 ++++ 3 files changed, 29 insertions(+) create mode 100644 examples/bias10-LSSTTD-1575.cfg diff --git a/examples/bias10-LSSTTD-1575.cfg b/examples/bias10-LSSTTD-1575.cfg new file mode 100644 index 0000000..c6ec9fb --- /dev/null +++ b/examples/bias10-LSSTTD-1575.cfg @@ -0,0 +1,20 @@ +# BOT EO configuration file + +# specify which acquisition sequences to run +# +[ACQUIRE] +bias1 +bias2 + +[CONFIG] +IDLE_FLUSH=True + +# Bias +# +[BIAS1] +acqtype=bias +COUNT=4 # number of bias frames, for BIAS image & noise analysis + +[BIAS2] +acqtype=bias +COUNT=6 # number of bias frames, for BIAS image & noise analysis diff --git a/lib/acquire.py b/lib/acquire.py index 1993b6f..734f481 100755 --- a/lib/acquire.py +++ b/lib/acquire.py @@ -539,3 +539,8 @@ def do_scan(options): print "scan called %s" % options tc = ScanTestCoordinator(options) tc.take_images() + +def do_one_time_config(options): + idle_flush = options.get("IDLE_FLUSH") + if idle_flush: + fp.fp.sequencerConfig().change("idleFlushTimeout", 0 if idle_flush else -1) diff --git a/lib/config.py b/lib/config.py index 44f7790..0e155e8 100755 --- a/lib/config.py +++ b/lib/config.py @@ -36,6 +36,10 @@ def execute(config, command_line_options): time.sleep(30) # wait a bit for getting settled command_line_options["symlink"] = "/".join([symlink,alabel]) + one_time_config = config.options("CONFIG") + if one_time_config: + acquire.do_one_time_config(one_time_config) + items = config.options("ACQUIRE") for item in items: options = Config(dict(config.items(item.upper()))) From c7afce56e54e01aa4a44185d23a8dbcf62a946ef Mon Sep 17 00:00:00 2001 From: CCS Operator Account Date: Fri, 5 Nov 2021 09:28:24 -0700 Subject: [PATCH 2/2] Bug fixes after testing --- lib/acquire.py | 5 +++-- lib/config.py | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/lib/acquire.py b/lib/acquire.py index 88fb091..e90d299 100755 --- a/lib/acquire.py +++ b/lib/acquire.py @@ -556,6 +556,7 @@ def do_scan(options): tc.take_images() def do_one_time_config(options): - idle_flush = options.get("IDLE_FLUSH") - if idle_flush: + print "one_time_config called %s" % options + if "idle_flush" in options: + idle_flush = options.getBool("idle_flush") fp.fp.sequencerConfig().change("idleFlushTimeout", 0 if idle_flush else -1) diff --git a/lib/config.py b/lib/config.py index 0e155e8..3088335 100755 --- a/lib/config.py +++ b/lib/config.py @@ -36,9 +36,9 @@ def execute(config, command_line_options): time.sleep(30) # wait a bit for getting settled command_line_options["symlink"] = "/".join([symlink,alabel]) - one_time_config = config.options("CONFIG") + one_time_config = config.items("CONFIG") if one_time_config: - acquire.do_one_time_config(one_time_config) + acquire.do_one_time_config(Config(dict(one_time_config))) items = config.options("ACQUIRE") for item in items: @@ -74,5 +74,15 @@ def getFloat(self, key, defaultValue=None): raise Exception('Missing config value %s' % key) return float(value) + def getBool(self, key, defaultValue=None): + value = self.get(key) + if not value: + if defaultValue != None: + return defaultValue + else: + raise Exception('Missing config value %s' % key) + return value.lower() in ['true', '1', 't', 'y', 'yes'] + + def getList(self, key): return self.get(key).replace('\n','').split(',')