×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

Saving CCD blob to FITS file

  • Posts: 10
  • Thank you received: 1
I'm using PyIndi to make a client that connects to an indiserver for an SX_CCD. This particular CCD is the SX CCD SXVR-H694.

When I receive the blob from the CCD, the type is FITS but it's a 1D bytearray object, not 2D.

How do I go about converting this into the necessary format to save to a FITS file for viewing?
4 years 2 weeks ago #53827

Please Log in or Create an account to join the conversation.

  • Posts: 1231
  • Thank you received: 571
Here's a pointer to the method in fitsvewer that does that.
git.launchpad.net/kstars-bleeding/tree/k...di/indiccd.cpp#n1532
Please follow up if you have any questions.
4 years 2 weeks ago #53828

Please Log in or Create an account to join the conversation.

  • Posts: 10
  • Thank you received: 1
Thank you for the link, but I'm still a little confused.
I'm new to using Indi, and I'm using the PyIndi wrapper, so I'm not quite sure how to use the CCD::processBLOB. The code I started with is from the example here: www.indilib.org/develop/indi-python-bindings.html.

The relevant part at the end, where I receive the blob's data:

for blob in ccd_ccd1:
print("name: ", blob.name," size: ", blob.size," format: ", blob.format)
fits=blob.getblobdata()
print("fits data type: ", type(fits))
# here you may use astropy.io.fits to access the fits data
i+=1

The format of "blob" returns a bytearray object, and the size is 12104640.
Using astropy.io.fits I can create the fits file but the data is 1D. Can I make a call to CCD::processBLOB somehow to convert this into a 2D byte array that FITS viewers like?

Thank you again for the help.
4 years 2 weeks ago #53831

Please Log in or Create an account to join the conversation.

  • Posts: 1231
  • Thank you received: 571
Sorry, I'm not familiar with the PyIndi wrapper, and I wasn't suggesting that you try and call that C++ method.
I was just pointing you there in case you could read the code and see what kind of format the blob had.
If my memory serves me right, the blob data is in the fits file format as is (if it's of type FITS), but you should check.
4 years 2 weeks ago #53832

Please Log in or Create an account to join the conversation.

  • Posts: 10
  • Thank you received: 1

Rendering Error in layout Message/Item: array_keys(): Argument #1 ($array) must be of type array, null given. Please enable debug mode for more information.

Please Log in or Create an account to join the conversation.

Time to create page: 0.938 seconds