Fichiers sources et visualisation des données d'observations

2 - Manipulation de fichiers FITS avec Astropy

2.1 - En-tête FITS et métadonnées

In [15]:
from astropy.io import fits
In [16]:
#open image
image_path = 'dataset/gamcas_siril_astrometry.fit'
hdu_list = fits.open(image_path)
hdu_list.info()
Filename: dataset/gamcas_siril_astrometry.fit
No.    Name      Ver    Type      Cards   Dimensions   Format
  0  PRIMARY       1 PrimaryHDU      44   (5496, 3672)   float32   
In [17]:
#get image_data, header and print header
hdu = hdu_list[0]
image_data = hdu_list[0].data
image_header = hdu_list[0].header

print(f'Image Data Type : {type(image_data)} - Shape : {image_data.shape}\n')
print('------------------------------ Header ------------------------------')
print(repr(image_header))
print('---------------------------- End Header ----------------------------')
Image Data Type : <class 'numpy.ndarray'> - Shape : (3672, 5496)

------------------------------ Header ------------------------------
SIMPLE  =                    T / file does conform to FITS standard             
BITPIX  =                  -32 / number of bits per data pixel                  
NAXIS   =                    2 / number of data axes                            
NAXIS1  =                 5496 / length of data axis 1                          
NAXIS2  =                 3672 / length of data axis 2                          
EXTEND  =                    T / FITS dataset may contain extensions            
COMMENT   FITS (Flexible Image Transport System) format is defined in 'Astronomy
COMMENT   and Astrophysics', volume 376, page 359; bibcode: 2001A&A...376..359H 
MIPS-FHI=                   1. / Upper visualization cutoff                     
MIPS-FLO=                   0. / Lower visualization cutoff                     
BZERO   =                   0. / offset data range to that of unsigned short    
BSCALE  =                   1. / default scaling factor                         
INSTRUME= 'ZWO ASI183MM Pro'   / instrument name                                
TELESCOP= 'Celestron AVX/CGE/CGEM/CGX' / telescope used to acquire this image   
DATE    = '2020-11-24T21:35:53' / UTC date that FITS file was created           
DATE-OBS= '2020-11-24T00:31:12.841' / YYYY-MM-DDThh:mm:ss observation start, UT 
XPIXSZ  =                  2.4 / X pixel size microns                           
YPIXSZ  =                  2.4 / Y pixel size microns                           
XBINNING=                    1 / Camera binning mode                            
YBINNING=                    1 / Camera binning mode                            
FOCALLEN=              701.704 / Camera focal length                            
CCD-TEMP=                 -15. / CCD temp in C                                  
EXPTIME =                 900. / Exposure time [s]                              
EQUINOX =                 2000 / Equatorial equinox                             
CTYPE1  = 'RA---TAN'           / Coordinate type for the first axis             
CTYPE2  = 'DEC--TAN'           / Coordinate type for the second axis            
OBJCTRA = '00 56 45.256'       / Image center R.A. (hms)                        
OBJCTDEC= ' 60 42 34.567'      / Image center declination (dms)                 
CRPIX1  =                2748. / Axis1 reference pixel                          
CRPIX2  =                1836. / Axis2 reference pixel                          
CRVAL1  =     14.1885681795358 / Axis1 reference value                          
CRVAL2  =     60.7096019965786 / Axis2 reference value                          
CD1_1   = 9.56008801740102E-05 / Scale matrix (1, 1)                            
CD1_2   = 0.000171064199002425 / Scale matrix (1, 2)                            
CD2_1   = 0.000171064199002425 / Scale matrix (2, 1)                            
CD2_2   = -9.56008801740102E-05 / Scale matrix (2, 2)                           
CDELT1  = 0.000195965528780923 / Axis1 scale                                    
CDELT2  = -0.000195965528780923 / Axis2 scale                                   
CROTA1  =     60.8009364554481 / Axis1 rotation angle (deg)                     
CROTA2  =     60.8009364554481 / Axis2 rotation angle (deg)                     
PROGRAM = 'Siril v0.99.6'      / Software that created this HDU                 
HISTORY Miroir X                                                                
HISTORY Miroir Y                                                                
HISTORY Miroir Y                                                                
---------------------------- End Header ----------------------------