Index: trunk/Makefile
===================================================================
--- trunk/Makefile	(revision 4)
+++ trunk/Makefile	(revision 4)
@@ -0,0 +1,101 @@
+BASE = ./src
+
+TEST = $(BASE)/tests
+
+HEADER = $(BASE)/Header.o
+
+BLOCK = $(BASE)/Block.o
+
+PSRFITS = $(BASE)/PSRFits.o
+
+UTILS = $(BASE)/Utils.o
+
+# CFITSIODIR = /DATA/SITAR_1/whi550/Packages/cfitsio
+CFITSIODIR = /DATA/SITAR_1/whi550/Packages/cfitsio-myHack
+# CFITSIODIR = /DATA/SITAR_1/whi550/Packages/cfitsio-myHack-debug
+CFITSIOINC = -I$(CFITSIODIR)
+CFITSIOLIB = -L$(CFITSIODIR) -lcfitsio
+
+LIBS = $(CFITSIOLIB) -lm
+CINC=  $(CFITSIOINC)
+
+USE_HEADER_HH =  $(BASE)/Header.o\
+	$(BASE)/Block.o\
+	$(TEST)/headertest.o\
+	$(TEST)/blocktest.o\
+	$(TEST)/psrfitstest.o\
+	$(TEST)/testallheaders.o\
+	$(TEST)/testDataAccess.o
+
+USE_BLOCK_HH =  $(BASE)/Block.o\
+	$(TEST)/psrfitstest.o\
+	$(TEST)/blocktest.o\
+	$(TEST)/testallheaders.o\
+	$(TEST)/testDataAccess.o 
+
+USE_UTILS_HH =  $(TEST)/blocktest.o\
+	$(TEST)/psrfitstest.o\
+	$(TEST)/testallheaders.o\
+	$(TEST)/testDataAccess.o\
+	$(TEST)/testFitsCreation.o\
+	$(TEST)/testFitsKeywords.o\
+	$(TEST)/testFitsBinTable.o
+
+USE_PSRFITS_HH = $(TEST)/psrfitstest.o\
+	$(TEST)/blocktest.o\
+	$(TEST)/testallheaders.o\
+	$(TEST)/testDataAccess.o\
+	$(TEST)/testFitsCreation.o
+
+testhead : $(TEST)/headertest.o $(HEADER)
+	$(CXX) -o testhead.x $(TEST)/headertest.o $(HEADER)
+
+testblock : $(TEST)/blocktest.o $(HEADER) $(BLOCK) 
+	$(CXX) -o testblock.x $(TEST)/blocktest.o $(HEADER) $(BLOCK) 
+
+testpsrfits : $(TEST)/psrfitstest.o $(HEADER) $(BLOCK) $(PSRFITS) $(UTILS)
+	$(CXX) -o testpsrfits.x $(TEST)/psrfitstest.o $(HEADER) $(BLOCK) $(PSRFITS) $(UTILS) $(LIBS)
+
+testfulls70 : $(TEST)/s70FullTest.o $(HEADER) $(BLOCK) $(PSRFITS) $(UTILS)
+	$(CXX) -o testfulls70.x $(TEST)/s70FullTest.o $(HEADER) $(BLOCK) $(PSRFITS) $(UTILS) $(LIBS)
+
+testallhead : $(TEST)/testallheaders.o $(HEADER) $(BLOCK)
+	$(CXX) -o testallhead.x $(TEST)/testallheaders.o $(HEADER) $(BLOCK)
+
+testdata : $(TEST)/testDataAccess.o $(HEADER) $(BLOCK)
+	$(CXX) -o testdata.x $(TEST)/testDataAccess.o $(HEADER) $(BLOCK)
+
+testfits1 : $(TEST)/testFitsCreation.o
+	$(CXX) -o testfits1.x $(TEST)/testFitsCreation.o $(LIBS)
+
+testfits2 : $(TEST)/testFitsKeywords.o
+	$(CXX) -o testfits2.x $(TEST)/testFitsKeywords.o $(LIBS)
+
+testfits3 : $(TEST)/testFitsBinTable.o
+	$(CXX) -o testfits3.x $(TEST)/testFitsBinTable.o $(LIBS)
+
+testfits4 : $(TEST)/testFitsBinTableSml.o
+	$(CXX) -o testfits4.x $(TEST)/testFitsBinTableSml.o $(LIBS)
+
+s70 : $(TEST)/test_s70_data_read.cc
+	$(CXX) -o s70.x $(TEST)/test_s70_data_read.cc
+
+pm : $(TEST)/test_pttape_read.cc
+	$(CXX) -o pm.x $(TEST)/test_pttape_read.cc
+
+.cc.o:
+	$(CXX) -c $< $(CINC) -o $@
+
+.c.o:
+	$(CC) -c $< $(CINC) -o $@
+
+.tex:
+
+clean : 
+	rm -f $(BASE)/*.o $(TEST)/*.o 
+
+USE_UTILS_HH : $(BASE)/Utils.hh
+USE_HEADER_HH : $(BASE)/Header.hh
+USE_BLOCK_HH : $(BASE)/Block.hh
+USE_PSRFITS_HH : $(BASE)/PSRFits.hh
+
Index: trunk/src/Makefile
===================================================================
--- trunk/src/Makefile	(revision 3)
+++ 	(revision )
@@ -1,100 +1,0 @@
-BASE = .
-TEST = $(BASE)/tests
-
-HEADER = $(BASE)/Header.o
-
-BLOCK = $(BASE)/Block.o
-
-PSRFITS = $(BASE)/PSRFits.o
-
-UTILS = $(BASE)/Utils.o
-
-# CFITSIODIR = /DATA/SITAR_1/whi550/Packages/cfitsio
-CFITSIODIR = /DATA/SITAR_1/whi550/Packages/cfitsio-myHack
-# CFITSIODIR = /DATA/SITAR_1/whi550/Packages/cfitsio-myHack-debug
-CFITSIOINC = -I$(CFITSIODIR)
-CFITSIOLIB = -L$(CFITSIODIR) -lcfitsio
-
-LIBS = $(CFITSIOLIB) -lm
-CINC=  $(CFITSIOINC)
-
-USE_HEADER_HH =  $(BASE)/Header.o\
-	$(BASE)/Block.o\
-	$(TEST)/headertest.o\
-	$(TEST)/blocktest.o\
-	$(TEST)/psrfitstest.o\
-	$(TEST)/testallheaders.o\
-	$(TEST)/testDataAccess.o
-
-USE_BLOCK_HH =  $(BASE)/Block.o\
-	$(TEST)/psrfitstest.o\
-	$(TEST)/blocktest.o\
-	$(TEST)/testallheaders.o\
-	$(TEST)/testDataAccess.o 
-
-USE_UTILS_HH =  $(TEST)/blocktest.o\
-	$(TEST)/psrfitstest.o\
-	$(TEST)/testallheaders.o\
-	$(TEST)/testDataAccess.o\
-	$(TEST)/testFitsCreation.o\
-	$(TEST)/testFitsKeywords.o\
-	$(TEST)/testFitsBinTable.o
-
-USE_PSRFITS_HH = $(TEST)/psrfitstest.o\
-	$(TEST)/blocktest.o\
-	$(TEST)/testallheaders.o\
-	$(TEST)/testDataAccess.o\
-	$(TEST)/testFitsCreation.o
-
-testhead : $(TEST)/headertest.o $(HEADER)
-	$(CXX) -o testhead.x $(TEST)/headertest.o $(HEADER)
-
-testblock : $(TEST)/blocktest.o $(HEADER) $(BLOCK) 
-	$(CXX) -o testblock.x $(TEST)/blocktest.o $(HEADER) $(BLOCK) 
-
-testpsrfits : $(TEST)/psrfitstest.o $(HEADER) $(BLOCK) $(PSRFITS) $(UTILS)
-	$(CXX) -o testpsrfits.x $(TEST)/psrfitstest.o $(HEADER) $(BLOCK) $(PSRFITS) $(UTILS) $(LIBS)
-
-testfulls70 : $(TEST)/s70FullTest.o $(HEADER) $(BLOCK) $(PSRFITS) $(UTILS)
-	$(CXX) -o testfulls70.x $(TEST)/s70FullTest.o $(HEADER) $(BLOCK) $(PSRFITS) $(UTILS) $(LIBS)
-
-testallhead : $(TEST)/testallheaders.o $(HEADER) $(BLOCK)
-	$(CXX) -o testallhead.x $(TEST)/testallheaders.o $(HEADER) $(BLOCK)
-
-testdata : $(TEST)/testDataAccess.o $(HEADER) $(BLOCK)
-	$(CXX) -o testdata.x $(TEST)/testDataAccess.o $(HEADER) $(BLOCK)
-
-testfits1 : $(TEST)/testFitsCreation.o
-	$(CXX) -o testfits1.x $(TEST)/testFitsCreation.o $(LIBS)
-
-testfits2 : $(TEST)/testFitsKeywords.o
-	$(CXX) -o testfits2.x $(TEST)/testFitsKeywords.o $(LIBS)
-
-testfits3 : $(TEST)/testFitsBinTable.o
-	$(CXX) -o testfits3.x $(TEST)/testFitsBinTable.o $(LIBS)
-
-testfits4 : $(TEST)/testFitsBinTableSml.o
-	$(CXX) -o testfits4.x $(TEST)/testFitsBinTableSml.o $(LIBS)
-
-s70 : $(TEST)/test_s70_data_read.cc
-	$(CXX) -o s70.x $(TEST)/test_s70_data_read.cc
-
-pm : $(TEST)/test_pttape_read.cc
-	$(CXX) -o pm.x $(TEST)/test_pttape_read.cc
-
-.cc.o:
-	$(CXX) -c $< $(CINC) -o $@
-
-.c.o:
-	$(CC) -c $< $(CINC) -o $@
-
-.tex:
-
-clean : 
-	rm -f $(BASE)/*.o $(TEST)/*.o 
-
-USE_UTILS_HH : $(BASE)/Utils.hh
-USE_HEADER_HH : $(BASE)/Header.hh
-USE_BLOCK_HH : $(BASE)/Block.hh
-USE_PSRFITS_HH : $(BASE)/PSRFits.hh
-
Index: trunk/templates/combinedtemplate.fits
===================================================================
--- trunk/templates/combinedtemplate.fits	(revision 4)
+++ trunk/templates/combinedtemplate.fits	(revision 4)
@@ -0,0 +1,15 @@
+SIMPLE  = T
+BITPIX  = 32
+NAXIS   = 2     / number of dimensions
+NAXIS1  = 10  / length of first axis
+NAXIS2  = 20  / length of second axis
+OBJECT  = NGC 253 / name of observed object
+  xtension = bintable
+  naxis2 = 40
+  ttype# = Name
+  tform# = 10a
+  ttype# = Npoints
+  tform# = j
+  ttype# = Rate
+  tunit# = counts/s
+  tform# = e
Index: trunk/templates/psrheader.txt
===================================================================
--- trunk/templates/psrheader.txt	(revision 4)
+++ trunk/templates/psrheader.txt	(revision 4)
@@ -0,0 +1,807 @@
+SIMPLE  =                    T / file does conform to FITS standard
+BITPIX  =                    8 / number of bits per data pixel
+NAXIS   =                    0 / number of data axes
+EXTEND  =                    T / FITS dataset may contain extensions
+COMMENT   FITS (Flexible Image Transport System) format defined in Astronomy and
+COMMENT   Astrophysics Supplement Series v44/p363, v44/p371, v73/p359, v73/p365.
+COMMENT   Contact the NASA Science Office of Standards and Technology for the
+COMMENT   FITS Definition document #100 and other FITS information.
+COMMENT
+HDRVER  = '2.4             '   / Header version 
+DATE    = '                '   / File creation date (YYYY-MM-DDThh:mm:ss UTC)
+OBSERVER= '                '   / Observer name(s)
+PROJID  = '                '   / Project name
+TELESCOP= '                '   / Telescope name
+ANT_X   = *                    / [m] Antenna ITRF X-coordinate (D)
+ANT_Y   = *                    / [m] Antenna ITRF Y-coordinate (D)
+ANT_Z   = *                    / [m] Antenna ITRF Z-coordinate (D)
+FRONTEND= '                '   / Rx and feed ID
+FD_POLN = '                '   / LIN or CIRC
+FD_HAND = *                    / +/- 1. +1 is LIN:A=X,B=Y, CIRC:A=L,B=R (I)
+FD_SANG = *                    / [deg] FA of E vect for equal sig in A&B (E)
+FD_XYPH = *                    / [deg] Phase of A^* B for injected cal (E)
+BACKEND = '                '   / Backend ID
+BECONFIG= '                '   / Backend configuration file name
+BE_PHASE= *                    / 0/+1/-1 BE cross-phase:0 unknown,+/-1 std/rev
+BE_DCC  = *                    / 0/1 BE downconversion conjugation corrected
+TCYCLE  = *                    / [s] On-line cycle time (D)
+NRCVR   = *                    / Number of receiver channels (I)
+OBS_MODE= '                '   / (PSR, CAL, SEARCH)
+SRC_NAME= '                '   / Source or scan ID 
+COORD_MD= '                '   / Coordinate mode (J2000, Gal, Ecliptic, etc.)
+STT_CRD1= '                '   / Start coord 1 (hh:mm:ss.sss or ddd.ddd)
+STT_CRD2= '                '   / Start coord 2 (-dd:mm:ss.sss or -dd.ddd) 
+TRK_MODE= '                '   / Track mode (TRACK, SCANGC, SCANLAT)
+STP_CRD1= '                '   / Stop coord 1 (hh:mm:ss.sss or ddd.ddd)
+STP_CRD2= '                '   / Stop coord 2 (-dd:mm:ss.sss or -dd.ddd) 
+SCANLEN = *                    / [s] Requested scan length (E)
+FD_MODE = '                '   / Feed track mode - FA, CPA, SPA, TPA
+FA_REQ  = *                    / [deg] Feed/Posn angle requested (E)
+CAL_MODE= '                '   / Cal mode (OFF, SYNC, EXT1, EXT2)
+CAL_FREQ= *                    / [Hz] Cal modulation frequency (E)
+CAL_DCYC= *                    / Cal duty cycle (E)
+CAL_PHS = *                    / Cal phase (wrt start time) (E)
+STT_DATE= '                '   / Start UT date (YYYY-MM-DD)
+STT_TIME= '                '   / Start UT (hh:mm:ss)
+STT_IMJD= *                    / Start MJD (UTC days) (J - long integer)
+STT_SMJD= *                    / [s] Start time (sec past UTC 00h) (J)
+STT_OFFS= *                    / [s] Start time offset (D)   
+STT_LST = *                    / [s] Start LST (D)
+END
+#
+###############################################################################
+#
+# Processing History Binary Table Extension
+#
+###############################################################################
+#
+XTENSION= BINTABLE             / ***** Processing history *****
+BITPIX  =                    8 / N/A
+NAXIS   =                    2 / 2-dimensional binary table
+NAXIS1  =                    * / width of table in bytes
+NAXIS2  =                    1 / number of rows
+PCOUNT  =                    0 / size of special data area
+GCOUNT  =                    1 / one data group (required keyword)
+TFIELDS =                   21 / number of fields per row
+#
+EXTNAME = HISTORY             / name of this binary table extension
+#
+TTYPE#  = DATE_PRO            / Processing date and time (UTC)
+TFORM#  = 24A                 / 24-char string
+TTYPE#  = PROC_CMD            / Processing program and command
+TFORM#  = 80A                 / 80_char string
+TTYPE#  = SCALE               / Units (FluxDen/RefFlux/Jansky)
+TFORM#  = 8A                  / 8-char string
+TTYPE#  = POL_TYPE            / Polarisation identifier
+TFORM#  = 8A                  / 8-char string
+TTYPE#  = NPOL                / Number of polarisations
+TFORM#  = 1I                  / Integer
+TTYPE#  = NBIN                / Nr of bins per product (0 for SEARCH mode)
+TFORM#  = 1I                  / Integer
+TTYPE#  = NBIN_PRD            / Nr of bins per period
+TFORM#  = 1I                  / Integer
+TTYPE#  = TBIN                / Time per bin or sample
+TUNIT#  = s                   / units of field
+TFORM#  = 1D                  / Double
+TTYPE#  = CTR_FREQ            / Band centre frequency
+TUNIT#  = MHz                 / units of field
+TFORM#  = 1D                  / Double
+TTYPE#  = NCHAN               / Number of frequency channels
+TFORM#  = 1I                  / Integer
+TTYPE#  = CHAN_BW             / Channel bandwidth
+TFORM#  = 1D                  / Double
+TUNIT#  = MHz                 / units of field
+TTYPE#  = PAR_CORR            / Parallactic angle correction applied
+TFORM#  = 1I                  / Integer flag 
+TTYPE#  = FA_CORR             / Feed angle correction applied
+TFORM#  = 1I                  / Integer flag 
+TTYPE#  = RM_CORR             / RM correction applied
+TFORM#  = 1I                  / Integer flag 
+TTYPE#  = DEDISP              / Data dedispersed
+TFORM#  = 1I                  / Integer flag 
+TTYPE#  = DDS_MTHD            / Dedispersion method
+TFORM#  = 32A                 / 32-char string
+TTYPE#  = SC_MTHD             / Scattered power correction method
+TFORM#  = 32A                 / 32-char string
+TTYPE#  = CAL_MTHD            / Calibration method
+TFORM#  = 32A                 / 32-char string
+TTYPE#  = CAL_FILE            / Name of gain calibration file
+TFORM#  = 32A                 / 32-char string
+TTYPE#  = RFI_MTHD            / RFI excision method
+TFORM#  = 32A                 / 32-char string
+TTYPE#  = IFR_MTHD            / Ionospheric Faraday rotation correction method
+TFORM#  = 32A                 / 32-char string
+END
+#
+###############################################################################
+#
+# Digitiser Statistics Binary Table Extension
+#
+###############################################################################
+#
+XTENSION= BINTABLE             / ***** Digitiser statistics *****
+BITPIX  =                    8 / N/A
+NAXIS   =                    2 / 2-dimensional binary table
+NAXIS1  =                    * / Width of table in bytes
+NAXIS2  =                    * / Number of rows in table (NSUBINT)
+PCOUNT  =                    0 / Size of special data area
+GCOUNT  =                    1 / One data group (required keyword)
+TFIELDS =                    1 / Number of fields per row
+#
+DIG_MODE= '                '   / Digitiser mode
+NDIGR   = *                    / Number of digitised channels (I)
+NPAR    = *                    / Number of digitiser parameters
+NCYCSUB = *                    / Number of correlator cycles per subint
+DIGLEV  = '                '   / Digitiser level-setting mode (AUTO, FIX)
+EXTNAME = DIG_STAT             / Name of this binary table extension
+#
+TTYPE#  = ATTEN                / Attenuator settings
+TFORM#  = E                    / NDIGR floats
+TUNIT#  = db                   / Units of field
+TTYPE#  = DATA                 / Digitiser statistics
+TDIM#   = (*,*,*)              / Data table dimensions (NLEV,NDIGR,NCYCSUB)
+TFORM#  = E                    / NPAR*NDIGR*NCYCSUB floats
+END
+#
+###############################################################################
+#
+# Digitiser Counts Binary Table Extension
+#
+###############################################################################
+#
+XTENSION= BINTABLE             / ***** Digitiser counts *****
+BITPIX  =                    8 / N/A
+NAXIS   =                    2 / 2-dimensional binary table
+NAXIS1  =                    * / Width of table in bytes
+NAXIS2  =                    1 / Number of rows in table
+PCOUNT  =                    0 / Size of special data area
+GCOUNT  =                    1 / One data group (required keyword)
+TFIELDS =                    3 / Number of fields per row
+#
+DIG_MODE= '                '   / Digitiser mode
+DYN_LEVT= *                    / Timescale for dynamic leveling
+NDIGR   = *                    / Number of digitised channels (I)
+NLEV    = *                    / Number of digitiser levels
+NPTHIST = *                    / Number of points in histogram (I)
+DIGLEV  = '                '   / Digitiser level-setting mode (AUTO, FIX)
+EXTNAME = DIG_CNTS             / Name of this binary table extension
+#
+TTYPE#  = DAT_OFFS             / Data offset for each histogram
+TFORM#  = E                    / NDIGR floats
+TTYPE#  = DAT_SCL              / Data scale factor for each histogram
+TFORM#  = E                    / NDIGR floats
+TTYPE#  = DATA                 / Digitiser count data
+TDIM#   = (*,*)                / Data table dimensions (NPTHIST,NDIGR)         
+TFORM#  = I                    / NPTHIST*NDIGR integers
+END
+#
+###############################################################################
+#
+# Original Bandpass Binary Table Extension
+#
+###############################################################################
+#
+XTENSION= BINTABLE             / ***** Original bandpasses *****
+BITPIX  =                    8 / N/A
+NAXIS   =                    2 / 2-dimensional binary table
+NAXIS1  =                    * / width of table in bytes
+NAXIS2  =                    1 / number of rows in table
+PCOUNT  =                    0 / size of special data area
+GCOUNT  =                    1 / one data group (required keyword)
+TFIELDS =                    3 / number of fields per row
+#
+NCH_ORIG= *                    / Number of channels in original bandpass
+BP_NPOL = *                    / Number of polarizations in bandpass
+EXTNAME = BANDPASS             / name of this binary table extension
+#
+TTYPE#  = DAT_OFFS             / Data offset for each bandpass
+TFORM#  = E                    / BP_NPOL floats
+TTYPE#  = DAT_SCL              / Data scale factor for each bandpass
+TFORM#  = E                    / BP_NPOL floats
+TTYPE#  = DATA                 / Bandpass for autocorrelations
+TDIM#   = (*,*)                / Data table dimensions = (NCH_ORIG,BP_NPOL)
+TUNIT#  = Jy                   / Bandpass amplitude units
+TFORM#  = I                    / NCH_ORIG*BP_NPOL integers
+END
+#
+###############################################################################
+#
+# Coherent Dedispersion Parameters Binary Table Extension
+#
+###############################################################################
+#
+XTENSION= BINTABLE             / ***** Coherent Dedispersion Parameters *****
+BITPIX  =                    8 / N/A
+NAXIS   =                    2 / 2-dimensional binary table
+NAXIS1  =                    * / width of table in bytes
+NAXIS2  =                    1 / number of rows in table (NCHAN)
+PCOUNT  =                    0 / size of special data area
+GCOUNT  =                    1 / one data group (required keyword)
+TFIELDS =                    3 / number of fields per row
+#
+NFFT    =                    * / Size of forward FFT 
+EXTNAME = COHDDISP             / name of this binary table extension
+#
+TTYPE#  = NOVERLAP             / Number of overlap points for each sub-band
+TFORM#  = 1I                   / Integer
+TTYPE#  = NCHIRP               / Number of points in chirp function
+TFORM#  = 1I                   / Integer
+TTYPE#  = ACBANDPASS           / Bandpass for autocorrelations
+TUNIT#  = Jy                   / Bandpass amplitude units
+TFORM#  = E                    / NCHIRP floats
+END
+#
+###############################################################################
+#
+# Ephemeris History Binary Table Extension
+#
+###############################################################################
+#
+# Note: This table has entries which should be sufficient for real-time folding 
+# of pulsar data. Additional parameters can be added to the table in off-line 
+# processing if necessary. Examples are: additional pulse frequency derivatives 
+# (Fn), additional DM derivatives (DMn), additional planets (T0_n, PB_n, A1_n, 
+# OM_n, ECC_n), additional glitches (GLEP_n, GLPH_n, GLF0_n, GLF1_n, GLF0D_n)
+# and additional FITWAVE coefficients (WAVES_n, WAVEC_n).
+#
+XTENSION= BINTABLE             / ***** Pulsar ephemeris history *****
+BITPIX  =                    8 / N/A
+NAXIS   =                    2 / 2-dimensional binary table
+NAXIS1  =                    * / width of table in bytes
+NAXIS2  =                    * / number of rows in table
+PCOUNT  =                    0 / size of special data area
+GCOUNT  =                    1 / one data group (required keyword)
+TFIELDS =                  104 / number of fields per row
+#
+EXTNAME = PSREPHEM             / name of this binary table extension
+#
+TTYPE#  = DATE_PRO             / Processing date and time (UTC)
+TFORM#  = 24A                  / 24-char string
+TTYPE#  = PROC_CMD             / Processing program and command
+TFORM#  = 80A                  / 80-char string
+TTYPE#  = EPHVER               / Version ID for ephemeris data
+TFORM#  = 16A                  / 16-char string
+TTYPE#  = PSR_NAME             / Pulsar Jname
+TFORM#  = 16A                  / 16-char string
+TTYPE#  = RAJ                  / RA (J2000) (hh:mm:ss.ssssssss)
+TFORM#  = 24A                  / 24-char string
+TTYPE#  = DECJ                 / Dec (J2000) (hh:mm:ss.ssssssss)
+TFORM#  = 24A                  / 24-char string
+TTYPE#  = PMRA                 / Proper motion in RA
+TFORM#  = 1D                   / Double
+TUNIT#  = mas/yr               / Units of field
+TTYPE#  = PMDEC                / Proper motion in DEC
+TFORM#  = 1D                   / Double
+TUNIT#  = mas/yr               / Units of field
+TTYPE#  = ELONG                / [deg] Ecliptic longitude
+TFORM#  = 1D                   / Double
+TUNIT#  = deg                  / Units of field
+TTYPE#  = ELAT                 / Ecliptic latitude
+TFORM#  = 1D                   / Double
+TUNIT#  = deg                  / Units of field
+TTYPE#  = PMELONG              / Proper motion in ecliptic longitude 
+TFORM#  = 1D                   / Double
+TUNIT#  = mas/yr               / Units of field
+TTYPE#  = PMELAT               / Proper motion in ecliptic latitude 
+TFORM#  = 1D                   / Double
+TUNIT#  = mas/yr               / Units of field
+TTYPE#  = PX                   / Parallax
+TFORM#  = 1D                   / Double
+TUNIT#  = mas                  / Units of field
+TTYPE#  = POSEPOCH             / Epoch at which the position is measured (MJD)
+TFORM#  = 1D                   / Double
+TUNIT#  = MJD                  / Units of field
+TTYPE#  = IF0                  / Integer mHz barycentric spin freq
+TFORM#  = 1J                   / Long integer
+TUNIT#  = mHz                  / Units of field
+TTYPE#  = FF0                  / Fractional mHz barycentric spin freq
+TFORM#  = 1D                   / Double
+TUNIT#  = mHz                  / Units of field
+TTYPE#  = F1                   / Time deriv of barycentric spin freq
+TFORM#  = 1D                   / Double
+TUNIT#  = s**(-2)              / Units of field
+TTYPE#  = F2                   / 2nd time deriv of barycentric spin freq
+TFORM#  = 1D                   / Double
+TUNIT#  = s**(-3)              / Units of field
+TTYPE#  = F3                   / 3rd time deriv of barycentric spin freq
+TFORM#  = 1D                   / Double
+TUNIT#  = s**(-4)              / Units of field
+TTYPE#  = PEPOCH               / Epoch of period/frequency determination
+TFORM#  = 1D                   / Double
+TUNIT#  = MJD                  / Units of field
+TTYPE#  = DM                   / Dispersion measure
+TFORM#  = 1D                   / Double
+TUNIT#  = cm**(-3) pc          / Units of field
+TTYPE#  = DM1                  / Time deriv of dispersion measure
+TFORM#  = 1D                   / Double
+TUNIT#  = cm**(-3) pc/yr       / Units of field
+TTYPE#  = RM                   / Rotation measure
+TFORM#  = 1D                   / Double
+TUNIT#  = rad m**(-2)          / Units of field
+TTYPE#  = BINARY               / Binary model
+TFORM#  = 8A                   / 8-char string
+TTYPE#  = T0                   / Epoch of periastron 
+TFORM#  = 1D                   / Double
+TUNIT#  = MJD                  / Units of field
+TTYPE#  = PB                   / Binary period of pulsar 
+TFORM#  = 1D                   / Double
+TUNIT#  = d                    / Units of field
+TTYPE#  = A1                   / Projected semi-major axis of orbit
+TFORM#  = 1D                   / Double
+TUNIT#  = s                    / Units of field
+TTYPE#  = OM                   / Longitude of periastron
+TFORM#  = 1D                   / Double
+TUNIT#  = deg                  / Units of field
+TTYPE#  = OMDOT                / [deg/yr]Periastron advance 
+TFORM#  = 1D                   / Double
+TUNIT#  = deg/yr               / Units of field
+TTYPE#  = ECC                  / Eccentricity
+TFORM#  = 1D                   / Double
+TTYPE#  = PBDOT                / First time deriv of binary period
+TFORM#  = 1D                   / Double
+TTYPE#  = GAMMA                / Post-Keplerian "gamma" term
+TFORM#  = 1D                   / Double
+TUNIT#  = s                    / Units of field
+TTYPE#  = SINI                 / Sine of inclination angle
+TFORM#  = 1D                   / Double
+TTYPE#  = M2                   / Companion mass 
+TFORM#  = 1D                   / Double
+TUNIT#  = Msun                 / Units of field
+TTYPE#  = T0_2                 / Epoch of periastron [2nd orbit] 
+TFORM#  = 1D                   / Double
+TUNIT#  = MJD                  / Units of field
+TTYPE#  = PB_2                 / Binary period of pulsar [2nd orbit]
+TFORM#  = 1D                   / Double
+TUNIT#  = d                    / Units of field
+TTYPE#  = A1_2                 / asin(i) of 2nd orbit
+TFORM#  = 1D                   / Double
+TUNIT#  = s                    / Units of field
+TTYPE#  = OM_2                 / [deg] Longitude of periastron [2nd orbit]
+TFORM#  = 1D                   / Double
+TUNIT#  = deg                  / Units of field
+TTYPE#  = ECC_2                / Eccentricity [2nd orbit]
+TFORM#  = 1D                   / Double
+TTYPE#  = DTHETA               / Relativistic deformation of the orbit
+TFORM#  = 1D                   / Double
+TTYPE#  = A1DOT                / Rate of change of asin(i) 
+TFORM#  = 1D                   / Double
+TTYPE#  = ECCDOT               / Rate of change of eccentricity 
+TFORM#  = 1D                   / Double
+TUNIT#  = s**(-1)              / Units of field
+TTYPE#  = TASC                 / Epoch of ascending node
+TFORM#  = 1D                   / Double
+TUNIT#  = MJD                  / Units of field
+TTYPE#  = EPS1                 / ECC sin(OM) (ELL1 binary model)
+TFORM#  = 1D                   / Double
+TTYPE#  = EPS2                 / ECC cos(OM) (ELL1 binary model)
+TFORM#  = 1D                   / Double
+TTYPE#  = EPS1DOT              / Time derivative of EPS1
+TFORM#  = 1D                   / Double
+TUNIT#  = s**(-1)              / Units of field
+TTYPE#  = EPS2DOT              / Time derivative of EPS2
+TFORM#  = 1D                   / Double
+TUNIT#  = s**(-1)              / Units of field
+TTYPE#  = OM2DOT               / Second time derivative of omega 
+TFORM#  = 1D                   / Double
+TUNIT#  = rad s**(-2)          / Units of field
+TTYPE#  = XOMDOT               / Omega-dot minus GR prediction 
+TFORM#  = 1D                   / Double
+TUNIT#  = deg/yr               / Units of field
+TTYPE#  = XPBDOT               / Pbdot minus GR prediction 
+TFORM#  = 1D                   / Double
+TTYPE#  = MTOT                 / [M_sun] Total system mass 
+TFORM#  = 1D                   / Double
+TUNIT#  = Msun                 / Units of field
+TTYPE#  = DR                   / Relativistic deformation of the orbit
+TFORM#  = 1D                   / Double
+TTYPE#  = X2DOT                / Second time derivative of x=a1 
+TFORM#  = 1D                   / Double
+TUNIT#  = s**(-1)              / Units of field
+TTYPE#  = PMRV                 / Radial proper motion 
+TFORM#  = 1D                   / Double
+TUNIT#  = mas/yr               / Units of field
+TTYPE#  = START                / Epoch of start of fit
+TFORM#  = 1D                   / Double
+TUNIT#  = MJD                  / Units of field
+TTYPE#  = FINISH               / Epoch of end of fit
+TFORM#  = 1D                   / Double
+TUNIT#  = MJD                  / Units of field
+TTYPE#  = TRES                 / RMS timing residual
+TFORM#  = 1D                   / Double
+TUNIT#  = mus                  / Units of field
+TTYPE#  = NTOA                 / Number of TOAs in timing fit
+TFORM#  = 1I                   / Integer
+TNULL#  = 1                    / Null value used by fits_write_col_null
+TTYPE#  = CLK                  / Terrestrial time standard
+TFORM#  = 12A                  / 12-char string
+TTYPE#  = EPHEM                / Solar system ephemeris
+TFORM#  = 12A                  / 12-char string
+TTYPE#  = TZRIMJD              / Reference TOA (Integer part)
+TFORM#  = 1J                   / Long Integer
+TUNIT#  = MJD                  / Units of field
+TTYPE#  = TZRFMJD              / Reference TOA (Fractional part)
+TFORM#  = 1D                   / Double
+TUNIT#  = d                    / Units of field
+TTYPE#  = TZRFRQ               / Frequency of reference TOA
+TFORM#  = 1D                   / Double
+TUNIT#  = MHz                  / Units of field
+TTYPE#  = TZRSITE              / Observatory code of reference TOA
+TFORM#  = 8A                   / 8-char string
+TTYPE#  = GLEP_1               / Epoch [Tempo Glitch 1]
+TFORM#  = 1D                   / Double
+TUNIT#  = MJD                  / Units of field
+TTYPE#  = GLPH_1               / Phase increment [Tempo Glitch 1]
+TFORM#  = 1D                   / Double
+TTYPE#  = GLF0_1               / Permanent pulse freq increment [Glitch 1]
+TFORM#  = 1D                   / Double
+TUNIT#  = Hz                   / Units of field
+TTYPE#  = GLF1_1               / Permanent freq deriv incr. [Glitch 1] 
+TFORM#  = 1D                   / Double
+TUNIT#  = s**(-2)              / Units of field
+TTYPE#  = GLF0D_1              / Spin freq increment [Decaying Glitch 1]
+TFORM#  = 1D                   / Double
+TUNIT#  = Hz                   / Units of field
+#
+# New parameters for TEMPO2, ignored for EPHVER < 5
+#
+TTYPE#  = ECLOBL               / Ecliptic obliquity 
+TFORM#  = 1D                   / Double
+TUNIT#  = arcsec               / Units of field
+TTYPE#  = IPM                  / Correct for interplanetary dispersion 
+TFORM#  = 1I                   / Integer flag
+TNULL#  = 1                    / Default = True
+TTYPE#  = TEMPO1               / Tempo1 emulation mode 
+TFORM#  = 1I                   / Integer flag
+TNULL#  = 0                    / Default = False
+TTYPE#  = DILATEFREQ           / Correct obs frequency for time dilation 
+TFORM#  = 1I                   / Integer flag
+TNULL#  = 1                    / Default = True
+TTYPE#  = NO_SS_SHAPIRO        / Turn of all solar system Shapiro delays
+TFORM#  = 1I                   / Integer flag
+TNULL#  = 0                    / Default = False
+TTYPE#  = PLANET_SHAPIRO       / Account for planetary Shapiro delays 
+TFORM#  = 1I                   / Integer flag
+TNULL#  = 1                    / Default = True
+TTYPE#  = CORRECT_TROPO        / Correct for tropospheric delays 
+TFORM#  = 1I                   / Integer flag
+TNULL#  = 1                    / Default = True
+TTYPE#  = UNITS                / Units for SSB timescale (SI, TDB) 
+TFORM#  = 4A                   / String
+TNULL#  = SI                   / Default = SI
+TTYPE#  = NE1AU                / Solar electron density scale @1AU
+TFORM#  = 1D                   / Double
+TUNIT#  = cm**(-3) pc          / Units of field
+TTYPE#  = TIMEEPH              / Time ephemeris code to use (IF99, fb90)
+TFORM#  = 6A                   / String
+TNULL#  = IF99                 / Default = IF99
+TTYPE#  = T2CMETHOD            / Polar Motion/Prec/Nut code (IAU2000B, TEMPO)
+TFORM#  = 9A                   / String
+TNULL#  = IAU2000B             / Default = IAU2000B
+TTYPE#  = DMFACTOR             / DM/Dispersion Constant 
+TFORM#  = 1D                   / Double
+TUNIT#  = cm**(-3) pc s**(-3)  / Units of field
+TTYPE#  = DMEPOCH              / Epoch for DM 
+TFORM#  = 1D                   / Double
+TUNIT#  = MJD                  / Units of field
+TTYPE#  = FDDC                 / Scale of freq-dependent delay 
+TFORM#  = 1D                   / Double
+TUNIT#  = s MHz**(-FDDI)       / Units of field
+TTYPE#  = FDDI                 / Spectral index of freq-dependent delay
+TFORM#  = 1D                   / Double
+TTYPE#  = MSS                  / Use Wex 1988 "MSS" in T2 binary model 
+TFORM#  = 1I                   / Integer flag
+TNULL#  = 0                    / Default = False
+TTYPE#  = BINIT                / Iterate to invert binary timing formula
+TFORM#  = 1I                   / Integer flag
+TNULL#  = 1                    / Default = True
+TTYPE#  = SHAPMAX              / -ln(1-sini) Shapiro delay parameter
+TFORM#  = 1D                   / Double
+TTYPE#  = KOM                  / Position angle of ascending node 
+TFORM#  = 1D                   / Double
+TUNIT#  = deg                  / Units of field
+TTYPE#  = KIN                  / Inclination of orbit, for Kopeikin terms
+TFORM#  = 1D                   / Double
+TUNIT#  = deg                  / Units of field
+TTYPE#  = KMPRA                / PMRA for Kopeikin term 
+TFORM#  = 1D                   / Double
+TUNIT#  = mas/yr               / Units of field
+TTYPE#  = KPMDEC               / PMDEC for Kopeikin term 
+TFORM#  = 1D                   / Double
+TUNIT#  = mas/yr               / Units of field
+TTYPE#  = KPMELONG             / PMELONG for Kopeikin term
+TFORM#  = 1D                   / Double
+TUNIT#  = mas/yr               / Units of field
+TTYPE#  = KPMELAT              / PMELAT for Kopeikin term 
+TFORM#  = 1D                   / Double
+TUNIT#  = mas/yr               / Units of field
+TTYPE#  = RV                   / Radial velocity 
+TFORM#  = 1D                   / Double
+TUNIT#  = km/s                 / Units of field
+TTYPE#  = RVS                  / Radial velocity for Shklovskii-dot term
+TFORM#  = 1D                   / Double
+TUNIT#  = km/s                 / Units of field
+TTYPE#  = VT                   / Transverse velocity for Doppler term
+TFORM#  = 1D                   / Double
+TUNIT#  = m s**(-2)            / Units of field
+TTYPE#  = RACC                 / Radial acceleration 
+TFORM#  = 1D                   / Double
+TUNIT#  = m s**(-2)            / Units of field
+TTYPE#  = PMACC                / Accel parallel to proper motion 
+TFORM#  = 1D                   / Double
+TUNIT#  = m s**(-2)            / Units of field
+TTYPE#  = D_SHK                / Distance for Shklovskii term 
+TFORM#  = 1D                   / Double
+TUNIT#  = kpc                  / Units of field
+TTYPE#  = D_AOP                / Distance for annual-orbital parallax 
+TFORM#  = 1D                   / Double
+TUNIT#  = kpc                  / Units of field
+TTYPE#  = D_OP                 / Distance for orbital parallax 
+TFORM#  = 1D                   / Double
+TUNIT#  = kpc                  / Units of field
+TTYPE#  = WAVE_FREQ            / Fundamental FITWAVE frequency
+TFORM#  = 1D                   / Double
+TUNIT#  = Hz                   / Units of field
+TTYPE#  = WAVES_1              / FITWAVE sine component amplitude
+TFORM#  = 1D                   / Double
+TUNIT#  = s                    / Units of field
+TTYPE#  = WAVEC_1              / FITWAVE cosine component amplitude
+TFORM#  = 1D                   / Double
+TUNIT#  = s                    / Units of field
+END
+#
+###############################################################################
+#
+# TEMPO1 Polyco History Binary Table Extension
+#
+###############################################################################
+#
+XTENSION= BINTABLE             / ***** Polyco history *****
+BITPIX  =                    8 / N/A 
+NAXIS   =                    2 / 2-dimensional binary table
+NAXIS1  =                    * / width of table in bytes
+NAXIS2  =                    * / number of rows in table
+PCOUNT  =                    0 / size of special data area
+GCOUNT  =                    1 / one data group (required keyword)
+TFIELDS =                   13 / Number of fields per row
+#
+EXTNAME = POLYCO               / name of this binary table extension
+#
+TTYPE#  = DATE_PRO             / Processing date and time (UTC)
+TFORM#  = 24A                  / 24-char string
+TTYPE#  = POLYVER              / Polyco version ID
+TFORM#  = 16A                  / 16-char string
+TTYPE#  = NSPAN                / Span of polyco in min
+TFORM#  = 1I                   / Integer
+TTYPE#  = NCOEF                / Nr of coefficients (<=15)
+TFORM#  = 1I                   / Integer
+TTYPE#  = NPBLK                / Nr of blocks (rows) for this polyco
+TFORM#  = 1I                   / Integer
+TTYPE#  = NSITE                / Observatory code
+TFORM#  = 8A                   / 8-char string
+TTYPE#  = REF_FREQ             / Reference frequency for phase
+TFORM#  = 1D                   / Double
+TUNIT#  = MHz                  / Units of field
+TTYPE#  = PRED_PHS             / Predicted pulse phase at obs start
+TFORM#  = 1D                   / Double
+TTYPE#  = REF_MJD              / Reference MJD
+TFORM#  = 1D                   / Double
+TTYPE#  = REF_PHS              / Reference phase
+TFORM#  = 1D                   / Double
+TTYPE#  = REF_F0               / Zero-order pulsar frequency
+TUNIT#  = Hz                   / Units of field
+TFORM#  = 1D                   / Double
+TTYPE#  = LGFITERR             / Log_10 of polynomial fit rms error in periods
+TFORM#  = 1D                   / Double
+TTYPE#  = COEFF                / Polyco coefficients
+TFORM#  = 15D                  / NCOEF doubles
+END
+#
+###############################################################################
+#
+# TEMPO2 Predictor History Binary Table Extension
+#
+###############################################################################
+#
+XTENSION= BINTABLE             / ***** Tempo2 Predictor history *****
+BITPIX  =                    8 / N/A 
+NAXIS   =                    2 / 2-dimensional binary table
+NAXIS1  =                    * / width of table in bytes
+NAXIS2  =                    * / number of rows in table
+PCOUNT  =                    0 / size of special data area
+GCOUNT  =                    1 / one data group (required keyword)
+TFIELDS =                    1 / Number of fields per row
+#
+EXTNAME = T2PREDICT            / name of this binary table extension
+#
+TTYPE#  = PREDICT              / Whole text file is stored verbatim
+TFORM#  = A 
+END
+#
+###############################################################################
+#
+# Flux Calibration Data Binary Table Extension
+#
+###############################################################################
+#
+XTENSION= BINTABLE             / ***** Flux Calibration Data *****
+BITPIX  =                    8 / N/A 
+NAXIS   =                    2 / 2-dimensional binary table
+NAXIS1  =                    * / width of table in bytes
+NAXIS2  =                    1 / number of rows in table
+PCOUNT  =                    0 / size of special data area
+GCOUNT  =                    1 / one data group (required keyword)
+TFIELDS =                    6 / Number of fields per row
+#
+EXTNAME = FLUX_CAL             / name of this binary table extension
+CAL_MTHD=                      / Flux cal method
+SCALFILE=                      / Cal file(s) used to derive flux-cal data
+NCHAN   =                    * / Nr of frequency channels (I)
+NRCVR   =                    * / Number of receiver channels (I)
+EPOCH   =                      / [MJD] Epoch of calibration obs
+#
+TTYPE#  = DAT_FREQ             / Centre frequency for each channel
+TFORM#  = E                    / NCHAN floats
+TUNIT#  = MHz                  / Units of field
+TTYPE#  = DAT_WTS              / Weights for each channel
+TFORM#  = E                    / NCHAN floats
+TTYPE#  = S_SYS                / System equiv. flux density for each rcvr chan.
+TDIM#   = (*,*)                / Dimensions (NCHAN,NRCVR)
+TFORM#  = E                    / NCHAN*NRCVR floats
+TUNIT#  = Jy        
+TTYPE#  = S_SYSERR             / Est. error of system equiv. flux density
+TDIM#   = (*,*)                / Dimensions (NCHAN,NRCVR)
+TFORM#  = E                    / NCHAN*NRCVR floats
+TUNIT#  = Jy        
+TTYPE#  = S_CAL                / Calibrator flux density for each rcvr channel
+TDIM#   = (*,*)                / Dimensions (NCHAN,NRCVR)
+TFORM#  = E                    / NCHAN*NRCVR floats
+TUNIT#  = Jy        
+TTYPE#  = S_CALERR             / Estimated error of calibrator flux density
+TDIM#   = (*,*)                / Dimensions (NCHAN,NRCVR)
+TFORM#  = E                    / NCHAN*NRCVR floats
+TUNIT#  = Jy      
+END
+#
+###############################################################################
+#
+# Artificial Calibrator Stokes Parameters Binary Table Extension
+#
+###############################################################################
+#
+XTENSION= BINTABLE             / ***** Artificial Calibrator Stokes Data *****
+BITPIX  =                    8 / N/A 
+NAXIS   =                    2 / 2-dimensional binary table
+NAXIS1  =                    * / width of table in bytes
+NAXIS2  =                    1 / number of rows in table
+PCOUNT  =                    0 / size of special data area
+GCOUNT  =                    1 / one data group (required keyword)
+TFIELDS =                    3 / Number of fields per row
+#
+EXTNAME = CAL_POLN             / name of this binary table extension
+NCHAN   =                    * / Nr of channels in flux cal file
+#
+TTYPE#  = DAT_WTS              / Weights for each channel
+TFORM#  = E                    / NCHAN floats
+TTYPE#  = DATA                 / Stokes (Q,U,V) of calibrator rel. to Cal I
+TFORM#  = E                    / 3*NCHAN floats
+TTYPE#  = DATAERR              / Estimated error of Stokes (Q,U,V)
+TFORM#  = E                    / 3*NCHAN floats
+END
+#
+###############################################################################
+#
+# Feed Cross-Coupling Parameters Binary Table Extension
+#
+###############################################################################
+#
+XTENSION= BINTABLE             / ***** Feed Cross-Coupling parameters *****
+BITPIX  =                    8 / N/A 
+NAXIS   =                    2 / 2-dimensional binary table
+NAXIS1  =                    * / width of table in bytes
+NAXIS2  =                    1 / number of rows in table
+PCOUNT  =                    0 / size of special data area
+GCOUNT  =                    1 / one data group (required keyword)
+TFIELDS =                    3 / Number of fields per row
+#
+EXTNAME = FEEDPAR              / Name of this binary table extension
+CAL_MTHD= '                  ' / Cross-coupling method
+NCPAR   =                    * / Number of coupling parameters
+NCHAN   =                    * / Nr of channels in Feed coupling data
+EPOCH   = '                  ' / [MJD] Epoch of calibration obs
+#
+TTYPE#  = DAT_FREQ             / [MHz] Centre frequency for each channel
+TFORM#  = E                    / NCHAN floats
+TUNIT#  = MHz                  / Units of field
+TTYPE#  = DAT_WTS              / Weights for each channel
+TFORM#  = E                    / NCHAN floats
+TTYPE#  = DATA                 / Cross-coupling data
+TDIM#   = (*,*)                / Dimensions (NCHAN,NCPAR)
+TFORM#  = E                    / NCHAN*NCPAR floats
+TTYPE#  = DATAERR              / Estimated error of cross-coupling data
+TDIM#   = (*,*)                / Dimensions (NCHAN,NCPAR)
+TFORM#  = E                    / NCHAN*NCPAR floats
+END
+#
+###############################################################################
+#
+# Subintegration data Binary Table Extension
+#
+###############################################################################
+#
+XTENSION= BINTABLE             / ***** Subintegration data  *****
+BITPIX  =                    8 / N/A
+NAXIS   =                    2 / 2-dimensional binary table
+NAXIS1  =                    * / width of table in bytes 
+NAXIS2  =                    * / Number of rows in table (NSUBINT)
+PCOUNT  =                    0 / size of special data area
+GCOUNT  =                    1 / one data group (required keyword)
+TFIELDS =                   19 / Number of fields per row
+# 
+INT_TYPE= '                  ' / Time axis (TIME, BINPHSPERI, BINLNGASC, etc)
+INT_UNIT= '                  ' / Unit of time axis (SEC, PHS (0-1), DEG)    
+NCH_FILE=                    * / Number of channels/sub-bands in this file
+NCH_STRT=                    * / Start channel/sub-band number (0 to NCHAN-1)
+EXTNAME = SUBINT               / name of this binary table extension
+#
+TTYPE#  = ISUBINT              / Subint number
+TFORM#  = 1J                   / Long integer
+TTYPE#  = INDEXVAL             / Optionally used if INT_TYPE != TIME
+TFORM#  = 1D                   / Double
+TTYPE#  = TSUBINT              / Length of subintegration
+TFORM#  = 1D                   / Double 
+TUNIT#  = s                    / Units of field
+TTYPE#  = OFFS_SUB             / Offset from Start of subint centre
+TFORM#  = 1D                   / Double 
+TUNIT#  = s                    / Units of field
+TTYPE#  = LST_SUB              / LST at subint centre 
+TFORM#  = 1D                   / Double 
+TUNIT#  = s                    / Units of field
+TTYPE#  = RA_SUB               / RA (J2000) at subint centre
+TFORM#  = 1D                   / Double 
+TUNIT#  = turns                / Units of field
+TTYPE#  = DEC_SUB              / [turns] Dec (J2000) at subint centre
+TFORM#  = 1D                   / Double 
+TUNIT#  = turns                / Units of field
+TTYPE#  = GLON_SUB             / [deg] Gal longitude at subint centre
+TFORM#  = 1D                   / Double 
+TUNIT#  = deg                  / Units of field
+TTYPE#  = GLAT_SUB             / [deg] Gal latitude at subint centre
+TFORM#  = 1D                   / Double 
+TUNIT#  = deg                  / Units of field
+TTYPE#  = FD_ANG               / [deg] Feed angle at subint centre
+TFORM#  = 1E                   / Float
+TUNIT#  = deg                  / Units of field
+TTYPE#  = POS_ANG              / [deg] Position angle of feed at subint centre
+TFORM#  = 1E                   / Float
+TUNIT#  = deg                  / Units of field
+TTYPE#  = PAR_ANG              / [deg] Parallactic angle at subint centre
+TFORM#  = 1E                   / Float
+TUNIT#  = deg                  / Units of field
+TTYPE#  = TEL_AZ               / [deg] Telescope azimuth at subint centre
+TFORM#  = 1E                   / Float 
+TUNIT#  = deg                  / Units of field
+TTYPE#  = TEL_ZEN              / [deg] Telescope zenith angle at subint centre
+TFORM#  = 1E                   / Float
+TUNIT#  = deg                  / Units of field
+TTYPE#  = DAT_FREQ             / [MHz] Centre frequency for each channel
+TFORM#  = E                    / NCH_FILE floats
+TUNIT#  = deg                  / Units of field
+TTYPE#  = DAT_WTS              / Weights for each channel
+TFORM#  = E                    / NCH_FILE floats
+TTYPE#  = DAT_OFFS             / Data offset for each channel
+TFORM#  = E                    / NCH_FILE*NPOL floats
+TTYPE#  = DAT_SCL              / Data scale factor for each channel
+TFORM#  = E                    / NCH_FILE*NPOL floats
+TTYPE#  = DATA                 / Subint data table
+TDIM#   = (*,*,*)              / Dimensions of data table = (NBIN,NCH_FILE,NPOL)
+TFORM#  = I                    / NBIN*NCH_FILE*NPOL integers
+TUNIT#  = Jy                   / Units of subint data
+END
+
+
+
+
+
+
+
+\end
Index: trunk/templates/psrheaderSimple.txt
===================================================================
--- trunk/templates/psrheaderSimple.txt	(revision 4)
+++ trunk/templates/psrheaderSimple.txt	(revision 4)
@@ -0,0 +1,127 @@
+SIMPLE  =                    T / file does conform to FITS standard
+BITPIX  =                    8 / number of bits per data pixel
+NAXIS   =                    0 / number of data axes
+EXTEND  =                    T / FITS dataset may contain extensions
+COMMENT   FITS (Flexible Image Transport System) format defined in Astronomy and
+COMMENT   Astrophysics Supplement Series v44/p363, v44/p371, v73/p359, v73/p365.
+COMMENT   Contact the NASA Science Office of Standards and Technology for the
+COMMENT   FITS Definition document #100 and other FITS information.
+COMMENT
+HDRVER  = '2.4             '   / Header version 
+DATE    = '                '   / File creation date (YYYY-MM-DDThh:mm:ss UTC)
+OBSERVER= '                '   / Observer name(s)
+PROJID  = '                '   / Project name
+TELESCOP= '                '   / Telescope name
+ANT_X   = *                    / [m] Antenna ITRF X-coordinate (D)
+ANT_Y   = *                    / [m] Antenna ITRF Y-coordinate (D)
+ANT_Z   = *                    / [m] Antenna ITRF Z-coordinate (D)
+FRONTEND= '                '   / Rx and feed ID
+FD_POLN = '                '   / LIN or CIRC
+FD_HAND = *                    / +/- 1. +1 is LIN:A=X,B=Y, CIRC:A=L,B=R (I)
+FD_SANG = *                    / [deg] FA of E vect for equal sig in A&B (E)
+FD_XYPH = *                    / [deg] Phase of A^* B for injected cal (E)
+BACKEND = '                '   / Backend ID
+BECONFIG= '                '   / Backend configuration file name
+BE_PHASE= *                    / 0/+1/-1 BE cross-phase:0 unknown,+/-1 std/rev
+BE_DCC  = *                    / 0/1 BE downconversion conjugation corrected
+TCYCLE  = *                    / [s] On-line cycle time (D)
+NRCVR   = *                    / Number of receiver channels (I)
+OBS_MODE= '                '   / (PSR, CAL, SEARCH)
+SRC_NAME= '                '   / Source or scan ID 
+COORD_MD= '                '   / Coordinate mode (J2000, Gal, Ecliptic, etc.)
+STT_CRD1= '                '   / Start coord 1 (hh:mm:ss.sss or ddd.ddd)
+STT_CRD2= '                '   / Start coord 2 (-dd:mm:ss.sss or -dd.ddd) 
+TRK_MODE= '                '   / Track mode (TRACK, SCANGC, SCANLAT)
+STP_CRD1= '                '   / Stop coord 1 (hh:mm:ss.sss or ddd.ddd)
+STP_CRD2= '                '   / Stop coord 2 (-dd:mm:ss.sss or -dd.ddd) 
+SCANLEN = *                    / [s] Requested scan length (E)
+FD_MODE = '                '   / Feed track mode - FA, CPA, SPA, TPA
+FA_REQ  = *                    / [deg] Feed/Posn angle requested (E)
+CAL_MODE= '                '   / Cal mode (OFF, SYNC, EXT1, EXT2)
+CAL_FREQ= *                    / [Hz] Cal modulation frequency (E)
+CAL_DCYC= *                    / Cal duty cycle (E)
+CAL_PHS = *                    / Cal phase (wrt start time) (E)
+STT_DATE= '                '   / Start UT date (YYYY-MM-DD)
+STT_TIME= '                '   / Start UT (hh:mm:ss)
+STT_IMJD= *                    / Start MJD (UTC days) (J - long integer)
+STT_SMJD= *                    / [s] Start time (sec past UTC 00h) (J)
+STT_OFFS= *                    / [s] Start time offset (D)   
+STT_LST = *                    / [s] Start LST (D)
+END
+#
+###############################################################################
+#
+# Subintegration data Binary Table Extension
+#
+###############################################################################
+#
+XTENSION= BINTABLE             / ***** Subintegration data  *****
+BITPIX  =                    8 / N/A
+NAXIS   =                    2 / 2-dimensional binary table
+NAXIS1  =                    * / width of table in bytes 
+NAXIS2  =                    * / Number of rows in table (NSUBINT)
+PCOUNT  =                    0 / size of special data area
+GCOUNT  =                    1 / one data group (required keyword)
+TFIELDS =                   19 / Number of fields per row
+# 
+INT_TYPE= '                  ' / Time axis (TIME, BINPHSPERI, BINLNGASC, etc)
+INT_UNIT= '                  ' / Unit of time axis (SEC, PHS (0-1), DEG)    
+NCH_FILE=                    * / Number of channels/sub-bands in this file
+NCH_STRT=                    * / Start channel/sub-band number (0 to NCHAN-1)
+EXTNAME = SUBINT               / name of this binary table extension
+#
+TTYPE#  = ISUBINT              / Subint number
+TFORM#  = 1J                   / Long integer
+TTYPE#  = INDEXVAL             / Optionally used if INT_TYPE != TIME
+TFORM#  = 1D                   / Double
+TTYPE#  = TSUBINT              / Length of subintegration
+TFORM#  = 1D                   / Double 
+TUNIT#  = s                    / Units of field
+TTYPE#  = OFFS_SUB             / Offset from Start of subint centre
+TFORM#  = 1D                   / Double 
+TUNIT#  = s                    / Units of field
+TTYPE#  = LST_SUB              / LST at subint centre 
+TFORM#  = 1D                   / Double 
+TUNIT#  = s                    / Units of field
+TTYPE#  = RA_SUB               / RA (J2000) at subint centre
+TFORM#  = 1D                   / Double 
+TUNIT#  = turns                / Units of field
+TTYPE#  = DEC_SUB              / [turns] Dec (J2000) at subint centre
+TFORM#  = 1D                   / Double 
+TUNIT#  = turns                / Units of field
+TTYPE#  = GLON_SUB             / [deg] Gal longitude at subint centre
+TFORM#  = 1D                   / Double 
+TUNIT#  = deg                  / Units of field
+TTYPE#  = GLAT_SUB             / [deg] Gal latitude at subint centre
+TFORM#  = 1D                   / Double 
+TUNIT#  = deg                  / Units of field
+TTYPE#  = FD_ANG               / [deg] Feed angle at subint centre
+TFORM#  = 1E                   / Float
+TUNIT#  = deg                  / Units of field
+TTYPE#  = POS_ANG              / [deg] Position angle of feed at subint centre
+TFORM#  = 1E                   / Float
+TUNIT#  = deg                  / Units of field
+TTYPE#  = PAR_ANG              / [deg] Parallactic angle at subint centre
+TFORM#  = 1E                   / Float
+TUNIT#  = deg                  / Units of field
+TTYPE#  = TEL_AZ               / [deg] Telescope azimuth at subint centre
+TFORM#  = 1E                   / Float 
+TUNIT#  = deg                  / Units of field
+TTYPE#  = TEL_ZEN              / [deg] Telescope zenith angle at subint centre
+TFORM#  = 1E                   / Float
+TUNIT#  = deg                  / Units of field
+TTYPE#  = DAT_FREQ             / [MHz] Centre frequency for each channel
+TFORM#  = E                    / NCH_FILE floats
+TUNIT#  = deg                  / Units of field
+TTYPE#  = DAT_WTS              / Weights for each channel
+TFORM#  = E                    / NCH_FILE floats
+TTYPE#  = DAT_OFFS             / Data offset for each channel
+TFORM#  = E                    / NCH_FILE*NPOL floats
+TTYPE#  = DAT_SCL              / Data scale factor for each channel
+TFORM#  = E                    / NCH_FILE*NPOL floats
+TTYPE#  = DATA                 / Subint data table
+TDIM#   = (*,*,*)              / Dimensions of data table = (NBIN,NCH_FILE,NPOL)
+TFORM#  = I                    / NBIN*NCH_FILE*NPOL integers
+TUNIT#  = Jy                   / Units of subint data
+END
+
Index: trunk/templates/simpletabletemplate.fits
===================================================================
--- trunk/templates/simpletabletemplate.fits	(revision 4)
+++ trunk/templates/simpletabletemplate.fits	(revision 4)
@@ -0,0 +1,9 @@
+  xtension = bintable
+  naxis2 = 40
+  ttype# = Name
+  tform# = 10a
+  ttype# = Npoints
+  tform# = j
+  ttype# = Rate
+  tunit# = counts/s
+  tform# = e
Index: trunk/templates/simpletemplate.fits
===================================================================
--- trunk/templates/simpletemplate.fits	(revision 4)
+++ trunk/templates/simpletemplate.fits	(revision 4)
@@ -0,0 +1,6 @@
+SIMPLE  = T
+BITPIX  = 32
+NAXIS   = 2     / number of dimensions
+NAXIS1  = 100  / length of first axis
+NAXIS2  = 200  / length of second axis
+OBJECT  = NGC 253 / name of observed object
