diff --git a/README.md b/README.md index fa4fc93..578b50e 100644 --- a/README.md +++ b/README.md @@ -98,11 +98,6 @@ Store downloads here: mkdir -p ./data/obs ./data/tle ./data/results ``` -It fails if this file doesn't exist: -``` -touch data/obs/control/position.txt -``` - The `ST_DATADIR` variable is still used, from `sattools`. Maybe set all these in `~/.bashrc` (suit to fit directory setup): diff --git a/acquire.py b/acquire.py index 9fd1293..af3e12b 100755 --- a/acquire.py +++ b/acquire.py @@ -15,12 +15,12 @@ import logging import configparser import argparse import zwoasi as asi +from picamerax.array import PiRGBArray +from picamerax import PiCamera # Capture images from pi def capture_pi(image_queue, z1, t1, z2, t2, nx, ny, nz, tend, device_id, live, cfg): - from picamerax.array import PiRGBArray - from picamerax import PiCamera # Intialization first = True slow_CPU = False @@ -380,6 +380,10 @@ def compress(image_queue, z1, t1, z2, t2, nx, ny, nz, tend, path, device_id, cfg except PermissionError: logger.error("Can not create control path directory: %s" % controlpath) raise + if not os.path.exists(os.path.join(controlpath, "position.txt")): + with open(os.path.join(controlpath, "position.txt"), "w") as fp: + fp.write("\n") + with open(os.path.join(controlpath, "state.txt"), "w") as fp: fp.write("restart\n")