This python module allows you to create sequences and interacting with your devices using python scripting.
A few examples of how to use this module are in the "example" directory.
Homepage: https://github.com/GuLinux/indi-lite-tools/tree/master/pyindi_sequence
Installation
At the moment only manual installation is supported.
Get the sources:
git clone git@github.com:GuLinux/indi-lite-tools.git
Copy one of the examples from the pyindi_sequence/examples/ directory, change the path on the second one to the path containing the pyindi_sequence directory.
SequenceBuilder
The easiest way to use this module is to import the SequenceBuilder object
from pyindi_sequence import SequenceBuilder sb = SequenceBuilder('M42', upload_path = '/tmp/M42')
The SequenceBuilder class has all the methods required to create a sequence.
Constructor: SequenceBuilder(name, camera_name = None, upload_path = None, indi_host = INDIClient.DEFAULT_HOST, indi_port = INDIClient.DEFAULT_PORT) Within the constructor you can set the camera name, path for saving file (which will be autogenerated if not specified), and INDI connection parameter. Remember that an INDI server must be already up and running when creating the SequenceBuilder object.
devices(): returns a list of devices connected to the INDI server.
set_camera(camera_name): sets the camera to be used in the sequence.
set_filter_wheel(filter_wheel): sets the filter wheel to be used in the sequence.
add_sequence(sequence_name, exposure, count): adds count shots of exposure seconds as a sequence named sequence_name. Output file name will be changed accordingly.
add_filter_wheel_step(filter_name, filter_number): adds a step in the sequence changing the filter on the filter wheel. You can set either the filter name or the number, according to INDI settings.
add_user_confirmation_prompt(message): displays a message to the user, and waits for input (pressing enter on the keyboard). Useful if you don't have an electric filter wheel, and you need to manually change filters, or if you need to cover the lenses before taking dark frames.
add_shell_command(command, shell, abort_on_failure): runs the specified command in the sequence. commandand shell are set as per python documentation for the subprocess.call() method. abort_on_failure defaults to False, if set to True throws an exception when the command returns a non zero exit status
add_auto_dark(count): this particular step collects all the exposures previously used, and takes count (defaults to 10) dark frame for each different exposure value. You can add multiple auto dark commands: each time you add it, the exposures list will reset.
start(): starts taking frames.
The SequenceBuilder object will also store a few useful attributes for directly manipulating INDI devices, such as camera, filter_wheel, indi_client, upload_path.
Please see the other files for a more advanced use of this API.
Extending PyINDI-Sequence
the Device class in device.py contains a few primitives for interact with INDI devices, particularly to get and set values. You can look at the Camera and FilterWheel classes for a few examples.
You can also add new steps, both for controlling new INDI device types, and other various usages (like the User Confirmation prompt and the Run Command).
All the steps need to do is to implement the run() method.
You can then add them directly to the sequences attribute of the SequenceBuilder object.