HOPS
HOPS class reference
param_struct.h
Go to the documentation of this file.
1 #ifndef PARAM_STRUCT_H__
2 #define PARAM_STRUCT_H__
3  /* Definitions of major parameter structures */
4 #define MAXINDEX 256
5 #define MAX_ION_PTS 100
6 #define LAG 0
7 #define GLOBAL 1
8 #define MAXNOTCH (8*MAXFREQ)
9 
10 #include "plot_struct.h"
11 
12 struct type_param
13  {
14  /* Filled in by time_range() */
15  double start_nom; /* nom. scan start time from ovex (sBOY) */
16  double stop_nom; /* " " stop " " " (sBOY) */
19  double start; /* actual start time of earliest AP (sBOY) */
20  double stop; /* " stop " " latest " (sBOY) */
21  double reftime; /* fourfit ref. time (midpoint in s since BOY) */
22  double frt_offset; /* Offset of ref time from scan start */
23  double acc_period; /* Length of accumulation period (sec) */
24  int minap; /* First AP number */
25  int maxap; /* Last AP number */
26  int num_ap; /* Number of Accumulation Periods */
27  char baseline[2]; /* Carried for convenience */
28  short ov_bline[2]; // index into ovex station array for ref/rem
29  short corr_type; /* Determines type_120 format */
30  short pol; // Polarization type - vals def'd in pass_struct.h
31  char *rf_fglist; /* List of fgroups when refringing */
32  double cor_limit; /* Maximum correlation amplitude */
33  int bits_sample[2]; /* Bits per sample (1 or 2) for ref & rem */
34  double samp_period; // Len sample period (interval between samp in s)
35  short pc_mode[2]; /* Phase cal mode by station */
36  short pc_period[2]; // Phase cal integration period (ap's)
37  double pc_freq[MAXFREQ][2]; /* phase cal tone freq (KHz) by chan & stn */
38  int pc_tonemask[MAXFREQ][2];// pc multitone exclusion mask by chan & stn
39  double win_sb[2]; /* Single band search window microsec */
40  double win_dr[2]; /* Delay rate search window microsec per sec */
41  double win_mb[2]; /* Multi band search window microsec */
42  double win_ion[2]; // bounds of ionosphere search window (TEC units)
43  double inv_sigma; /* 1 / (1 sigma noise) */
44  double epoch_time; /* Epoch time */
45  int cormode; /* determines type 120 union */
46  int nlags; /* Variable in Mk4 */
47  double ref_freq; /* Reference frequency in MHz */
48  double ah_tref; /* Ad hoc reference time (s past hour) */
49  double ah_period; /* Ad hoc sinusoid period (s) */
50  double ah_amp; /* Ad hoc sinusoid amplitude (rad) */
51  double ah_poly[6]; /* Ad hoc polynomial coefficients */
52  int ah_phase; /* Ad hoc phase correction mode */
53  char ah_file[2][256]; // file names for ad hoc file mode pcal
54  char ah_file_chans[2][256]; // channel codes for ah_file contents
55  char ah_flag_files[2][256]; /* Ad hoc flag files */
56  char plot_data_dir[2][256]; /* for dumping plot data */
57  unsigned long bocf_period; /* Correlator frame in systicks */
58  int bocfs_per_ap; /* Correlator frames per AP */
59  short su_number[2]; /* Ref and remote SU number */
60  unsigned long error_mask; /* Mask used to edit AP data by flags */
61  short use_sample_cnts; /* iff true, use sample counts to normalize */
62  short dc_block; // iff true, zero out DC subchannel in spectrum
63  double passband[2]; /* passband for spectral filtering (MHz) */
64  double avxpzoom[2]; /* ave XP zoom options for passband */
65  int avxplopt[2]; /* some plot options on ave XP plot */
66  int gen_cf_record; /* whether to generate cf record */
67  int nnotches; /* alternative to passband */
68  double notches[MAXNOTCH][2]; /* alternative to passband */
69  char chan_notches[MAXNOTCH+1];/* channel restriction for notches(null terminated) */
70  double speedup; /* ration of playback speed to record speed */
71  int first_plot; // number of first chan to plot, when overridden
72  int nplot_chans; // number of plot channels when overridden
73  int interpol; // interpolation method
74  int mbd_anchor; // anchor total mbd to model or sbd
75  double pcal_spacing[2]; // pcal tone spacing (Hz) for ref & rem
76  double ion_diff; // differential ionosphere (rem-ref in TEC units)
77  int ion_pts; // number of pts in ionosphere coarse search
78  short ion_smooth; // iff true, use smoothed coarse pts for fine search
79  double par_angle[2]; // parallactic angle (rad) for ref & rem
80  double weak_channel; // G code threshhold for single-chan-amp / coherent-sum-amp
81  double pc_amp_hcode; // H code iff any pc amplitude less than this
82  double fmatch_bw_pct; // fractional bw % used for frequency matching
83  char* control_file_buff; // stripped but unparsed contents of control file
84  char* set_string_buff; // stripped but unparsed contents of set commands
85  int est_pc_manual; // estimate pc manual values
86  int mount_type[2]; // mount types for ref and rem
87  double elevation[2]; // elevation angle for ref and rem (radians)
88  int mixed_mode_rot; // iff true, rotate mixed LP-CP RY/YR data by 90
89  int noautofringes; // when true, skip fringing of autocorrs
90  int mod4numbering; // when true, fr.num % 4 is 0 (LL) 1 (RR) 2 (LR) 3 (RL)
91  int polfringnames; // when true, a poln label appears in fringe name
92  int mbdrplopt[3]; // option(s) on SBD MBD DRate plots
93  char fringeout_dir[256]; // alternate output directory for fringes
94  char clones[2][MAXFREQ/2+1]; // [0] are existing codes, [1] are the clones
95  int clone_snr_chk; // when true, check for frequency overlap in clones
96  char display_chans[MAXFREQ+5]; // channels to be displayed in the fringe plot
97  };
98 
99 #define WIN_EDGE_SBD 0x01 /* masks for status.interp_err */
100 #define WIN_EDGE_MBD 0x02
101 #define WIN_EDGE_RATE 0x04
102 #define INTP_ERR_SBD 0x08
103 #define INTP_ERR_MBD 0x10
104 #define INTP_ERR_RATE 0x20
105 
106 #define MK4HDW 0x01 // values for corr_type, for Alan W
107 #define DIFX 0x02 // For Adam D
108 #define SFXC 0x03 // For Mark K
109 
111  {
112  double freq_space; /* Freq spacing in FFT to MBdelay */
113  int grid_points; /* # of points in FFT to MBdelay */
114  double freq_spread; /* Sum of (Freq - avg freq) squared */
115  int large_errors; /* # of large errors */
116  int sliver_errors; // # of AP's with sliver (too little data) errors
117  int zero_errors; // # of AP's with zero (some lag count 0) errors
118  int total_ap; /* Total # of ap's processed (both sb's )*/
119  float total_ap_frac; /* Same, but with microediting */
120  float total_usb_frac; // usb subtotal of total_ap_frac
121  float total_lsb_frac; // lsb " " " "
122  int ap_num[2][MAXFREQ]; /* # of aps for each sideband & freq */
123  double ap_frac[2][MAXFREQ]; /* Same, but with microediting */
124  double epoch_err[MAXFREQ]; /* Epoch error (offset from ref. time) */
125  double epoch_off_cent; /* Epoch offset from center */
126  int mb_index[MAXFREQ]; /* index for freq in FFT to MBdelay */
127  double pc_meas[MAXFREQ][2][2]; // phase-cal phase as measured[chan][ref:rem][L:R]
128  double pc_phase[MAXFREQ][2][2];// phase-cal phase as used [chan][ref:rem][L:R]
129  double pc_amp[MAXFREQ][2][2]; // phase-cal magnitude [chan][ref:rem][L:R]
130  double pc_offset[MAXFREQ][2][2];//Additive/manual pcal values[chan][ref:rem][L:R]
131  double pcals_accum[2]; /* # of phase-cals for current channel */
132  double lsb_phoff[2]; /* LSB phase offset in radians */
133  double pc_delay[MAXFREQ][2][2];// multitone pcal based delays[chan][ref:rem][L:R]
134  int space_err; /* =1 if error if freq spacing is too large */
135  int drsp_size; /* # of points in delay rate spectrum */
136  int f_rate_size; /* # of points in FFT to Fringe rate */
137  int freq; /* Current frequency */
138  int lag; /* Current lag # */
139  int dr; /* Current delay rate # */
140  int mbd; /* Current multi band delay # */
141  int ap; /* Current acc per */
142  double dr_max[2*MAXLAG]; /* Delay rate at max by lag */
143  double dr_max_global; /* Delay rate at global max */
144  double corr_dr_max; /* Delay rate max corrected for pcal rate */
145  double sbd_max; /* single band delay at max */
146  double mbd_max[2*MAXLAG]; /* multi band delay at max by lag */
147  double mbd_max_global; /* multi band delay at global max */
148  int max_delchan; /* Single band delay channel at max */
149  double delres_max; /* max value of delay resolution function */
150  double rate_sep; /* Rate separation of FFT points for freq #1 */
151  double mbd_sep; /* Multi band delay separation of FFt points */
152  double sbd_sep; /* Single band delay separation microsec */
153  double search_amp; /* Cor. amplitude after initial search */
154  double interp_amp; /* Amplitude after 1st interpolation */
155  double pc_rate[2]; /* Interpolated phasecal rate */
156  double int_pc_amp[2]; /* Interpolated phasecal amplitude */
157  double amp_corr_fact; /* Amplitude corr. factor for interpolation */
158  double amp_rate_corr; /* Rate correction to amplitude */
159  int interp_err; /* =1 if error in interpolation */
160  double AN; /* Normalization from FFT (from FRNGE) */
161  int win_sb[2]; /* Single band search indices */
162  int win_dr[2]; /* Delay rate search indices */
163  int win_mb[2]; /* Multi band search indices */
164  int win_sb_save[2]; /* Saved single band search indices */
165  int win_dr_save[2]; /* Saved delay rate search indices */
166  int win_mb_save[2]; /* Saved multi band search indices */
167  int pts_searched; /* Number of points searched */
168  hops_complex fringe[MAXFREQ+1]; /* Fringe phase & amp for each freq */
169  double sbdbox[MAXFREQ+1]; /* Single band delay box for each freq */
170  double snr; /* Signal to Noise ratio */
171  double prob_false; /* Probability of false detection */
172  int nseg; /* Number of segments in computing time RMS */
173  int apseg; /* Number of APs in each segment */
174  int stc_present; // bits 0|1 set iff ref|rem state counts present
175  double th_timerms_phase; /* theoretical RMS phase with time */
176  double th_timerms_amp; /* theoretical RMS amp with time */
177  double th_freqrms_phase; /* theoretical RMS phase with freq */
178  double th_freqrms_amp; /* theoretical RMS amp with freq */
179  double timerms_phase; /* RMS phase with time */
180  double timerms_amp; /* RMS amp with time */
181  double freqrms_phase; /* RMS phase with freq */
182  double freqrms_amp; /* RMS amp with freq */
183  double integ_time; /* Total integration time */
184  double inc_avg_phase; /* Fringe phase for incoh. avg. over freq */
185  double inc_avg_amp; /* Fringe amp. from inc. sum of all points */
186  double coh_avg_phase; /* Fringe phase from coh. sum over freq */
187  double inc_avg_amp_freq; /* Fringe amp from incoh sum over freq */
188  double GHA; /* Greenwich hour angle (hrs) */
189  double apdelay; /* Adjusted apriori delay */
190  double amp_err; /* Error in fringe amplitude */
191  double apphase; /* Apriori phase */
192  double resid_phase; /* Residual phase */
193  double mod_resid_phase; /* Modified residual phase */
194  double phase_err; /* Error in fringe phase */
195  double resid_ph_delay; /* Residual phase delay */
196  double ph_delay_err; /* Error in phase delay */
197  double sbavg;
200  double sbd_ra_width;
202  double delay_offs[MAXFREQ][2]; // delay offsets (ns) by channel and station ##DELAY_OFFS##
203  double delay_offs_pol[MAXFREQ][2][2]; // delay offsets (ns) by channel and station and pol
204  double dtec[MAX_ION_PTS][2]; // differential TEC pairs [index#][TEC:amplitude]
205  double ion_sigmas[3]; // std dev of tau (ns), phi0 (rot), dTEC (TECU)
206  int nion; // number of points in the dtec array
207  int loopion; // index for ionospheric search loop (0 if none)
208  int sb_indx; // index of max when searching over sb delay
209  int mb_indx; // index of max when searching over mb delay
210  int dr_indx; // index of max when searching over delay rate
211  double xpnotchpband[2*MAXNOTCH]; // xp sites of notches or passband
212  double sb_bw_fracs[MAXFREQ+2][2]; // bandwidth reduction factors (0..1) by sb
213  double sb_bw_origs[MAXFREQ+2][2]; // original values accumulated
214  double sb_bw_apcnt[MAXFREQ+2][2]; // count of ap/fr/sb involved
215  double tot_sb_bw_aperr; // accumulated error in total_ap_frac
216  int apbyfreq[MAXFREQ]; // counter of APs contributing by freq
217  int napbyfreq; // number of freqs actually having usable data
218  };
219 
220 #endif
#define hops_complex
Definition: hops_complex.h:48
#define MAXLAG
Definition: mk4_data.h:41
double snr
Definition: param_struct.h:170
float total_ap_frac
Definition: param_struct.h:119
double pc_offset[MAXFREQ][2][2]
Definition: param_struct.h:130
double tot_sb_bw_aperr
Definition: param_struct.h:215
int zero_errors
Definition: param_struct.h:117
int win_sb_save[2]
Definition: param_struct.h:164
double integ_time
Definition: param_struct.h:183
int nion
Definition: param_struct.h:206
int nnotches
Definition: param_struct.h:67
char ah_file[2][256]
Definition: param_struct.h:53
int large_errors
Definition: param_struct.h:115
int est_pc_manual
Definition: param_struct.h:85
double ion_diff
Definition: param_struct.h:76
double search_amp
Definition: param_struct.h:153
int nplot_chans
Definition: param_struct.h:72
double sbavg
Definition: param_struct.h:197
double th_freqrms_amp
Definition: param_struct.h:178
double start
Definition: param_struct.h:19
double amp_corr_fact
Definition: param_struct.h:157
double avxpzoom[2]
Definition: param_struct.h:64
int nseg
Definition: param_struct.h:172
int start_offset
Definition: param_struct.h:17
int gen_cf_record
Definition: param_struct.h:66
double pc_delay[MAXFREQ][2][2]
Definition: param_struct.h:133
double inv_sigma
Definition: param_struct.h:43
double rate_ra_width
Definition: param_struct.h:198
double freqrms_phase
Definition: param_struct.h:181
short ov_bline[2]
Definition: param_struct.h:28
double interp_amp
Definition: param_struct.h:154
int drsp_size
Definition: param_struct.h:135
double apdelay
Definition: param_struct.h:189
double xpnotchpband[2 *MAXNOTCH]
Definition: param_struct.h:211
double pc_amp_hcode
Definition: param_struct.h:81
double pc_rate[2]
Definition: param_struct.h:155
double pc_meas[MAXFREQ][2][2]
Definition: param_struct.h:127
double timerms_phase
Definition: param_struct.h:179
double sb_bw_origs[MAXFREQ+2][2]
Definition: param_struct.h:213
char baseline[2]
Definition: param_struct.h:27
double ah_poly[6]
Definition: param_struct.h:51
char clones[2][MAXFREQ/2+1]
Definition: param_struct.h:94
int napbyfreq
Definition: param_struct.h:217
int freq
Definition: param_struct.h:137
int maxap
Definition: param_struct.h:25
float total_usb_frac
Definition: param_struct.h:120
double sbdbox[MAXFREQ+1]
Definition: param_struct.h:169
short su_number[2]
Definition: param_struct.h:59
int clone_snr_chk
Definition: param_struct.h:95
short pc_mode[2]
Definition: param_struct.h:35
unsigned long error_mask
Definition: param_struct.h:60
double ah_tref
Definition: param_struct.h:48
double ion_sigmas[3]
Definition: param_struct.h:205
double sbd_max
Definition: param_struct.h:145
short pol
Definition: param_struct.h:30
int noautofringes
Definition: param_struct.h:89
double timerms_amp
Definition: param_struct.h:180
#define MAX_ION_PTS
Definition: param_struct.h:5
double win_dr[2]
Definition: param_struct.h:40
double dtec[MAX_ION_PTS][2]
Definition: param_struct.h:204
short dc_block
Definition: param_struct.h:62
double par_angle[2]
Definition: param_struct.h:79
double inc_avg_amp
Definition: param_struct.h:185
int ap_num[2][MAXFREQ]
Definition: param_struct.h:122
int mbdrplopt[3]
Definition: param_struct.h:92
double passband[2]
Definition: param_struct.h:63
double sbd_ra_width
Definition: param_struct.h:200
int apbyfreq[MAXFREQ]
Definition: param_struct.h:216
double th_timerms_amp
Definition: param_struct.h:176
int lag
Definition: param_struct.h:138
double win_ion[2]
Definition: param_struct.h:42
int mb_index[MAXFREQ]
Definition: param_struct.h:126
double cor_limit
Definition: param_struct.h:32
int sliver_errors
Definition: param_struct.h:116
double amp_rate_corr
Definition: param_struct.h:158
char chan_notches[MAXNOTCH+1]
Definition: param_struct.h:69
int mixed_mode_rot
Definition: param_struct.h:88
double int_pc_amp[2]
Definition: param_struct.h:156
double notches[MAXNOTCH][2]
Definition: param_struct.h:68
double amp_err
Definition: param_struct.h:190
int cormode
Definition: param_struct.h:45
char * set_string_buff
Definition: param_struct.h:84
double epoch_time
Definition: param_struct.h:44
double mbd_max[2 *MAXLAG]
Definition: param_struct.h:146
int win_mb_save[2]
Definition: param_struct.h:166
double ph_delay_err
Definition: param_struct.h:196
double fmatch_bw_pct
Definition: param_struct.h:82
int loopion
Definition: param_struct.h:207
short ion_smooth
Definition: param_struct.h:78
double pcal_spacing[2]
Definition: param_struct.h:75
int num_ap
Definition: param_struct.h:26
int interp_err
Definition: param_struct.h:159
char * rf_fglist
Definition: param_struct.h:31
char * control_file_buff
Definition: param_struct.h:83
double resid_ph_delay
Definition: param_struct.h:195
char ah_file_chans[2][256]
Definition: param_struct.h:54
double win_sb[2]
Definition: param_struct.h:39
double dr_max_global
Definition: param_struct.h:143
int dr
Definition: param_struct.h:139
double freq_space
Definition: param_struct.h:112
double pcals_accum[2]
Definition: param_struct.h:131
double phase_err
Definition: param_struct.h:194
int sb_indx
Definition: param_struct.h:208
int win_dr_save[2]
Definition: param_struct.h:165
int mount_type[2]
Definition: param_struct.h:86
int mb_indx
Definition: param_struct.h:209
int ap
Definition: param_struct.h:141
int avxplopt[2]
Definition: param_struct.h:65
int total_ap
Definition: param_struct.h:118
double corr_dr_max
Definition: param_struct.h:144
unsigned long bocf_period
Definition: param_struct.h:57
int win_mb[2]
Definition: param_struct.h:163
int bits_sample[2]
Definition: param_struct.h:33
int apseg
Definition: param_struct.h:173
double mbd_sep
Definition: param_struct.h:151
double samp_period
Definition: param_struct.h:34
int max_delchan
Definition: param_struct.h:148
double win_mb[2]
Definition: param_struct.h:41
double elevation[2]
Definition: param_struct.h:87
double resid_phase
Definition: param_struct.h:192
double GHA
Definition: param_struct.h:188
int f_rate_size
Definition: param_struct.h:136
double epoch_off_cent
Definition: param_struct.h:125
double rate_dec_width
Definition: param_struct.h:199
double coh_avg_phase
Definition: param_struct.h:186
int dr_indx
Definition: param_struct.h:210
int space_err
Definition: param_struct.h:134
double inc_avg_amp_freq
Definition: param_struct.h:187
double frt_offset
Definition: param_struct.h:22
double ap_frac[2][MAXFREQ]
Definition: param_struct.h:123
double lsb_phoff[2]
Definition: param_struct.h:132
double reftime
Definition: param_struct.h:21
double acc_period
Definition: param_struct.h:23
int bocfs_per_ap
Definition: param_struct.h:58
double stop
Definition: param_struct.h:20
short use_sample_cnts
Definition: param_struct.h:61
int stop_offset
Definition: param_struct.h:18
double pc_phase[MAXFREQ][2][2]
Definition: param_struct.h:128
char fringeout_dir[256]
Definition: param_struct.h:93
int win_sb[2]
Definition: param_struct.h:161
double freqrms_amp
Definition: param_struct.h:182
int pc_tonemask[MAXFREQ][2]
Definition: param_struct.h:38
double epoch_err[MAXFREQ]
Definition: param_struct.h:124
char ah_flag_files[2][256]
Definition: param_struct.h:55
double delay_offs[MAXFREQ][2]
Definition: param_struct.h:202
double sbd_sep
Definition: param_struct.h:152
short corr_type
Definition: param_struct.h:29
double ah_period
Definition: param_struct.h:49
int grid_points
Definition: param_struct.h:113
double weak_channel
Definition: param_struct.h:80
char plot_data_dir[2][256]
Definition: param_struct.h:56
hops_complex fringe[MAXFREQ+1]
Definition: param_struct.h:168
char display_chans[MAXFREQ+5]
Definition: param_struct.h:96
double ah_amp
Definition: param_struct.h:50
double prob_false
Definition: param_struct.h:171
int mod4numbering
Definition: param_struct.h:90
#define MAXNOTCH
Definition: param_struct.h:8
double inc_avg_phase
Definition: param_struct.h:184
double mbd_max_global
Definition: param_struct.h:147
double apphase
Definition: param_struct.h:191
int mbd
Definition: param_struct.h:140
int mbd_anchor
Definition: param_struct.h:74
int pts_searched
Definition: param_struct.h:167
int minap
Definition: param_struct.h:24
double pc_amp[MAXFREQ][2][2]
Definition: param_struct.h:129
double sbd_dec_width
Definition: param_struct.h:201
double th_timerms_phase
Definition: param_struct.h:175
int interpol
Definition: param_struct.h:73
double delay_offs_pol[MAXFREQ][2][2]
Definition: param_struct.h:203
int ion_pts
Definition: param_struct.h:77
int stc_present
Definition: param_struct.h:174
double pc_freq[MAXFREQ][2]
Definition: param_struct.h:37
double stop_nom
Definition: param_struct.h:16
double sb_bw_apcnt[MAXFREQ+2][2]
Definition: param_struct.h:214
int ah_phase
Definition: param_struct.h:52
double rate_sep
Definition: param_struct.h:150
double AN
Definition: param_struct.h:160
short pc_period[2]
Definition: param_struct.h:36
int first_plot
Definition: param_struct.h:71
double start_nom
Definition: param_struct.h:15
int polfringnames
Definition: param_struct.h:91
double freq_spread
Definition: param_struct.h:114
double dr_max[2 *MAXLAG]
Definition: param_struct.h:142
double speedup
Definition: param_struct.h:70
int win_dr[2]
Definition: param_struct.h:162
double th_freqrms_phase
Definition: param_struct.h:177
float total_lsb_frac
Definition: param_struct.h:121
int nlags
Definition: param_struct.h:46
double sb_bw_fracs[MAXFREQ+2][2]
Definition: param_struct.h:212
double ref_freq
Definition: param_struct.h:47
double delres_max
Definition: param_struct.h:149
double mod_resid_phase
Definition: param_struct.h:193
Definition: param_struct.h:13
Definition: param_struct.h:111
#define MAXFREQ
Definition: sizelimits.h:1