4 - Display and manipulation of spectra processed with SpecUtils

4.1 - Visualisation of the 2D Spectrum

From the elements used previously, it is therefore possible to display the acquired raw spectrum and check that it is not saturated.

In [5]:
#open image and show file info
spec1D_path = 'dataset/Navi_Light_007.fits'
hdu_list_spec1D = fits.open(spec1D_path)
hdu_list_spec1D.info()

spec1D_data = hdu_list_spec1D[0].data
spec1D_header = hdu_list_spec1D[0].header

print(f'Image Data Type : {type(spec1D_data)} - Shape : {spec1D_data.shape}')
print('------------------------------ Header ------------------------------')
print(repr(spec1D_header))
print('---------------------------- End Header ----------------------------')

fig9 = plt.figure()
plt.imshow(spec1D_data, cmap='gray',norm=LogNorm(), vmin=1800,vmax = 4500)
plt.grid(False)

print('Statistics values')
print('Min:', np.min(spec1D_data))
print('Max:', np.max(spec1D_data))
print('Mean:', np.mean(spec1D_data))
print('Stdev:', np.std(spec1D_data))
Filename: dataset/Navi_Light_007.fits
No.    Name      Ver    Type      Cards   Dimensions   Format
  0  PRIMARY       1 PrimaryHDU      37   (2749, 2199)   int16 (rescales to uint16)   
Image Data Type : <class 'numpy.ndarray'> - Shape : (2199, 2749)
------------------------------ Header ------------------------------
SIMPLE  =                    T / conforms to FITS standard                      
BITPIX  =                   16 / array data type                                
NAXIS   =                    2 / number of array dimensions                     
NAXIS1  =                 2749                                                  
NAXIS2  =                 2199                                                  
COMMENT   FITS (Flexible Image Transport System) format is defined in 'Astronomy
COMMENT   and Astrophysics', volume 376, page 359; bibcode: 2001A&A...376..359H 
ROWORDER= 'TOP-DOWN'           / Row Order                                      
INSTRUME= 'Atik 460ex'         / CCD Name                                       
TELESCOP= 'Celestron'          / Telescope name                                 
OBSERVER= 'Unknown '           / Observer name                                  
OBJECT  = 'Navi    '           / Object name                                    
EXPTIME =         2.000000E+01 / Total Exposure Time (s)                        
CCD-TEMP=            -1.50E+01 / CCD Temperature (Celsius)                      
PIXSIZE1=         4.540000E+00 / Pixel Size 1 (microns)                         
PIXSIZE2=         4.540000E+00 / Pixel Size 2 (microns)                         
XBINNING=                    1 / Binning factor in width                        
YBINNING=                    1 / Binning factor in height                       
XPIXSZ  =         4.540000E+00 / X binned pixel size in microns                 
YPIXSZ  =         4.540000E+00 / Y binned pixel size in microns                 
FRAME   = 'Light   '           / Frame Type                                     
IMAGETYP= 'Light Frame'        / Frame Type                                     
FOCALLEN=             2.00E+03 / Focal Length (mm)                              
APTDIA  =             2.03E+02 / Telescope diameter (mm)                        
SCALE   =         4.683010E-01 / arcsecs per pixel                              
SITELAT =                    0 / Latitude of the imaging site in degrees        
SITELONG=                    0 / Longitude of the imaging site in degrees       
AIRMASS =         1.071507E+00 / Airmass                                        
OBJCTRA = ' 0 56 45.30'        / Object J2000 RA in Hours                       
OBJCTDEC= '60 43 08.16'        / Object J2000 DEC in Degrees                    
RA      =         1.418874E+01 / Object J2000 RA in Degrees                     
DEC     =         6.071893E+01 / Object J2000 DEC in Degrees                    
EQUINOX =                 2000 / Equinox                                        
DATE-OBS= '2020-11-04T20:15:54.145' / UTC start date of observation             
BSCALE  =                    1                                                  
BZERO   =                32768                                                  
COMMENT Generated by INDI                                                       
---------------------------- End Header ----------------------------
Statistics values
Min: 194
Max: 39690
Mean: 320.39243242116567
Stdev: 118.05915598444801