spectral line fits hdr for wapps (idl was routines)

13apr04
links:
arecibo single dish fits header description.
a description of the position/offset variables in the fits header.
outstanding issues with the fits writer.
the dataking programs running on the wapps.
 

Here is an ongoing description of the fits spectral line header used on the wapps (it is not complete). The stat column has ??,fix, or chk  for elements that I'm not clear on. The src column is my best guess at where this header element came from.

Abbreviations:

    bt. required binary extension keyword
    btr: binary table reserved keyword
    sdf: single dish fits core keywords (from harvey liszt 1995 draft or nrao sdfits html page)
    sdfsh: sdf shared keyword
     sh : fits shared keyword

Terminology:

    Here is a straw man proposal for how we refer to different parts of raw data taken at the telescope. An example is a position switch observation with 5 minutes on source, 5 minutes off source, and a 10 seond calon/caloff at the end.  Both polarizations would be recorded and 4 separatefrequency bands would be used. The data would be dumped in once a second for rfi editing.

arecibo sdf header (21may08 .. names now complete..).
name 
(TTYPE)
Dtype/val 
(Tform)
src stat description




START EXTN HEADER. following keywords order is required
XTENSION 'BINTABLE' bt

BITPIX 8 bt
 8 bit bytes
NAXIS 2 bt
table is 2-D
NAXIS1 360 bt
row Len in bytes
NAXIS2 int bt
number of rows in table
PCOUNT int bt
number of bytes end of table to end of heap.
GCOUNT 1 bt
data records contain a single table
TFIELDS 66 bt
number of fields (columns) in the table




end required keyword order. 
start non-table keywords
EXTNAME
'CIMAFITS'


 CIMAFITS is the standard Arecibo FITS-format
VERSION
1.10


CIMAFITS version number
VER_DATE
'2008-04-01'


Date when this CIMAFITS version was installed
THEAP int btr
offset in bytes from start of main data table to start of heap.
OBSERVER
'observers name'


Observer's name
PROJID
'a2327   '


Project ID string
OBSID
'a2327   '



BACKEND
'WAPP    '


Name of backend
STIME
 20


[ns] Correlator sampling interval
TELESCOP
'ARECIBO 305m'


Telescope name
OBSGEO-X
        2390486.9000


Lat=atan2(Z,sqrt(X*X+Y*Y))
OBSGEO-Y
-5564731.4400


Long=atan2(Y,X)
OBSGEO-Z
1994720.4500


From VLBI, courtesy T. Ghosh
STARTON
                    0


Start on 0, 1, or 10 sec tick
RADESYS
'FK5     '


Main coordinate system is always FK5
EQUINOX
2000.0000


Main coordinate system is always J2000




end non table keywords
start of table column definitions
1 DATA  PE(16384) sdf
array descriptor pointing to floating point data (E) with a maximum number of elements of 16384. The field contains two 32 bit entries. (nelements,byteoffsetStartofHelp)
2 TDIM1
16A


Dimensions of data pointed to in the heap
3 OBJECT 16A sdf
object name
axis notes


axis 1  frequency 
axis 2  longitude(ra) 
axis 3  latitude (dec) 
axis 4 polarization 
axis 5 time
 4 CRVAL1 double hz sdf
data axis 1. frequency at reference pixel.
 5 CDELT1 double hz sdf
frequency step at reference pixel.
 6 CRPIX1 double sdf
reference pixel (count from 1)
 7 CRVAL2 double deg sdf
longitude axis for data. 
'RA','GLON','ELON' + wcs projection code
 8 CRVAL3 double deg sdf
latitude axis for data: 
'DEC','GLAT,'ELAT' + wcs projection code
  9 CRVAL4 double  sdf ?? polarization (stokes) value for data. 
1,2,3,4 : I,Q,U,V  stokes parameters 
-1,-2,-3,-4:RR,LL,RL,LR correlation of circulars 
-5,-6,-7,-8,: XX,YY,XY,YX correlation of linears. 
is rr,xx spectra or correlation functions. Where do we specify that the data is in the time rather than the freq domain for line work??
10 CRVAL5 double (hours) ao ?? hours from OBSDATE. 
Is this at start, end, or middle of integration?? or is it start of scan?
11 DATE-OBS
16A
sh
?? yyyy-mm-dd start of this obs (UT). 
Is this start of scan or start of current integration??
12 TSYS double (K) sdf
system temperature
13 BANDWD double (Hz) sdf
total bandwidth of back end.
14 RESTFRQ double (Hz) sdfsh ??  Rest frequency for CRVAL2 and CRVAL3
Is this  at the reference freq pixel or the center of the rf band. Needs to be at the reference pixel..
15 RESTFRQG
double (Hz)


