HOPS
HOPS class reference
control.h
Go to the documentation of this file.
1 #ifndef control_done
2 #define control_done
3 
4 #include "mk4_sizes.h"
5 #include "general.h"
6 
7 #define MAX_SAMP 16
8 #define MAXNOTCH (8*MAXFREQ)
9 
10 
11 struct gat_struct
12  {
13  short on_delay; /* in secs since gate reference epoch */
14  short duration; /* in secs */
15  };
16 
17 /* moved to include/general.h
18  struct istats { int ref; int rem; };
19  struct dstats { double ref; double rem; };
20 */
21 
22 struct c_block /* Elemental control block structure */
23  {
24  struct c_block *cb_chain; /* Chained pointer to next c_block */
25 
26  /* Conditions that scan must meet to have this block be applied */
27 
28  char baseline[2]; /* station codes at both ends of baseline;
29  either or both can be wildcards */
30  char source[32]; /* source name, or single wildcard */
31  char f_group; /* frequency group code, or wildcard */
32  int scan[2]; /* acceptance interval (inclusive) for start
33  of scan; in seconds since 1980.0 */
34  short knot[4]; /* knot[i] true when cond[i] "not-ed" */
35 
36 
37  /* Filter, corrections, etc. to apply to data within qualifying scan */
38 
39  short skip; /* iff true, don't fourfit matching scans */
40  double min_weight; /* min t120->fw.weight for AP acceptance */
41  double ref_freq; /* force fourfit to use this ref. freq. (MHz) */
42  int accept_sbs[MAXFREQ]; /* accept USB, LSB, DSB iff = 1, 2, 3 */
43  // this is deprecated:
44  short index[2*MAXFREQ]; /* index numbers of acceptable sidebands */
45  struct istats pc_mode; /* phase cal modes */
46  struct istats pc_period; // phase cal integration period (in ap's)
47  struct dstats pc_freq[MAXFREQ]; /* phase cal freqs (KHz) by channel */
48  struct dstats pc_phase_offset[2];// manual phase offset applied to all channels, by pol
49  struct dstats pc_phase[MAXFREQ][2];/* phase cal phases by channel and pol
50  for manual or additive pcal */
51  struct istats pc_tonemask[MAXFREQ];// tone exclusion mask by channel in multitone
52  struct dstats lsb_offset; /* LSB phase offset in degrees */
53  // these 4 are deprecated
54  short x_crc; /* flag to keep/discard AP having a crc error */
55  short y_crc;
56  short x_slip_sync; /* max. # of frame resyncs to still use AP's data */
57  short y_slip_sync;
58 
59  double sb_window[2]; /* bounds of single band delay search window (us) */
60  double mb_window[2]; /* bounds of multi-band delay search window (us) */
61  double dr_window[2]; /* bounds of delay-rate search window (us/s) */
62  double ion_window[2]; // bounds of ionospheric search window (TEC units)
63  double ra_offset; /* offset RA (arcsec) to shift windows by */
64  double dec_offset; /* " DEC " " " " " */
65  int ion_npts; // # of pts in ionosphere coarse search
66  int time_span[2]; /* acceptance window start and stop (s BOY) */
67  short ion_smooth; // iff true, use smoothed, interpolated TEC grid pts
68  short switched_mode; /* defines switching cycle start epoch */
69  short switched_period; /* switching cycle period (s) */
70  short use_samples; /* iff true, use sample counts to normalize */
71  short dc_block; // iff true, zero out DC subchannel of spectrum
72  short optimize_closure; // iff true, keep closure triangle noise small as possible
73  struct gat_struct gates[MAXFREQ]; /* relative on/off epochs (s), code, for each channel */
74  int adhoc_phase; /* defines type of ad hoc phase adjustments */
75  double adhoc_tref; /* reference time for either ad hoc model (s past hour */
76  double adhoc_period; /* period of sinewave (s) */
77  double adhoc_amp; /* amplitude in radians */
78  double adhoc_poly[6]; /* ad hoc phase polynomial coefficients (rad/sec^n) */
79  char adhoc_file[2][256]; // file names if station(s) is in pc_mode file
80  char adhoc_file_chans[2][128]; // channel codes [a..zA..Z$%] for pc file phase fields
81  char adhoc_flag_files[2][256]; /* file names for ad hoc data flagging */
82  char plot_data_dir[2][256]; /* dir name(s) for dumping plot data */
83  double passband[2]; /* passband for spectral filtering (MHz) */
84  double avxpzoom[2]; /* ave XP zoom options for passband case */
85  int avxplopt[2]; /* some plot options on ave XP plot */
86  int gen_cf_record; /* whether to general control file record */
87  int nnotches; /* alternative to passband */
88  double notches[MAXNOTCH][2]; /* alternative to passband */
89  char chan_notches[MAXNOTCH+1]; /* channel restriction for notches(null terminated) */
90  double t_cohere; /* coherence time (s) for co-adding fringe rates */
91  struct dstats ionosphere; // a priori ionospheres (TEC units = 1e16 el/m^2)
92  struct dstats delay_offs[MAXFREQ];// additive delay offset(ns) by channel ##DELAY_OFFS##
93  struct dstats delay_offs_pol[MAXFREQ][2];// additive delay offset(ns) by channel and pol
94  int nsamplers; // number of sampler strings
95  char *psamplers[MAX_SAMP]; // pointer to each sampler string (or NULL)
96  char sampler_codes[256]; // contains all sampler strings
97  struct dstats sampler_delay[MAX_SAMP][2]; // additive delay per sampler (s), in sampler
98  // order, for each of 2 polarizations (L/R = X/Y)
99  int est_pc_manual; // provide estimates of manual pc phases
100  int interpolator; // interpolation method
101  int mbd_anchor; // mbd ambiguity choice: model or sbd
102  struct dstats station_delay; // station delay pc inject->digitizer (s)
103  struct dstats pc_delay_l; // delay diff (feed->inject)-(pulsegen->inject) (s)
104  struct dstats pc_delay_r; // same, but for RCP (or Y or V)
105  double weak_channel; // G code if single_chan_amp/coherent_amp < weak_channel
106  double pc_amp_hcode; // H code iff any pc amplitude less than this
107  double fmatch_bw_pct; // fractional bw % used for frequency matching
108  char chid[MAXFREQ+1]; // single letter ch id codes (abcd... unless chid_ids)
109  double chid_rf[MAXFREQ]; // MHz, iff chid_ids, used in make_passes()
110  char clones[2][MAXFREQ/2+1]; // [0] is existing labels, [1] is the new ones
111  int clone_snr_chk; // when true, check for frequency overlap in clones
112  char display_chans[MAXFREQ+5]; // channels to be displayed in the fringe plot
113  int vbp_correct; // iff true, modify xpower phase with video bandpass model
114  int vbp_fit; // iff true, do algebraic model fit for video bandpass
115  struct dstats vbp_coeffs[5]; // video bandpass model coeffs (deg)
116  char vbp_file[2][256]; // if not null, specifies filename for video bandpass corr.
117  int mount_type[2]; // non-zero implies field-rotation-corrections should be made.
118  int mixed_mode_rot; // iff true, rotate all RY and YR data by 90 degrees (geodesy mixed-mode feature)
119  int noautofringes; // when true, skip fringing of autocorrs
120  int mod4numbering; // when true, fr.num % 4 is 0 (LL) 1 (RR) 2 (LR) 3 (RL)
121  int polfringnames; // when true, a poln label appears in fringe name
122  int mbdrplopt[3]; // option(s) on MBD DRate SBD plots
123  char fringeout_dir[256]; // alternative output directory (rather than where root is)
124  };
125 
126  /* Defined values for various structure variables */
127 
128 #define WILDCARD '?' /* station, baseline, source, f_group */
129 #define COMCHAR '*' /* comment character */
130 
131 #define KEEP 32767 /* x_crc, y_crc, x_slip_sync, y_slip_sync */
132 #define DISCARD 1
133 
134 #define NORMAL 1 /* pc_mode */
135 #define AP_BY_AP 2
136 #define MANUAL 3
137 #define MULTITONE 4
138 
139 #define USB 1 /* frequency array values */
140 #define LSB 2
141 #define DSB 3
142 
143 #define SCAN_START 1 /* strobe_mode */
144 #define EACH_MINUTE 2
145 
146 #define SINEWAVE 1 /* ad hoc phase adjustment mode */
147 #define POLYNOMIAL 2
148 #define PHYLE 3
149 
150 #define NULLINT -12345 /* place-holder for no assigned integer value */
151 #define NULLFLOAT 508.4482826 /* " " " " " floating " */
152 #define NULLCHAR 0 /* " " " " " char " */
153 
154  // interpolation methods
155 #define ITERATE 1
156 #define SIMUL 2
157  // mbd anchor choice
158 #define MODEL 1
159 #define SBD 2
160 
161 #define NO_MOUNT_TYPE 0 /* mount_type */
162 #define CASSEGRAIN 1
163 #define NASMYTHLEFT 2
164 #define NASMYTHRIGHT 3
165 
166 #define FCHARS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789$%"
167 #endif
int mbd_anchor
Definition: control.h:101
char vbp_file[2][256]
Definition: control.h:116
int nsamplers
Definition: control.h:94
char chid[MAXFREQ+1]
Definition: control.h:108
struct dstats pc_freq[MAXFREQ]
Definition: control.h:47
double dr_window[2]
Definition: control.h:61
struct dstats pc_delay_r
Definition: control.h:104
int polfringnames
Definition: control.h:121
struct dstats ionosphere
Definition: control.h:91
int interpolator
Definition: control.h:100
int mixed_mode_rot
Definition: control.h:118
struct dstats lsb_offset
Definition: control.h:52
short switched_period
Definition: control.h:69
int noautofringes
Definition: control.h:119
struct dstats delay_offs_pol[MAXFREQ][2]
Definition: control.h:93
short use_samples
Definition: control.h:70
int clone_snr_chk
Definition: control.h:111
char plot_data_dir[2][256]
Definition: control.h:82
char chan_notches[MAXNOTCH+1]
Definition: control.h:89
struct dstats pc_phase[MAXFREQ][2]
Definition: control.h:49
int adhoc_phase
Definition: control.h:74
short switched_mode
Definition: control.h:68
int gen_cf_record
Definition: control.h:86
double adhoc_tref
Definition: control.h:75
char f_group
Definition: control.h:31
double dec_offset
Definition: control.h:64
short x_crc
Definition: control.h:54
struct dstats pc_phase_offset[2]
Definition: control.h:48
double min_weight
Definition: control.h:40
struct dstats pc_delay_l
Definition: control.h:103
struct istats pc_tonemask[MAXFREQ]
Definition: control.h:51
struct dstats sampler_delay[MAX_SAMP][2]
Definition: control.h:97
char adhoc_flag_files[2][256]
Definition: control.h:81
double t_cohere
Definition: control.h:90
char fringeout_dir[256]
Definition: control.h:123
short x_slip_sync
Definition: control.h:56
int mbdrplopt[3]
Definition: control.h:122
#define MAX_SAMP
Definition: control.h:7
int vbp_fit
Definition: control.h:114
char clones[2][MAXFREQ/2+1]
Definition: control.h:110
int mount_type[2]
Definition: control.h:117
int avxplopt[2]
Definition: control.h:85
short optimize_closure
Definition: control.h:72
char sampler_codes[256]
Definition: control.h:96
struct istats pc_mode
Definition: control.h:45
double ion_window[2]
Definition: control.h:62
struct dstats station_delay
Definition: control.h:102
char source[32]
Definition: control.h:30
struct istats pc_period
Definition: control.h:46
int mod4numbering
Definition: control.h:120
char display_chans[MAXFREQ+5]
Definition: control.h:112
double fmatch_bw_pct
Definition: control.h:107
short knot[4]
Definition: control.h:34
int vbp_correct
Definition: control.h:113
double sb_window[2]
Definition: control.h:59
char adhoc_file[2][256]
Definition: control.h:79
int time_span[2]
Definition: control.h:66
double notches[MAXNOTCH][2]
Definition: control.h:88
int nnotches
Definition: control.h:87
short duration
Definition: control.h:14
double passband[2]
Definition: control.h:83
int est_pc_manual
Definition: control.h:99
short y_crc
Definition: control.h:55
short dc_block
Definition: control.h:71
double ref_freq
Definition: control.h:41
int ion_npts
Definition: control.h:65
double mb_window[2]
Definition: control.h:60
short ion_smooth
Definition: control.h:67
double avxpzoom[2]
Definition: control.h:84
double pc_amp_hcode
Definition: control.h:106
struct dstats vbp_coeffs[5]
Definition: control.h:115
char baseline[2]
Definition: control.h:28
short y_slip_sync
Definition: control.h:57
short skip
Definition: control.h:39
double weak_channel
Definition: control.h:105
#define MAXNOTCH
Definition: control.h:8
double chid_rf[MAXFREQ]
Definition: control.h:109
double adhoc_poly[6]
Definition: control.h:78
int accept_sbs[MAXFREQ]
Definition: control.h:42
double adhoc_period
Definition: control.h:76
struct gat_struct gates[MAXFREQ]
Definition: control.h:73
short on_delay
Definition: control.h:13
short index[2 *MAXFREQ]
Definition: control.h:44
double adhoc_amp
Definition: control.h:77
char * psamplers[MAX_SAMP]
Definition: control.h:95
double ra_offset
Definition: control.h:63
struct dstats delay_offs[MAXFREQ]
Definition: control.h:92
struct c_block * cb_chain
Definition: control.h:24
char adhoc_file_chans[2][128]
Definition: control.h:80
Definition: control.h:23
Definition: control.h:12
Definition: general.h:24
Definition: general.h:14
#define MAXFREQ
Definition: sizelimits.h:1
Definition: vex.h:103