# Fits viewver in python

**URL:** <https://community.openastronomy.org/t/fits-viewver-in-python/862>\
**Category:** Astropy\
**Tags:** fits\
**Created:** [January 2, 2024, 10:36am UTC](https://community.openastronomy.org/t/fits-viewver-in-python/862 "2024-01-02T10:36:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Salvatore](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@Salvatore](https://community.openastronomy.org/u/Salvatore)\
**Post date:** [January 2, 2024, 10:36am UTC](https://community.openastronomy.org/t/fits-viewver-in-python/862/1 "2024-01-02T10:36:36Z")

</div>

Hello,  
I’m new and learning python ( and i’m an amateur astrophotographer). In order to improve my progamming skill in python, i decided for my first project to try to implement a ( very basic) fits viever based on a gui library ( probably customtkinfra ). Its not going to be anything “scientific relevant”, just a very basic viever just to learn about python and astropy, and see how far I can go.

At moment im reading a loot about astropy and the fits standard, and the first thing i noticed is that ( understandably ) most of astropy documentation refers to mono images. Since i use an OSC camera ( based on a imx571 sensor, like the asi2600 ) i understood i need to debayer it and looks like there are no funzions in astropy for that. Is that correct?

Another thing i noticed is that the pictures i take are always datacubes::

Filename: ./test2.fits  
No. Name Ver Type Cards Dimensions Format  
0 PRIMARY 1 PrimaryHDU 49 (6224, 4168, 3) float32

I’m trying to read the documentatrion of the fits standard, and i uderstood thath there can be 1to 999 “layers”, but i’m not sure hot to interpret them and that’s the logic behind. the fact that my images have exacly 3 layers ( why not 1? or 4 or 10? ). Should I just stack the 3 “layers” and then debayer it ( maybe using CV2 ) ?

Thanks in advance,  
Salvatore

---

<div class="post-metadata">

**Author:** ![pflm](https://avatars.discourse-cdn.com/v4/letter/p/ccd318/32.png) [@pflm](https://community.openastronomy.org/u/pflm)\
**Post date:** [January 20, 2024, 1:01pm UTC](https://community.openastronomy.org/t/fits-viewver-in-python/862/2 "2024-01-20T13:01:30Z")

</div>

Dear Salvatore,  
the AAVSO DSLR observers manual has some helpful information on the format of DSLR images.  
[Digital Single Lens Reflex (DSLR) Camera Observing Manual | aavso](https://www.aavso.org/dslr-camera-photometry-guide)

You have an image cube because the software that has converted the images to FITS format has put the data for R, G and B pixels into separate 2-d images and packaged them up as a data cube. How you deal with these will depend on what you want to measure.

-Pierre