Rest frequency for CRVAL2G and CRVAL3G
16 SPECSYS
8A

Velocity frame for CRVAL2 and CRVAL3
17 SPECSYSG 8A


Velocity frame for CRVAL2G and CRVAL3G
18 REQ_VEL
double

Requested velocity or z in frame SPECSYS
19 REQ_VEL_UNIT
8A


Specifies units of REQ_VEL: either m/s or Z
20 REQ_VEL_TYPE
8A


Velocity type for REQ_VEL
21 MJD-OBS double  ao ?? julian date at exposure start. 
Start of  scan or rec. 
Does it have the full time resolution  (fraction of day)?
22 LST double (hours) sdfsh
local sidereal time at start of scan.
23 EXPOSURE double (secs) sdf ?? effective integration time. 
Is this for the current integration or the entire scan ??
24 REQ_RA
double (deg)


Requested long (usually RA) in REQ_RADESYS
25 REQ_DEC
double (deg)

Requested lat (usually DEC) in REQ_RADESYS
26 REQ_RADESYS
8A


Coordinate system used for REQ_RA and REQ_DEC
27 REQ_EQUINOX
8A


Epoch of requested position REQ_RA and REQ_DEC
28 REQ_RAJ
double (deg)

Requested RA J2000 antenna pointing
29 REQ_DECJ
double (deg)

Requested Dec J2000 antenna pointing
30 ENC_TIME



Time when encoders were read out (UTC)
31 ENC_AZIMUTH double (deg) ao ?? actual encoder az on sky (not feed)
Contains the model correction.
32 ENC_ELEVATIO double (deg) ao
actual encoder elevation. 
Contains the model correction.
33 ENC_ALTEL double (deg) ao
elevation for alternate encoder (the one not being used for observing).
34 OFFC1
double (deg) ao ?? Offset applied to crval2. If the rate is non zero and it is the same coordinate sys as the rate, then croff2 includes the rate times it's duration. 
35 OFFC2
double (deg) ao ?? Offset applied to crval3. see rate comment for croff2.
36 OFF_TIME double secs ao
This is the AST time stamp of the requested pointing data(raJ,decj). comes from st.x.pl.tm.secMid
37 RATE_C1 double deg/sec ao ?? rate for first coordinate. degrees/solarSecond.
Not necessarily an ra rate..
38 RATE_C2 double deg/sec ao ?? rate for 2nd coordiante. degrees/solarSecond
39  OFF_CS 8A

coord sys for offsets.J-j2000, B-1950,C
40 RATE_CS 8A ao
rate coordinate system. Coding same as off_cs above
41 RATE_DUR double Solarsec ao
how long rate has been applied (solar seconds).
42 CUR_ERR



Actual great circle tracking error
43  ALLOWED_ERR
double asecs ao
The encoder pointing error that determines when we are on source and tracking. When the cur_tol is less than this value the onsource keyword becomes true.
44 AZ_ERR
double asecs

Azimuth tracking error (actual-requested)
45 EL_ERR
double asecs

Elevation tracking error (actual-requested)
46 MODEL_OFFAZ
double degs ao
pointing model offset az. this is the model + encoder offsets+prf offsets
47 MODEL_OFFZA
double degs ao
pointing model offset za
48 BEAM_OFFAZ double degs

unrotated alfa beam offset az (great circle)
49 BEAM_OFFZA double  degs

unrotated alfa beam offset za
50 USER_OFFAZ
double degs

user commanded pointing offset az (gc?)
51 USER_OFFZA double degs

user commanded pointing offset za
52 RFEED_OFFAZ  double degs

rotated offset this beam az





53 RFEED_OFFZA
double degs

rotated offset  this beam za 
54 PRFEED_OFFAZ
double degs

offset to center prfeed beam az
55  PRFEED_OFFZA
double degs

