Hi everyone,
I'm developing a Python program based on INDI for EAA (Electronically Assisted Astronomy). The interface with INDI is based on this tutorial : indilib.org/develop/tutorials/151-time-l...ith-indi-python.html
My problem is that I don't know how to convert the BLOB bytes I get to numpy.array to allow further processing. Can anybody help me?
<code>
# get image data
img = bp.getblobdata()
# write image data to BytesIO buffer
import io
blobfile = io.BytesIO(img)
# open a file and save buffer to disk
with open("frame.fit", "wb") as f:
f.write(blobfile.getvalue())
</code>
image_data will now be a 2D numpy array with the first index being 'Y' and the second 'X' in the traditional sense of indexing images.
You can do:
image_data = numpy.transpose(image_data)
to flip it around to X first then Y.
This example assumes the data is in the primary HDU header which I think is always the case for INDI generated FITS representations of an image in memory.
Hi,
I wrote the software and tested it with the simulated camera and it seems working. Unfortunately, I've been too lazy to bring my setup back to life for a real test on the field so far...
That was the idea! But questionable weather, the hassle to start again after five years and small children around work against me
By the way,
here (GitHub)
anyone with more energy than me can find my first experiment to further develop. It has just the basic functions, I have more fancy algorithms in mind once this first proof of concept seems to work properly