EoRImaging / FHD

Fast Holographic Deconvolution
BSD 2-Clause "Simplified" License
20 stars 10 forks source link

freq_center is off by +1 freq_res when reading from uvfits header #29

Closed piyanatk closed 7 years ago

piyanatk commented 9 years ago

Here is an example header from a uvfits that works. This particular uvfits is centered at 150.115MHz with 80kHz channel width. I have to subtract 80kHz to the frequency information in the header to make FHD read the right frequency center. My uvfits only has 1 frequency channel, so the issue might only be on this case.

In [15]: uvfits[0].header
Out[15]: 
SIMPLE  =                    T / file does conform to FITS standard             
BITPIX  =                  -32 / number of bits per data pixel                  
NAXIS   =                    7 / number of data axes                            
NAXIS1  =                    0 / length of data axis 1                          
NAXIS2  =                    3 / length of data axis 2                          
NAXIS3  =                    4 / length of data axis 3                          
NAXIS4  =                    1 / length of data axis 4                          
NAXIS5  =                    1 / length of data axis 5                          
NAXIS6  =                    1 / length of data axis 6                          
NAXIS7  =                    1 / length of data axis 7                          
EXTEND  =                    T / FITS dataset may contain extensions            
GROUPS  =                    T / random group records are present               
PCOUNT  =                    5 / number of random group parameters              
GCOUNT  =                 8128 / number of random groups                        
COMMENT   FITS (Flexible Image Transport System) format is defined in 'Astronomy
COMMENT   and Astrophysics', volume 376, page 359; bibcode: 2001A&A...376..359H 
OBJECT  = 'Undefined'                                                           
OBSRA   =                   0.                                                  
OBSDEC  =    -26.7033000000318                                                  
TELESCOP= 'MWA     '                                                            
INSTRUME= 'MWA     '                                                            
EPOCH   =                2000.                                                  
BSCALE  =                   1.                                                  
DATE-OBS= '2007-09-20T00:00:00.0'                                               
PTYPE1  = 'UU      '                                                            
PSCAL1  =                   1.                                                  
PZERO1  =                   0.                                                  
PTYPE2  = 'VV      '                                                            
PSCAL2  =                   1.                                                  
PZERO2  =                   0.                                                  
PTYPE3  = 'WW      '                                                            
PSCAL3  =                   1.                                                  
PZERO3  =                   0.                                                  
PTYPE4  = 'BASELINE'                                                            
PSCAL4  =                   1.                                                  
PZERO4  =                   0.                                                  
PTYPE5  = 'DATE    '                                                            
PSCAL5  =                   1.                                                  
PZERO5  =            2454363.5                                                  
CTYPE2  = 'COMPLEX '                                                            
CRVAL2  =                   1.                                                  
CRPIX2  =                   1.                                                  
CDELT2  =                   1.                                                  
CTYPE3  = 'STOKES  '                                                            
CRVAL3  =                  -5.                                                  
CRPIX3  =                   1.                                                  
CDELT3  =                  -1.                                                  
CTYPE4  = 'FREQ    '                                                            
CRVAL4  =          1.50035E+08                                                  
CRPIX4  =                   1.                                                  
CDELT4  =               80000.                                                  
CTYPE5  = 'IF      '                                                            
CRVAL5  =                   1.                                                  
CRPIX5  =                   1.                                                  
CDELT5  =                   1.                                                  
CTYPE6  = 'RA      '                                                            
CRVAL6  =                   0.                                                  
CRPIX6  =                   1.                                                  
CDELT6  =                   1.                                                  
CTYPE7  = 'DEC     '                                                            
CRVAL7  =             -26.7033                                                  
CRPIX7  =                   1.                                                  
CDELT7  =                   1.                                                  
HISTORY AIPS WTSCAL =  1.0                                                      
COMMENT written by the UV FITS writer of RBW.  
In [16]: uvfits[1].header
Out[16]: 
XTENSION= 'BINTABLE'           / binary table extension                         
BITPIX  =                    8 / 8-bit bytes                                    
NAXIS   =                    2 / 2-dimensional binary table                     
NAXIS1  =                   78 / width of table in bytes                        
NAXIS2  =                  128 / number of rows in table                        
PCOUNT  =                    0 / size of special data area                      
GCOUNT  =                    1 / one data group (required keyword)              
TFIELDS =                   12 / number of fields in each row                   
TTYPE1  = 'ANNAME  '           / label for field   1                            
TFORM1  = '8A      '           / data format of field: ASCII Character          
TTYPE2  = 'STABXYZ '           / label for field   2                            
TFORM2  = '3D      '           / data format of field: 8-byte DOUBLE            
TUNIT2  = 'METERS  '           / physical unit of field                         
TTYPE3  = 'ORBPARM '           / label for field   3                            
TFORM3  = '0D      '           / data format of field: 8-byte DOUBLE            
TTYPE4  = 'NOSTA   '           / label for field   4                            
TFORM4  = '1J      '           / data format of field: 4-byte INTEGER           
TTYPE5  = 'MNTSTA  '           / label for field   5                            
TFORM5  = '1J      '           / data format of field: 4-byte INTEGER           
TTYPE6  = 'STAXOF  '           / label for field   6                            
TFORM6  = '1E      '           / data format of field: 4-byte REAL              
TUNIT6  = 'METERS  '           / physical unit of field                         
TTYPE7  = 'POLTYA  '           / label for field   7                            
TFORM7  = '1A      '           / data format of field: ASCII Character          
TTYPE8  = 'POLAA   '           / label for field   8                            
TFORM8  = '1E      '           / data format of field: 4-byte REAL              
TUNIT8  = 'DEGREES '           / physical unit of field                         
TTYPE9  = 'POLCALA '           / label for field   9                            
TFORM9  = '3E      '           / data format of field: 4-byte REAL              
TTYPE10 = 'POLTYB  '           / label for field  10                            
TFORM10 = '1A      '           / data format of field: ASCII Character          
TTYPE11 = 'POLAB   '           / label for field  11                            
TFORM11 = '1E      '           / data format of field: 4-byte REAL              
TUNIT11 = 'DEGREES '           / physical unit of field                         
TTYPE12 = 'POLCALB '           / label for field  12                            
TFORM12 = '3E      '           / data format of field: 4-byte REAL              
EXTNAME = 'AIPS AN '           / name of this binary table extension            
ARRAYX  =    -2557725.65152835                                                  
ARRAYY  =      5091890.2462329                                                  
ARRAYZ  =    -2866299.46789126                                                  
FREQ    =          1.50035E+08                                                  
GSTIA0  =              132.584                                                  
DEGPDY  =              360.985                                                  
RDATE   = '2007-09-20T00:00:00.0'                                               
POLARX  =                   0.                                                  
POLARY  =                   0.                                                  
UT1UTC  =                   0.                                                  
DATUTC  =                   0.                                                  
TIMSYS  = 'UTC     '                                                            
ARRNAM  = 'MWA-SIM '                                                            
NUMORB  =                    0                                                  
NOPCAL  =                    3                                                  
FREQID  =                   -1                                                  
IATUTC  =                  33.                                                  
bhazelton commented 7 years ago

Now fixed after integrating with pyuvdata