[daip] How to read VLA FITS file into matlab (fwd)

Eric Greisen egreisen at nrao.edu
Wed Dec 31 13:37:51 EST 2008


Lorant Sjouwerman wrote:
> Any takers?
> 
> 
> Regards,
> 
> Loránt Sjouwerman - Scientific Services - lsjouwerman at nrao.edu
> --------------------------------------------------------------
> c/o NRAO Array Operations Center       Phone:  +1-575-835-7332
>     P.O. Box 0 (1003 Lopezville Rd)    Switch: +1-575-835-7000
>     Socorro NM 87801                   Fax:    +1-575-835-7027
> 
> 
> ---------- Forwarded message ----------
> Date: Tue, 30 Dec 2008 06:15:53 -0800 (PST)
> From: Ronny <ronny_general at yahoo.com>
> To: lsjouwer at nrao.edu, lsjouwer at nrao.edu
> Subject: How to read VLA FITS file into matlab
> 
> Lorant,
> 
> My name is Ronny Levanda and I'm a Ph.D student at Bar Ilan university 
> Israel.
> 
> I received a FITS file from the VLA and I need to load the 
> (u,v,visibility) calibrated measurements into Matlab. The data should be 
> u,v data of a single field.
> 
> I have found a lot of information regarding the general FITS format 
> (i.e., how a general FITS file is built), but nothing regarding the 
> specific fields that concern me (visibility, u,v). 
> 
> Using FITSread of Matlab I get the 4 binary tables, but I don't know how 
> to extract the visibility information.
> 
> Can you please provide me the format of the VLA files I need?
>

I need to know more about this "FITS" file that you received from the 
VLA.  The data we distribute from the VLA is normally distributed by the 
archive in an archive format that is very far from FITS.  The AIPS 
package can read this and write FITS files in two different formats. 
One is traditionally called "random groups" and that is in fact 
described in part in the official FITS literature.  The AIPS task that 
writes this is called FITTP.  We now also can write data in a binary 
tables form with task FITAB.  If you have downloaded calibrated data 
from one of the projects which have been run through the pipeline then 
it will be in that format.  The columns of the UV table will be
U, V, W, baseline (256*A1 + A2), time, and data.  The latter will be an 
array containing a Complex, a Stokes, a Frequency, and an IF axis in all 
likelihood.  These are standard tables and if Matlab has any hope of 
understanding a FITS data set, then it should be able to display the 
header and column labels and data within the UV table.

The example below uses compressed data in which there is a scale and 
weight column and the visibility data (real and imaginary) are scaled 
16-bit integers.  I do not think the archive does that but I don't 
really know.

An example from my FITS area has the UV table header:

