wapp_header_09.h
1/*
2 *****************************************************************************
3 *
4 * FILE: wapp_header.h
5 *
6 * This file contains header parameters for WAPP.
7 *
8 * This header as well as a copy of this file is included in the beginning
9 * of each WAPP pulsar file.
10 *
11 * Note the unusual start of this block --- otherwise it won't work with
12 * 'mkheader.l'.
13 *
14 * HISTORY
15 *
16 * who when what
17 * --------- ----------- ----------------------------------------------
18 * jeffh 28 Sep 2004 Original coding
19 * lerner 11 Jan 2005 Renamed gain to ampgain
20 * lerner 7 Dec 2007 Added 'backendmode', 'isdual' and 'caltype',
21 * changed 'iflo_flip' to two-valued array,
22 * increased 'synfrq', 'mixer' and 'syndest' from 4
23 * to 8 value-arrays, removed 'ampinp' and 'extinp'
24 * and increased HEADER_VERSION to 9
25 *
26 *****************************************************************************/
27
28
29
30//#define HEADER_VERSION 9
31
32/* lagformat for wapp_header */
33
34//#define INTLAGS 0 /* 16 bit integers - searching only */
35//#define LONGLAGS 1 /* 32 bit integers - searching only */
36//#define FLOATLAGS 2 /* 32 bit float ACF/CCFs folding only */
37//#define FLOATSPEC 3 /* 32 bit float fftd ACFs folding only */
38//#define BYTELAGS 4 /* 8 bit integers ACF/CCF searching only */
39//#define NIBBLAGS 5 /* 4 bit integers ACF/CCF searching only */
40//#define FOLD32 8 /* bit mask with FLOATLAGS and FLOATSPEC */
41 /* if on 32 bit folding is turned on */
42
43struct WAPP_HEADER_v9 {
44
45 int32_t header_version; /* some integer that increments with each revision */
46 int32_t header_size; /* size (in bytes) of this header (nom =1024) */
47 char obs_type[24]; /* what kind of observation is this */
48 /* PULSAR_SEARCH */
49 /* PULSAR_FOLDING */
50 /* SPECTRA_TOTALPOWER */
51/*
52 The following are obtained from current telescope status display
53 note that start AST/LST are for reference purposes only and should
54 not be taken as accurate time stamps. The time stamp can be derived
55 from the obs_date/start_time variables further down in the structure.
56*/
57 double src_ra; /* requested ra J2000 (10000*hr+100*min+sec) */
58 double src_dec; /* requested dec J2000 (10000*deg+100*min+sec) */
59 double start_az; /* telescope azimuth at start of scan (deg) */
60 double start_za; /* telescope zenith angle at start of scan (deg) */
61 double start_ast; /* AST at start of scan (sec) */
62 double start_lst; /* local siderial time at start of scan (sec) */
63/*
64 In the following, anything not supplied/requested by the user
65 is assumed to be calculated by WAPP when it writes the header
66*/
67 double cent_freq; /* user-supplied band center frequency (MHz) */
68 double obs_time; /* user-requested length of this integration (s) */
69 double samp_time; /* user-requested sample time (us) */
70 double wapp_time; /* actual sample time (us) i.e. requested+dead time */
71 double bandwidth; /* total bandwidth (MHz) for this observation */
72
73 int32_t num_lags; /* user-requested number of lags per dump per spect */
74 int32_t scan_number; /* built by WAPP from year+daynumber+3-digit-number */
75
76 char src_name[24]; /* user-supplied source name (usually pulsar name) */
77 char obs_date[24]; /* built by WAPP from yyyymmdd */
78 char start_time[24]; /* UT seconds after midnight (start on 1-sec tick) */
79 char project_id[24]; /* user-supplied AO proposal number (XNNNN) */
80 char observers[24]; /* observer(s) name(s) */
81 char frontend[24]; /* receiver abbrev name */
82 char backendmode[24];/* backend mode description */
83 char caltype[8]; /* calibrator type */
84
85 int32_t nifs; /* user-requested: number of IFs to be recorded */
86 int32_t level; /* user-requested: 1 means 3-level; 2 mean 9-level */
87 int32_t sum; /* user-requested: 1 means that data is sum of IFs */
88 int32_t freqinversion; /* 1 band is inverted, else band is not inverted */
89 int64_t timeoff; /* number of reads between obs start and snap block */
90 int32_t lagformat; /* 0=16 bit uint lags , 1=32 bit uint lags */
91 /* 2=32 bit float lags, 3=32 bit float spectra */
92 int32_t lagtrunc; /* if we truncate data (0 no trunc) */
93 /* for 16 bit lagmux modes, selects which 16 bits */
94 /* of the 32 are included as data */
95 /* 0 is bits 15-0 1,16-1 2,17-2...7,22-7 */
96 int32_t firstchannel; /* 0 when correlator channel a is first, 1 if b */
97 int32_t nbins; /* number of time bins for pulsar folding mode */
98 /* doubles as maxrecs for snap mode */
99 int32_t isfolding; /* is folding selected */
100 int32_t isalfa; /* is ALFA selected */
101 int32_t isdual; /* are WAPPs in dual board mode */
102 int32_t fold_bits; /* 0 if 16 bits (old default) 1 if 32 bit folding */
103 int32_t iflo_flip[2]; /* is signal flipped in each board */
104 int32_t attena; /* first board parallel port value */
105 int32_t attenb; /* second board parallel port value */
106 double dumptime; /* folded integrations for this period of time */
107 double power_analog[2]; /* power measured by analog detector */
108/*
109 In the following, pulsar-specific information is recorded for use
110 by folding programs e.g. the quick-look software. This is passed to
111 WAPP by psrcontrol at the start of the observation.
112
113 The apparent pulse phase and frequency at time "dt" minutes with
114 respect to the start of the observation are then calculated as:
115
116 phase = rphase + dt*60*f0 + coeff[0] + dt*coeff[1] + dt*dt*coeff[2] + ...
117 freq(Hz) = f0 + (1/60)*(coeff[1] + 2*dt*coeff[2] + 3*dt*dt*coeff[3] + ...)
118
119 where the C notation has been used (i.e. coeff[0] is first coefficient etc)
120 for details, see TEMPO notes (http://www.naic.edu/~pulsar/docs/tempo.txt)
121*/
122 double psr_dm; /* pulsar's dispersion measure (cm-3 pc) */
123 double rphase[16]; /* reference phase of pulse (0-1) */
124 double psr_f0[16]; /* pulse frequency at reference epoch (Hz) */
125 double poly_tmid[16]; /* mid point of polyco in (MJD) modified Julian date */
126 double coeff[192]; /* polynomial coefs made by TEMPO, 16 sets of 12 */
127 int32_t num_coeffs[16]; /* number of coefficients */
128 char hostname[24]; /* ascii hostname of machine that took this data */
129
130/* ALFA info */
131
132 double rfeed_offaz[7];/* deg az rotated offset all alfa beam to center */
133 double rfeed_offza[7];/* deg za rotated offset all alfa beam to center */
134 double prfeed_offaz; /* deg az offset to center of alfa beam */
135 double prfeed_offza; /* deg za offset to center of alfa beam */
136 double alfa_raj[7]; /* hr starting actual ra position of alfa beams */
137 double alfa_decj[7]; /* deg starting actual dec position of alfa beams */
138 double alfa_az[7]; /* deg starting actual az position of alfa beams */
139 double alfa_za[7]; /* deg starting actual za postion of alfa beams */
140 double alfa_ang; /* deg alfa rotation angle */
141 double para_ang; /* deg paralactic angle of center beam */
142
143/* add IF/LO data */
144
145 double syn1; /* upstairs synthesizer freq Hz */
146 double synfrq[8]; /* downstairs synthesizers (Hz) */
147
148 unsigned char prfeed; /* centered alfa beam */
149 unsigned char shcl; /* true if receiver shutter closed */
150 unsigned char sbshcl; /* true if Sband receiver shutter closed */
151
152 unsigned char rfnum; /* position of the receiver selectror */
153 unsigned char zmnormal; /* transfer switch to reverse channels, true */
154 /* normal */
155 unsigned char rfattn[2]; /* attenuator position */
156 unsigned char ifnum; /* if selector, 1/300 2/750, 3/1500, */
157 /* 4/10GHz1500, 5-thru */
158 unsigned char ifattn[2]; /* IF attenuator positions */
159 unsigned char fiber; /* true if fiber is chosen (always the case) */
160 unsigned char ac2sw; /* ac power to various instruments and other */
161 /* stuff */
162 unsigned char if750nb; /* narrow band 750 filter selected */
163
164 unsigned char phbsig; /* converter combiner signal phase adjust */
165 unsigned char hybrid; /* converter combiner hybrid */
166 unsigned char phblo; /* convert combiner lo phase adjust */
167
168/* downstairs */
169
170 unsigned char xfnormal; /* transfer switch true if normal */
171 unsigned char noise; /* noise on */
172 unsigned char ampgain[2]; /* gain of downstairs amps */
173 unsigned char inpfrq; /* input distributor position */
174 unsigned char mixer[8]; /* mixer source switches */
175 unsigned char vlbainp; /* vlba input switch position */
176 unsigned char syndest[8]; /* synthesizer destinations */
177 unsigned char calsrc; /* cal source bit */
178
179 unsigned char vis30mhz; /* greg 1 ch 0 */
180 unsigned char pwrmet; /* power meter input switch */
181 unsigned char blank430; /* 430 blanking on */
182 unsigned char fill[6]; /* fill */
183};

Generated using doxygen 1.14.0