cbassa patch for position file, picamera

spacecruft
Jeff Moe 2022-08-22 13:26:21 -06:00
parent 0245ffc887
commit 424379f26b
2 changed files with 6 additions and 7 deletions

View File

@ -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):

View File

@ -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")