XTENSION= 'BINTABLE'           / Extension type
BITPIX  =                    8 / Binary data
NAXIS   =                    2 / Table is a matrix
NAXIS1  =                   36 / Width of table in bytes
NAXIS2  =                 5160 / Number of entries in table
PCOUNT  =                    0 / Random parameter count
GCOUNT  =                    1 / Group count
TFIELDS =                    8 / Number of fields in each row
EXTNAME = 'AIPS UV '           / AIPS table file
EXTVER  =                    1 / Version number of table
TFORM1  = '1E      '           / FORTRAN format of field  1
TTYPE1  = 'UU---SIN        '   / Type (heading) of field  1
TUNIT1  = 'SECONDS '           / physical units of field  1
TSCAL1  =  3.0538904297516E-09 / scale to physical units in field  1
TFORM2  = '1E      '           / FORTRAN format of field  2
TTYPE2  = 'VV---SIN        '   / Type (heading) of field  2
TUNIT2  = 'SECONDS '           / physical units of field  2
TSCAL2  =  3.0538904297516E-09 / scale to physical units in field  2
TFORM3  = '1E      '           / FORTRAN format of field  3
TTYPE3  = 'WW---SIN        '   / Type (heading) of field  3
TUNIT3  = 'SECONDS '           / physical units of field  3
TSCAL3  =  3.0538904297516E-09 / scale to physical units in field  3
TFORM4  = '1E      '           / FORTRAN format of field  4
TTYPE4  = 'BASELINE        '   / Type (heading) of field  4
TUNIT4  = '        '           / physical units of field  4
TFORM5  = '1E      '           / FORTRAN format of field  5
TTYPE5  = 'DATE            '   / Type (heading) of field  5
TUNIT5  = 'DAYS    '           / physical units of field  5
TZERO5  =  2.4523825000000E+06 / offset to physical units in field  5
TFORM6  = '1E      '           / FORTRAN format of field  6
TTYPE6  = 'WEIGHT          '   / Type (heading) of field  6
TUNIT6  = '        '           / physical units of field  6
TFORM7  = '1E      '           / FORTRAN format of field  7
TTYPE7  = 'SCALE           '   / Type (heading) of field  7
TUNIT7  = '        '           / physical units of field  7
TFORM8  = '4I      '           / FORTRAN format of field  8
TTYPE8  = 'VISIBILITIES    '   / Type (heading) of field  8
TUNIT8  = 'JY      '           / physical units of field  8
TDIM8   = '(2,2,1,1,1,1)'
1CTYP8  = 'COMPLEX '           / 1=real,2=imag,3=weight
1CRVL8  =    1.00000000000E+00 /
1CDLT8  =      1.000000000E+00 /
1CRPX8  =      1.000000000E+00 /
1CROT8  =      0.000000000E+00 /
2CTYP8  = 'STOKES  '           / -1=RR, -2=LL, -3=RL, -4=LR
2CRVL8  =   -1.00000000000E+00 /
2CDLT8  =     -1.000000000E+00 /
2CRPX8  =      1.000000000E+00 /
2CROT8  =      0.000000000E+00 /
3CTYP8  = 'FREQ    '           / Frequency in Hz.
3CRVL8  =    3.27451171875E+08 /
3CDLT8  =      2.734375000E+06 /
3CRPX8  =      1.000000000E+00 /
3CROT8  =      0.000000000E+00 /
4CTYP8  = 'IF      '           / Freq. group no. in CH table
4CRVL8  =    1.00000000000E+00 /
4CDLT8  =      1.000000000E+00 /
4CRPX8  =      1.000000000E+00 /
4CROT8  =      0.000000000E+00 /
5CTYP8  = 'RA      '           / Right Ascension in deg.
5CRVL8  =    6.20131250000E+01 /
5CDLT8  =      1.000000000E+00 /
5CRPX8  =      1.000000000E+00 /
5CROT8  =      0.000000000E+00 /
6CTYP8  = 'DEC     '           / Declination in deg.
6CRVL8  =    4.30091944444E+01 /
6CDLT8  =      1.000000000E+00 /
6CRPX8  =      1.000000000E+00 /
6CROT8  =      0.000000000E+00 /
OBJECT  = '3C103.0 '           / Source name
TELESCOP= 'VLA     '           /
INSTRUME= 'VLA     '           /
OBSERVER= 'AB1024  '           /
DATE-OBS= '2002-04-18'         / Obs start date YYYY-MM-DD
DATE-MAP= '2004-11-26'         / Last processing date YYYY-MM-DD
BSCALE  =    1.00000000000E+00 / REAL = TAPE * BSCALE + BZERO
BZERO   =    0.00000000000E+00 /
BUNIT   = 'UNCALIB '           / Units of flux
EQUINOX =      2.000000000E+03 / Epoch of RA DEC
COMMENT / IEEE not-a-number used for blanked f.p. pixels
VELREF  =                    3 / >256 RADIO, 1 LSR 2 HEL 3 OBS
ALTRVAL =    2.15837500000E+05 / Altenate FREQ/VEL ref value
OBSRA   =    6.20131250000E+01 / Antenna pointing RA
OBSDEC  =    4.30091944444E+01 / Antenna pointing DEC
RESTFREQ=   -5.04032258065E+04 / Rest frequency
END

AIPS prints a summary of this file as:
Image=3C103.0   (UV)         Filename=3C103.0     .TB FP .   1
Telescope=VLA                Receiver=
Observer=AB1024              User #=   12
Observ. date=18-APR-2002     Map date=BAD DATE
Pixel type: PIXEL 8BIT
# visibilities      5160     Sort order  TB
----------------------------------------------------------------
Rand axes: Type          Pscale          Pzero
            UU---SIN    3.0538904E-09   0.0000000E+00
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            VV---SIN    3.0538904E-09   0.0000000E+00
            WW---SIN    3.0538904E-09   0.0000000E+00
            BASELINE    1.0000000E+00   0.0000000E+00
            DATE        1.0000000E+00   2.4523825E+06
            WEIGHT      1.0000000E+00   0.0000000E+00
            SCALE       1.0000000E+00   0.0000000E+00
----------------------------------------------------------------
Type    Pixels   Coord value     at Pixel     Coord incr   Rotat
COMPLEX      2   1.0000000E+00       1.00  1.0000000E+00    0.00
STOKES       2  -1.0000000E+00       1.00 -1.0000000E+00    0.00
FREQ         1   3.2745117E+08       1.00  2.7343750E+06    0.00
IF           1   1.0000000E+00       1.00  1.0000000E+00    0.00
RA           1    04 08 03.150       1.00      3600.0000    0.00
DEC          1    43 00 33.100       1.00      3600.0000    0.00
----------------------------------------------------------------
Number of extension data lines =    5160

Eric Greisen





More information about the Daip mailing list