guitastro_simple_examples.rst 1.88 KB

Guitastro Device Flipro simple examples

To execute the simple tests, first open a Python console and import guitastro and guitastro_device_flipro:

For Linux:

cd ~/Documents/guitastro_device_flipro/src
python3
>>> import guitastro
>>> import guitastro_device_flipro

For Windows (using powershell):

cd C:\Users\xxx\Documents\guitastro_device_flipro\src
python
>>> import guitastro
>>> import guitastro_device_flipro

1. List Components of a device

>>> dev = guitastro_device_flipro.Device_Flipro("FLIPRO")
>>> print("Components are:")
>>> for key, val in dev.components().items():
>>>    print(f" * {key} of type {val[0]}")

2. List parameters of a device

>>> dev = guitastro_device_flipro.Device_Flipro("FLIPRO")
>>> print("Device parameters:")
>>> for key, val in dev.param.items():
>>>    print(f" * {key} = {val}")

3. Open the connection and acquire an image

>>> import guitastro
>>> import guitastro_device_flipro

>>> dev = Device_Flipro("FLIPRO", name="Flipro")
>>> dev.open(True)
>>> dev.commandstring("camera SET exptime 0.1")
>>> dev.commandstring("camera DO ACQ START")
>>> while True:
>>>     timer = dev.commandstring(camera GET timer)
>>>     if timer == -1:
>>>         break
>>>     time.sleep(1)
>>> ima = dev.component('camera').ima
>>> ima.save("my_image.fit")

The command dev.open(True) makes the connection with the camera hardware. To make only simulation, replace True by False.