offset to center prfeed beam za
56 BEAM_OFFRAJ
double degs

tot ra offset to this beam
57 BEAM_OFFDECJ
double deg

tot dec offset to this beam
58 AZIMUTH
double deg

True AZ pointing this beam on sky
59 ELEVATIO
double deg

True EL pointing this beam on sky
60 CRVAL2G
double deg

True galactic l pointing this beam on sky
61 CRVAL3G
double deg

True galactic b pointing this beam on sky
62 OFF_RA
double deg

True RA J2000 offset to commanded map center
63 OFF_DEC
double deg

True DEC J2000 offset to commanded map center
64 OFF_AZ
double deg

True AZ offset to commanded map center
65 OFF_ZA
double deg

True ZA offset to commanded map center
66 ALFA_ANG
double deg

ALFA rotation angle
67 PARA_ANG
double deg

Parallactic angle
68 VEL_BARY
double "m/sec"


Projected barycentric velocity (incl. VEL_GEO)
69 VEL_GEO
double "m/sec"


Projected geocentric velocity
70 FRONTEND 8A


ascii name for receiver used .
71 BACKENDMODE
24A


Backend mode description
72 CALTYPE
8A


Calibration type
73 OBSMODE 8A
ao
name of pattern: 
ONOFF,CAL,OFFON,DRIFT,ON,OFF
74 SCANTYPE
8A


Type of scan (as part of pattern - e.g. ON OFF)
75 PATERN_ID
INT*4


sequential observation number of obs_scan. Increments each integration. Count from 1 at start of scan. All records (rows) from the same integration will have the same obs_num. 
In terminology above, this is the group number.
76 SCAN_ID
INT*4


Unique number for scan YDDDnnnnn
77 SUBSCAN
INT*4


Sequential number of current subscan (dump)
78 TOT_SUBSCANS
INT*4


Total number of subscans (dumps) in scan
79 LAGS_IN
INT*4


Number of lags - same as bytes of data/4
80 BAD_DATA
INT*4


0->good data <>0->problem (see COMMENT)
81 PLAT_POWER double (db) ao
power read from upstairs IF power meter. Value includes 20db pad before meter. 
82 CNTRL_POWER double (db) ao
power read from downstairs IF power meter. Value includes 10 db pad before meter.
83 SYN1 double Hz ao
Frequency of first lo in Hz.
84 SYNFRQ double[4] Hz ao
Frequency of the 4 synthesizers that normally mix the first IF down to the 2nd IF. The order [0..3] maps to wapp1,2,3,4.
85 TOT_POWER double


This is the value of the 0 lag (which is the total power). It is linear in power. It is the ratio  of the measured/optimum power. A value of 1. has the input power level set for optimum statistics. 
The value read does not match the mean of the spectra (in the 4th digit).
86 WAPPMASK
INT*4


tells which wapps are being used and the number of acfs/spectra.
87 NTCAL
INT*4
ao
number of valid tcal pairs
88 TCAL_FRQ
32*DOUBLE


Frequencies for Tcal-values in TCAL_VAL
89 TCAL_VAL
32*DOUBLE


cal-values for frequencies in TCAL_FRQ
90 PRFEED
uchar


ALFA feed centered on this scan
91 NIFS uchar ao ?? number of IFS in this observation. Is this for 1 wapp or for all wapps that are being used simultaneously?
92 IFVAL uchar ao ?? polarization in use: 0,1, stokes:0-3. 
This is similar to crval4. It is important to have 
 if ifval 0 will always be the left rack (polA) and ifval 1 will always be the right rack (polB)? this would aid in debugging problems in the iflo. 
93 INPUT_ID
uchar


WAPP number 0-3 or 0-7 for ALFA (7=copy of 6)
94 UPPERSB uchar  ao ?? true if spectrum flipped. 
I think this is duplicating CDELTA1
95 ATTN_COR
uchar


Correlator attenuator: 0-15 dB
96 MASTER
uchar


 0=Gregorian dome 1=Carriage house
97 ONSOURCE
uchar


True if on-source at ENC_TIME
98 BLANKING
uchar


Blanking turned on
99 LBWHYB
uchar


LBandWide Hybrid is in (for circular pol)
100 SHCL
uchar

