HOPS
HOPS class reference
difx2mark4.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2010 by Roger Cappallo *
3  * *
4  * This program is free software; you can redistribute it and/or modify *
5  * it under the terms of the GNU General Public License as published by *
6  * the Free Software Foundation; either version 3 of the License, or *
7  * (at your option) any later version. *
8  * *
9  * This program is distributed in the hope that it will be useful, *
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12  * GNU General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU General Public License *
15  * along with this program; if not, write to the *
16  * Free Software Foundation, Inc., *
17  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
18  ***************************************************************************/
19 #ifndef __DIFX2MARK4_H__
20 #define __DIFX2MARK4_H__
21 
22 #include <difxio/difx_input.h>
23 #include <limits.h>
24 #include <time.h>
25 
26 #define MAX_INPUT_FILES 4096
27 #define MAX_VIS 8192
28 #define MAX_STN 50
29 #define MAX_FBANDS 20
30 #define EXP_CODE_LEN 4
31 #define NUMFILS 500 // max number of type 1 output files
32 #define MAGLIM 10000.0 // threshold magnitude for vis. rejection
33 #define MAX_FPPAIRS 48000 // dimensioned for b-lines x chans x pol_prods
34 #define MAX_DFRQ 800 // allowed max number of *DiFX* frequencies
35 #define NVRMAX 98304000 //max # of vis records, 4*64*3000*128
36 
38 
39 //define these if some how they were not passed at compile time
40 #ifndef DIFXIO_VERSION_MAJOR
41 #define DIFXIO_VERSION_MAJOR 0
42 #endif
43 
44 #ifndef DIFXIO_VERSION_MINOR
45 #define DIFXIO_VERSION_MINOR 0
46 #endif
47 
48 
50  {
53  char scodeFile[PATH_MAX];
54  FILE **in;
55  char *scan;
56  int nBaseFile;
58  int pretend;
59  double scale;
60  int verbose;
61  int localdir;
62  /* some overrides */
63  int specAvg;
64  int doalldifx;
65  float nOutChan;
66  float startChan;
67  int keepOrder;
70  double sniffTime;
71  int pulsarBin;
73  double jobMatrixDeltaT; /* seconds */
74  int raw;
75  char fgroups[16];
76  char bandwidth[8];
77  };
78 
79 typedef struct
80  {
81  int sync;
82  int version;
83  int baseline;
84  int nvis;
85  int mjd;
86  double iat;
90  char pols[2];
92  double weight;
93  double uvw[3];
94  struct components
95  {
96  float real;
97  float imag;
98  } comp[MAX_VIS];
99  } vis_record;
100 
101 struct stations
102  {
103  int inscan; // in scan according to vex SCHED block
104  int invis; // visibilities found in .difx/ data for this antenna
105  char mk4_id; // single char mk4 station code
106  char intl_name[2]; // two letter international stn name
107  char difx_name[2]; // two letter code used by difx
108  };
109 
110 struct fbands
111  {
112  char code;
113  double flo;
114  double fhi;
115  };
116 
118  {
119  struct
120  {
121  char chan_id[8]; // channel id for identifying channels
122  char sideband; // U or L
123  char pol; // R or L
124  int ant; // antenna table index
125  int find; // frequency table index
126  int bs; // quantization bits/sample
127  int first_time; // true iff first entry in table of chan_id for ant
128  int zoom; // true iff this channel is zoom mode
129  int n_spec_chan; // # of spectral channels output from difx
130  double pcal_int; // pcal interval (MHz)
131  double freq; // LO frequency (MHz); negative for LSB
132  double bw; // bandwidth (MHz)
133  } stn[2]; // reference | remote
134  };
135 
136 #include "type_000.h"
137 #include "type_100.h"
138 #include "type_101.h"
139 #include "type_120.h"
140 #include "type_300.h"
141 #include "type_301.h"
142 #include "type_302.h"
143 #include "type_303.h"
144 #include "type_309.h"
145 
146 
147  // function prototypes
148 #include "type_writes.h"
149  // conv2date.c
150 void conv2date (double, struct date *);
151  // createRoot.c
152 int createRoot (DifxInput *, struct fblock_tag *, int, int, char *, char *, char *,
153  struct stations *, struct CommandLineOptions *, char *);
154 char getband (double);
155  // createType1s.c
156 int createType1s (DifxInput *, struct fblock_tag *, int *, int, char *, char *,
157  struct stations *, struct CommandLineOptions *, char *);
158  // createType3s.c
159 int createType3s (DifxInput *, struct fblock_tag *, int, int, int, char *, char *,
160  struct stations *, struct CommandLineOptions *);
161  // get_vis.c
162 int get_vis (DifxInput *, char *, struct CommandLineOptions *, int *, int *, int *,
163  vis_record **, char *, struct fblock_tag *);
164  // new_type1.c
165 int new_type1 (DifxInput *, struct fblock_tag *, int, int, int, int, int *, double *,
166  struct stations *, char *, struct CommandLineOptions *, FILE **,
167  int, char *, char *, char *, char *, int, int);
168  // write_t120.c
169 //void write_t120 (struct type_120 *, FILE *);
170  // normalize.c
171 void normalize (struct CommandLineOptions *, vis_record *, int, int *, int *,
172  struct fblock_tag *);
173  // root_id.c
174 char *root_id(int, int, int, int, int);
175 char *root_id_break(time_t, int, int, int, int, int);
176 int root_id_delta(time_t);
177  // single_code.c
178 char single_code (char *, char *);
179  // swabr.c
180 short short_reverse (short);
181 unsigned short unsig_reverse (unsigned short);
182 int int_reverse (int);
183 long long_reverse (long);
184 float float_reverse (float);
185 double double_reverse (double);
186 
187 #endif
188 // vim: shiftwidth=4:softtabstop=4:expandtab:cindent:cinoptions={1sf1s^-1s
int zoom(esum *data)
Definition: zoom.c:17
#define MAX_VIS
Definition: difx2mark4.h:27
double double_reverse(double)
Definition: swabr.c:97
double jobMatrixDeltaT
Definition: difx2mark4.h:73
double weight
Definition: difx2mark4.h:92
float startChan
Definition: difx2mark4.h:66
#define EXP_CODE_LEN
Definition: difx2mark4.h:30
void conv2date(double, struct date *)
Definition: conv2date.c:16
int pretend
Definition: difx2mark4.h:58
float real
Definition: difx2mark4.h:96
float float_reverse(float)
Definition: swabr.c:81
int overrideVersion
Definition: difx2mark4.h:69
int version
Definition: difx2mark4.h:82
double fhi
Definition: difx2mark4.h:114
char getband(double)
Definition: createRoot.c:857
int root_id_delta(time_t)
Definition: applications/difx2mark4/src/root_id.c:23
float nOutChan
Definition: difx2mark4.h:65
char exp_no[EXP_CODE_LEN+1]
Definition: difx2mark4.h:51
int pulsar_bin
Definition: difx2mark4.h:91
char scodeFile[PATH_MAX]
Definition: difx2mark4.h:53
int freq_index
Definition: difx2mark4.h:89
short short_reverse(short)
Definition: swabr.c:15
int nBaseFile
Definition: difx2mark4.h:56
FILE ** in
Definition: difx2mark4.h:54
int specAvg
Definition: difx2mark4.h:63
struct fblock_tag::@3 stn[2]
int phaseCentre
Definition: difx2mark4.h:72
int writemodel
Definition: difx2mark4.h:57
int doalldifx
Definition: difx2mark4.h:64
#define MAX_INPUT_FILES
Definition: difx2mark4.h:26
int localdir
Definition: difx2mark4.h:61
int config_index
Definition: difx2mark4.h:87
int sync
Definition: difx2mark4.h:81
int source_index
Definition: difx2mark4.h:88
char * root_id(int, int, int, int, int)
Definition: applications/difx2mark4/src/root_id.c:59
int invis
Definition: difx2mark4.h:104
char intl_name[2]
Definition: difx2mark4.h:106
int new_type1(DifxInput *, struct fblock_tag *, int, int, int, int, int *, double *, struct stations *, char *, struct CommandLineOptions *, FILE **, int, char *, char *, char *, char *, int, int)
int createRoot(DifxInput *, struct fblock_tag *, int, int, char *, char *, char *, struct stations *, struct CommandLineOptions *, char *)
Definition: createRoot.c:14
char * scan
Definition: difx2mark4.h:55
char single_code(char *, char *)
Definition: single_code.c:6
char difx_name[2]
Definition: difx2mark4.h:107
char code
Definition: difx2mark4.h:112
long long_reverse(long)
Definition: swabr.c:57
float imag
Definition: difx2mark4.h:97
int int_reverse(int)
Definition: swabr.c:41
int createType1s(DifxInput *, struct fblock_tag *, int *, int, char *, char *, struct stations *, struct CommandLineOptions *, char *)
Definition: createType1s.c:26
char * baseFile[MAX_INPUT_FILES]
Definition: difx2mark4.h:52
unsigned short unsig_reverse(unsigned short)
Definition: swabr.c:28
void normalize(struct CommandLineOptions *, vis_record *, int, int *, int *, struct fblock_tag *)
Definition: normalize.c:16
char * root_id_break(time_t, int, int, int, int, int)
Definition: applications/difx2mark4/src/root_id.c:89
int inscan
Definition: difx2mark4.h:103
int createType3s(DifxInput *, struct fblock_tag *, int, int, int, char *, char *, struct stations *, struct CommandLineOptions *)
Definition: createType3s.c:27
int keepOrder
Definition: difx2mark4.h:67
booleans
Definition: difx2mark4.h:37
@ FALSE
Definition: difx2mark4.h:37
@ TRUE
Definition: difx2mark4.h:37
double scale
Definition: difx2mark4.h:59
double iat
Definition: difx2mark4.h:86
int pulsarBin
Definition: difx2mark4.h:71
double sniffTime
Definition: difx2mark4.h:70
char fgroups[16]
Definition: difx2mark4.h:75
char bandwidth[8]
Definition: difx2mark4.h:76
int mjd
Definition: difx2mark4.h:85
int baseline
Definition: difx2mark4.h:83
int raw
Definition: difx2mark4.h:74
int verbose
Definition: difx2mark4.h:60
int dontCombine
Definition: difx2mark4.h:68
int get_vis(DifxInput *, char *, struct CommandLineOptions *, int *, int *, int *, vis_record **, char *, struct fblock_tag *)
Definition: get_vis.c:21
int nvis
Definition: difx2mark4.h:84
char mk4_id
Definition: difx2mark4.h:105
double flo
Definition: difx2mark4.h:113
Definition: difx2mark4.h:50
Definition: difx2mark4.h:111
Definition: difx2mark4.h:118
Definition: difx2mark4.h:102
Definition: difx2mark4.h:80
Definition: difx2mark4.h:95
Definition: mk4_typedefs.h:15