Did you say FITS?

https://fits.gsfc.nasa.gov/

  • The standard data format used in astronomy
  • Stands for 'Flexible Image Transport System'
  • Endorsed by NASA and the International Astronomical Union
  • Header keywords provide descriptive information about the data
  • Band SeQuential (BSQ) storage format
  • Compatible with PDS archiving constraints
  • Efficient projection (World Coordinate System) description (but for 3D systems)
  • Community driven processing libraries (e.g. astropy)
  • The Vatican Library has adopted FITS data format for long-term digital preservation of books and manuscripts!

Cubes, tables and MEF

Multi Extensions Files

Tools: astropy

http://www.astropy.org

>> hdulist.info()
	
Filename: ESP_011265_1560_RED.fits
No.    Name         Type      Cards   Dimensions   Format
0    PRIMARY     PrimaryHDU       4   ()              
1                ImageHDU        17   (2048, 100000)   uint8   
2                ImageHDU        17   (2048, 100000)   uint8   
3                ImageHDU        17   (2048, 100000)   uint8   
4                ImageHDU        17   (2048, 100000)   uint8   
5                ImageHDU        17   (2048, 100000)   uint8   
6                ImageHDU        17   (2048, 100000)   uint8   
7                ImageHDU        17   (2048, 100000)   uint8   
8                ImageHDU        17   (2048, 100000)   uint8   
9                ImageHDU        17   (2048, 100000)   uint8   
10               ImageHDU        17   (2048, 100000)   uint8   
	

Header Data Unit

#!/usr/bin/env python
from astropy.io import fits

hdulist = fits.open('my-fits-file-name')
hdr=hdulist[0].header
print hdr
hdulist.close()
      
SIMPLE  =                    T / conforms to FITS standard                      
BITPIX  =                    8 / array data type                                
NAXIS   =                    0 / number of array dimensions                     
EXTEND  =                    T                                                  
END                                                                             
	

XTENSION= 'IMAGE   '           / Image extension                                
BITPIX  =                    8 / array data type                                
NAXIS   =                    2 / number of array dimensions                     
NAXIS1  =                 2048                                                  
NAXIS2  =               100000                                                  
PCOUNT  =                    0 / number of parameters                           
GCOUNT  =                    1 / number of groups                               
CTYPE1  = 'MALG-AZP'           / see Calabretta and Greisen (2002)
CTYPE2  = 'MALN-AZP'           / see Calabretta and Greisen (2002)                           
CRPIX1  =                  1.0                                                  
CRPIX2  =                  1.0                                                  
CRVAL1  =                  0.0                                                  
CRVAL2  =                  1.0                                                  
CD1_1   =                  1.0                                                  
CD2_2   =                  1.0                                                  
CD1_2   =                  0.0                                                  
CD2_1   =                  0.0                                                  
END                                                                             
	
>> hdulist.info()
	
Filename: orb0413_1.IR1.fits
No.    Name         Type      Cards   Dimensions   Format
0    PRIMARY     PrimaryHDU      23   (128, 1784, 128)   int16   
1    WCS-TAB     BinTableHDU     17   1R x 2C      [228352D, 228352D]   
2    INCIDENCE   ImageHDU         8   (128, 1784)   float64   
3    EMISSION    ImageHDU         8   (128, 1784)   float64   
4    PHASE-ANGLE  ImageHDU         8   (128, 1784)   float64   
	 


Special thanks to David Berry (East Asian Observatory, Hilo, Hawaii)

See the Starlink software

>> hdulist[0].header
	
SIMPLE  =                    T / conforms to FITS standard                      
BITPIX  =                   16 / array data type                                
NAXIS   =                    3 / number of array dimensions                     
NAXIS1  =                  128                                                  
NAXIS2  =                 1784                                                  
NAXIS3  =                  128                                                  
EXTEND  =                    T                                                  
CTYPE1  = 'MALN-TAB'           / See Greisen et al. (2006)                                                 
CTYPE2  = 'MALG-TAB'           / See Greisen et al. (2006)                                                 
CRPIX1  =                  1.0                                                  
CRPIX2  =                  1.0                                                  
CRVAL1  =                  1.0                                                  
CRVAL2  =                  1.0                                                  
CD1_1   =                  1.0                                                  
CD2_2   =                  1.0                                                  
CD1_2   =                  0.0                                                  
CD2_1   =                  0.0                                                  
PS1_0   = 'WCS-TAB '                                                            
PS1_1   = 'COORDS1 '                                                            
PS2_0   = 'WCS-TAB '                                                            
PS2_1   = 'COORDS2 '                                                            
PV1_3   =                  1.0                                                  
PV2_3   =                  2.0                                                  
END                                                                             
	

Accessing header - Accessing data

>> hdr=hdulist[0].header
>> print hdr.keys()
>> print hdr.values()
    
>> scidata = hdulist[0].data
>> print scidata.shape
>> print scidata.dtype.name
>> print scidata[30:40, 10:20, 30:40]
    


Official Astropy FITS IO documentation

<Thank You!>