True if receiver shutter closed
101 SBSHCL
uchar

True if S-band receiver shutter closed
102 RFNUM
uchar

Platform position of the receiver selector
103 CALRCVMUX
uchar

Platform cal selector
104 ZMNORMAL
uchar

Platform transfer switch to reverse channels
105 RFATTN
2*uchar

Platform attenuator positions
106 IFNUM
uchar

Platform IF selector, 1/300 2/750, 3/1500, 4/10
107 IFATTN
2*uchar


Platform IF attenuator positions
108 FIBER
uchar

True if platform fiber chosen (usually true)
109 AC2SW
uchar

Platform AC power to various instruments etc
110 PHBSIG
uchar

Platform converter combiner signal ph adjust
111 HYBRID
uchar

 Platform converter combiner hybrid
112 PHBLO
uchar

Platform converter combiner LO phase adjust
113 XFNORMAL
uchar

Control room transfer switch true = default
114 NOISE
uchar

Control room noise on
115 AMPGAIN
2*uchar

Gain of control room amplifiers
116 INPFRQ
uchar

Control room input distributor position
117 MIXER
4*uchar

Control room mixer source switches
118 VLBAINP
uchar

Control room VLBA input switch position
119 AMPINP
4*uchar

Control room amplifier input source switches
120 EXTINP
4*uchar

Control room external input selector switches
121 SYNDEST
4*uchar

Control room synthesizer destinations
122 CALSRC
uchar

Control room cal source bit
123 CAL
uchar

Is cal bit turned on
124 VIS30MHZ
uchar

Control room greg 1 ch 0
125 PWRMET
uchar

Control room power meter input switch
126 BLANK430
uchar

Control room 430 blanking on

Notes:

Outstanding issues:

    Here is a list of things that need to be fixed. As they get fixed i'll update this table (although i may get a little behind).
 
date hdrLoc description
22jun04 crval5
h.std.time
crval5 for first record of the scan has the value 0.
subsequent records increment once a second
file:wapp.20040610.XALFA.0001.fits
scan:416162116
22jun04 crval5 time for integration. This has a value with a fractional second of .433
If the datataking starts on a 1 second tick and the exposure time is 1 second, then this fraction is suspicious.
22jun04 crval5
enc_time
After converting to the same time coordinate system (ast), crval5-enc_time is -1.58xx seconds.  enc_time is taken from scramnet memory. It is usually 1 or two seconds behind current time so its value should be less than crval5, not greater.
file:wapp.20040610.XALFA.0001.fits
scan:416162116
22jun04 pattern_scan pattern_scan : unique number for pattern YDDDnnnnn
this is always 0
22jun04 pattern_number pattern_number:sequential observation number of obs_scans
This is counting the integrations within a scan, not the scans within a pattern.
25may04 crval2,crval3
raJ,decJ
enc_azimuth
enc_elevatio
crval2,crval3 are the ra,dec positions. They do not agree with raJ,decJ  or (az,el and then back computing ra,dec).
This was for a cross scan (the azimuth leg).
file:wapp.20040610.XALFA.0001.fits
scan:416162116
20jul04 tot_power when in polarization mode, only acf's are being recorded. The total power is not being computed. The header does contain tot_power values from previous scans where the total_power was computed. If the total power is not being recorded then they should be set to 0. 
22aug04 beam_offaz,za the beam_off az,za in the fits header do not include the rotation angle.
22aug04 rotangle the feed array is rotating the opposite direction from what the gui wants.
15aug04 beam,pol data order for stokes data for stokes data the polarization data is not what the header tags say it is . auto and cross correlations are getting mixed up.
22aug04 enc_time
timestemp for pnt scramnet block.
The encoder time timestamp is for when the encoders were read. the raj,decj requested ra,dec also have a time stamp . It is included in the variable called off_time.
23aug04 model_offaz,za this is the model offset plus any encoder offsets and prf offsets. I thought that point_off was going to hold the encoder offsets???
23aug04 croff2,croff3 these include the rates*duration if the rates and offsets are in the same coordinate systems. If not, the it does not include the rates. This may not be obvious to people.
23aug04 pattern_scan this now has a scan number value. it is not being changed when new patterns start.


The datataking programs running on the wapps.


 
 
 
 
 

home_~phil