-
Notifications
You must be signed in to change notification settings - Fork 1
/
bot-data.py
executable file
·62 lines (49 loc) · 1.6 KB
/
bot-data.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env ccs-script
import sys
import time
from optparse import OptionParser
from org.lsst.ccs.scripting import CCS
from ccs import aliases
from ccs import proxies
from ccs import versions
from ccs import configs
from java.lang import Boolean
from java.time import Duration
import fp as libfp
import traceback
# Temporary work around for problems with CCS responsiveness
CCS.setDefaultTimeout(Duration.ofSeconds(30))
# Parse command line options
parser=OptionParser()
parser.add_option("--dry-run", action="store_true", dest="dry_run", default=False)
parser.add_option("-9","--ds9", action="store_true", dest="ds9")
parser.add_option("--run", dest="run")
parser.add_option("--symlink", dest="symlink")
parser.add_option("--skip", dest="skip")
parser.add_option("--limit", dest="limit")
(options, args) = parser.parse_args()
if len(args)!=1:
parser.print_help()
exit(1)
#CCS.aliases = {'focal-plane': 'focal-plane-sim', 'bot-bench': 'bot-bench-sim'}
#CCS.aliases = {
# 'focal-plane': 'ts8-fp',
# 'bot-bench': 'ts8-bench',
# 'bot-motorplatform': 'ts8-motorplatform',
# 'mcm': 'ts8-mcm'
#}
# Assume if run is set we are running under eTraveler
if options.run:
fp = CCS.attachProxy('focal-plane', Boolean(False))
time.sleep(10.0)
versions.write_versions(fp)
configs.write_config(fp, ['Sequencer', 'Rafts'])
import config
try:
cfg = config.parseConfig(args[0])
config.execute(cfg, {"dry_run": options.dry_run, "run": options.run, "symlink": options.symlink, "skip": options.skip, "limit": options.limit})
except:
traceback.print_exc()
raise
finally:
libfp.checkShutterStatus("CLOSE")