Thursday 25 June 2015

JPEG to FITS

There are various ways to convert JPEG files to FITS files:

The easiest are:

1. Linux terminal:   convert  <filename.jpeg>   <filename.fits>

2. MATLAB:          import filename.jpeg;
                                fitswrite(filename,'new_filename.fits')

Problem:
Both these ways produce a default header with minimal information on the newly created fits file.

Example: A header from  .fts file from BBSO  (required):

SIMPLE  =                    T / Written by IDL:   6-Jul-2000 13:21:53.00      
BITPIX  =                   16 /                                              
NAXIS   =                    2 /                                              
NAXIS1  =                 2032 /                                              
NAXIS2  =                 2032 /                                              
BZERO   =              0.00000 /                                              
BSCALE  =              1.00000 /                                              
OBJECT  = 'SUN'                /                                              
TYPE-OBS= 'FULLDISK'           /                                              
SEEING  =                    0 / VERY POOR                                    
CRPIX1  =           1016.50000 /                                              
CRPIX2  =           1016.50000 /                                              
CDELT1  =              1.05440 /                                              
CDELT2  =              1.05440 /                                              
CTYPE1  = 'ARCSEC'             / WEST POSITIVE                                
CTYPE2  = 'ARCSEC'             / NORTH POSITIVE                                
CRVAL1  =                    0 /                                              
CRVAL2  =                    0 /                                              
TIME-OBS= '15:43:18'           / START OF 30 MS EXPOSURE                      
DATE-OBS= '2000-07-06'         /                                              
DATE_OBS= '2000-07-06T15:43:18.000Z' /                                        
ORIGIN  = 'BBSO'               / BIG BEAR LAKE, CA                            
TELESCOP= 'SINGER'             /                                              
WAVELNTH= 'HALPHA'             /                                              
OBSERVER= 'XXX'                /                                              
EXPTIME =              0.03000 / SECONDS                                      
TEC_TEMP=                    0 / DEGREES C                                    
COMMENT   ORIGIN FILE NAME h706l.fts                                          
ASP     =              1.00000 / Raw image aspect ratio                        
CENX    =                 1017 / Raw image disk center X                      
CENY    =                 1018 / Raw image disk center Y                      
MAXC    =                 6210 / Quiet Sun Max Brightness                      
WIDT    =              1771.00 / Width of disk (pixels)                        
END                                                                            

The header of a JPEG to FITS converted file:

SIMPLE  =                    T
BITPIX  =                    8
NAXIS   =                    2
NAXIS1  =                 2032
NAXIS2  =                 2032
BSCALE  =         1.000000E+00
BZERO   =         0.000000E+00
DATAMAX =         2.550000E+02
DATAMIN =         0.000000E+00   
        END


Since the information in the header is important for the analysis of fits files using the AAFDCC code, we need to add appropriate headers to the converted fits files. 

Now, I am trying to understand what each quantity in the header of a fits file created by BBSO means. After I figure that out, I will have to find ways to extract these quantities from the JPEG images and write them to the headers of the converted fits files. 
                             

 

No comments:

Post a Comment