Linuxpops  3.01.04
Spectral Anaysis Package for Single Dish Data
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
structure.h
Go to the documentation of this file.
1 /* class data structures */
2 
3 #define REC_LEN 512
4 #define ENT_EXT 384
5 #define ENT_LEN (32*4)
6 #define ENT_REC (REC_LEN/ENT_LEN)
7 #define EXT_LEN (ENT_EXT*ENT_LEN)
8 #define EIII_FILE "1B "
9 #define EEEI_FILE "1A "
10 
11 struct file_index
12 {
13  char code[4]; /* file type */
14  int next_rec, /* next free (128 byte) record */
15  num_ent, /* entries per extension */
16  num_ext, /* active extensions */
17  next_ent, /* next free entry */
18  ext_addr[251]; /* record addrs of extensions */
19 };
20 
21 #define KIND_SPEC 0 /* Spectroscopy */
22 #define KIND_CONT 1 /* Continuum drift */
23 #define KIND_SKY 2 /* Skydip data */
24 #define KIND_ONOFF 3 /* Continuum on/off */
25 
26 #define UNKNOWN 1 /* coord systems */
27 #define EQUAT 2
28 #define GALAC 3
29 #define HORIZ 4
30 #define PLANET 5
31 #define GEOCEN 6
32 
33 struct index_ent
34 {
35  int addr, /* record address of scan */
36  obs, /* obs number */
37  version; /* and version */
38  char source[12], /* source, */
39  line[12], /* line, */
40  telescope[12]; /* and telescope names */
41  int date_obs, /* observ and reduction dates */
42  date_red; /* (days from 27 August 2024) */
43  float offsets[2]; /* position offsets */
44  int offset_type, /* 1 Un 2 Eq 3 Ga 4 Ho 5 Pl 6 Ea */
45  obs_type, /* 0: spectrum; 1: continuum */
46  quality,
47  scan, /* scan number */
48  future[12];
49 };
50 
51 #define SPECTRUM "2 "
52 #define SCAN_LEN 54
53 struct scan_ent
54 {
55  char code[4]; /* scan ID */
56  int size_rec, /* scan size in records */
57  size, /* scan size in (4 byte) words */
58  unused_1,
59  data_addr, /* data offset in words */
60  data_size, /* data size in words */
61  unused_2,
62  num_sec, /* number of header sects */
63  entry, /* entry number in index */
64  sect_info[45]; /* section codes[num_sec], */
65  /* section lengths[num_sec], */
66  /* section addrs[num_sec] */
67 };
68 
69 struct pointer_descr /* length of sects. if 0, sect not present. */
70 {
71  int general,
72  position,
73  spectro,
74  fswitch,
75  drift,
76  beam,
78  skydip,
79  gauss,
80  hfs,
81  shell,
82  continuum,
83  history,
84  plot,
85  base,
86  xcoord;
87 };
88 
89 #define GENERAL_SECT -2
90 #define GENERAL_LEN 9
91 struct general_descr /* always present */
92 {
93  double ut_time, /* (seconds) */
94  lst_time;
95  float azimuth, /* (radians) */
96  elevation,
97  tau, /* opacity */
98  tsys, /* system temperature (K) */
99  integration; /* integration time (minutes) */
100 };
101 
102 #define P_NONE 0 /* Projections */
103 #define P_GNOMONIC 1 /* Radial Tangent plane */
104 #define P_ORTHO 2 /* Dixon Tangent plane */
105 #define P_AZIMUTHAL 3 /* Schmidt Tangent plane */
106 #define P_STEREO 4 /* Stereographic */
107 #define P_LAMBERT 5 /* Lambert equal area */
108 #define P_AITOFF 6 /* Aitoff equal area */
109 #define P_RADIO 7 /* Classic Single dish radio mapping */
110 
111 #define POSITION_SECT -3
112 #define POSITION_LEN 11
114 {
115  char source[12]; /* source name */
116  float epoch; /* coordinate epoch */
117  double lambda, /* coordinates */
118  beta;
119  float lambda_off, /* coordinate offsets */
120  beta_off;
121  int projection; /* projection system */
122 };
123 
124 #define VUNK 0 /* velocity references: unknown (planetary...) */
125 #define VLSR 1
126 #define VHEL 2 /* Heliocentric */
127 #define VOBS 3 /* Observatory (telescope) */
128 #define VEAR 4 /* Earth-Moon barycenter */
129 #define VAUT -1 /* from data */
130 
131 #define SPECTRO_SECT -4
132 #define SPECTRO_LEN 18
133 struct spectro_descr /* spectroscopy */
134 { /* spectra only */
135  char line[12]; /* line name */
136  double rest; /* rest frequency */
137  int nchan; /* number of channels */
138  float reference, /* reference channel */
139  fres, /* frequency resolution */
140  foff, /* frequency offset */
141  vres, /* velocity resolution */
142  voff, /* velocity at reference chan */
143  bad; /* blanking value */
144  double image; /* image frequency */
145  int velocity; /* 0 Unkn 1 LSR 2 Hel. 3 Ear. */
146  double sky; /* sky frequency */
147  float vteles; /* velocity of telescope rel */
148 };
149 
150 #define BASE_SECT -5
151 #define MWIND 20
152 #define BASE_LEN 4+2*MWIND
153 struct base_descr /* baseline */
154 { /* spectra or drifts */
155  int degree; /* degree of last baseline */
156  float sigma, /* sigma */
157  area; /* area under windows */
158  int nwindow; /* number of line windows */
159  float wind1[MWIND], /* lower limits of windows */
160  wind2[MWIND]; /* upper limits of windows */
161 };
162 
163 #define HISTORY_SECT -6
164 #define MSEQ 100
165 #define HISTORY_LEN 1+2*MSEQ
166 struct history_descr /* orig scan nums */
167 {
168  int sequence, /* number of sequences */
169  start[MSEQ], /* start scan number of seq. */
170  end[MSEQ]; /* end scan number of seq. */
171 };
172 
173 #define PLOT_SECT -7
174 #define PLOT_LEN 4
175 struct plot_descr /* default plot limits */
176 {
177  float ymin, /* min y value plotted */
178  ymax, /* max y value plotted */
179  xmin, /* min x value plotted */
180  xmax; /* max x value plotted */
181 };
182 
183 #define MOD_FREQ 0 /* Frequency switch */
184 #define MOD_POS 1 /* Position switch */
185 #define MOD_FOLD 2 /* Folded frequency switch */
186 
187 #define FSWITCH_SECT -8
188 #define MXPHAS 8
189 #define FSWITCH_LEN 2+6*MXPHAS
190 struct fswitch_descr /* freq & pos switch */
191 { /* spectra only */
192  int nphase; /* number of phases */
193  double decalage[MXPHAS]; /* frequency offsets */
194  float duree[MXPHAS], /* time per phase */
195  poids[MXPHAS]; /* weight of each phase */
196  int mode; /* switch mode (freq , pos) */
197  float lamoff[MXPHAS], /* lambda offsets */
198  betoff[MXPHAS]; /* beta offsets of each phase */
199 };
200 
201 #define CALIBRATION_SECT -14
202 #define CALIBRATION_LEN 21
204 {
205  float beam_eff, /* beam efficiency */
206  forw_eff, /* forward efficiency */
207  gain_im, /* image/signal gain ratio */
208  h2omm, /* mm of water vapor */
209  pamb, /* ambient pressure (hpa) */
210  tamb, /* ambient temperature (K) */
211  tatmsig, /* atmosphere temp. signal band */
212  tchop, /* chopper temperature */
213  tcold, /* cold load temperature */
214  tausig, /* opacity signal band */
215  tauima, /* opacity image band */
216  tatmima, /* atmosphere temp. image band */
217  trec; /* receiver temperature */
218  int mode; /* calibration mode */
219  float factor, /* applied calibration factor */
220  altitude, /* site elevation (m) */
221  counts[3], /* power of atm., chopp., cold */
222  lamoff, /* long offset for sky measure */
223  betoff; /* lat offset for sky measure */
224 };
225 
226 
227 #define SKYDIP_SECT -16
228 #define MSKY 10
229 #define SKYDIP_LEN (10+4*MSKY)
230 struct skydip_descr /* skydips */
231 { /* no associated data */
232  char line[12]; /* line name */
233  double rest, /* rest frequency */
234  image; /* image frequency */
235  int nsky, /* number of points on sky */
236  nchop, /* - - - - chopper */
237  ncold; /* - - - - cold load */
238  float elevation[MSKY], /* elevations */
239  emission [MSKY], /* power on sky */
240  chopper [MSKY], /* power on chopper */
241  cold [MSKY]; /* power on cold load */
242 };
243 
244 #define GAUSS_SECT -9
245 #define MXGAUS 5
246 #define GAUSS_LEN (3+6*MXGAUS)
247 struct gauss_descr /* fit results */
248 { /* spectra or drifts */
249  int nline; /* number of components */
250  float sigma_base, /* sigma on base */
251  sigma_raie, /* sigma on line */
252  fit[3*MXGAUS], /* fit results */
253  err[3*MXGAUS]; /* errors */
254 };
255 
256 #define SHELL_SECT -12
257 #define SHELL_LEN 43
258 struct shell_descr /* "stellar shell" profile fit result */
259 { /* spectra only */
260  int nline; /* number of components */
261  float sigma_base, /* sigma on base */
262  sigma_raie, /* sigma on line */
263  fit[20], /* fit results */
264  err[20]; /* errors */
265 };
266 
267 #define HFS_SECT -13
268 #define HFS_LEN 27
269 struct hfs_descr /* "hyperfine struct" (nh3, hcn) fit */
270 { /* spectra only */
271  int nline; /* number of components */
272  float sigma_base, /* sigma on base */
273  sigma_raie, /* sigma on line */
274  fit[12], /* fit results */
275  err[12]; /* errors */
276 };
277 
278 #define DRIFT_SECT -10
279 #define DRIFT_LEN 16
280 struct drift_descr /* continuum drifts */
281 { /* drifts only */
282  double rest; /* rest frequency */
283  float width; /* bandwidth */
284  int npoint; /* number of data points */
285  float reference, /* reference point */
286  timoff, /* time at reference */
287  angoff, /* angular offset at ref. */
288  pa, /* position angle of drift */
289  timres, /* time resolution */
290  angres, /* angular resolution */
291  bad; /* blanking value */
292  int system; /* type of offsets */
293  double image; /* image frequency */
294  float colla, /* collimation error az */
295  colle; /* collimation error el */
296 };
297 
298 #define BEAM_SECT -11
299 #define BEAM_LEN 5
300 struct beam_descr /* beam switch */
301 { /* spectra or drifts */
302  float azimuth, /* observation azimuth */
303  elevation, /* observation elevation */
304  throw, /* beam spacing */
305  pa; /* position angle of beams */
306  int system; /* system for angle */
307 };
308 
309 #define CONT_SECT -15
310 #define CONT_LEN 19
311 struct cont_descr /* doub gauss & base fit results */
312 { /* drifts only */
313  int nline; /* number of components */
314  float sigma_base, /* sigma on base */
315  sigma_raie, /* sigma on line */
316  fit[8], /* results */
317  err[8]; /* errors */
318 };
float err[8]
Definition: structure.h:314
char line[12]
Definition: structure.h:38
double image
Definition: structure.h:293
float integration
Definition: structure.h:95
double image
Definition: structure.h:144
int start[MSEQ]
Definition: structure.h:168
float sigma_raie
Definition: structure.h:250
float colla
Definition: structure.h:294
int future[12]
Definition: structure.h:44
float emission[MSKY]
Definition: structure.h:238
float xmin
Definition: structure.h:177
float beta_off
Definition: structure.h:119
int next_ent
Definition: structure.h:14
float timoff
Definition: structure.h:285
int next_rec
Definition: structure.h:14
float tsys
Definition: structure.h:95
float reference
Definition: structure.h:138
float elevation[MSKY]
Definition: structure.h:238
int quality
Definition: structure.h:44
int unused_2
Definition: structure.h:56
float elevation
Definition: structure.h:95
int nwindow
Definition: structure.h:158
#define MXGAUS
Definition: structure.h:245
char code[4]
Definition: structure.h:13
float width
Definition: structure.h:283
float timres
Definition: structure.h:285
float lambda_off
Definition: structure.h:119
double image
Definition: structure.h:233
int num_ext
Definition: structure.h:14
int scan
Definition: structure.h:44
int version
Definition: structure.h:35
float wind1[MWIND]
Definition: structure.h:159
int date_obs
Definition: structure.h:41
float angoff
Definition: structure.h:285
char code[4]
Definition: structure.h:55
float err[20]
Definition: structure.h:261
float azimuth
Definition: structure.h:95
float colle
Definition: structure.h:294
float fit[8]
Definition: structure.h:314
int unused_1
Definition: structure.h:56
int num_ent
Definition: structure.h:14
int calibration
Definition: structure.h:71
int data_size
Definition: structure.h:56
float chopper[MSKY]
Definition: structure.h:238
float reference
Definition: structure.h:285
float ymin
Definition: structure.h:177
int ext_addr[251]
Definition: structure.h:14
float poids[MXPHAS]
Definition: structure.h:194
#define MWIND
Definition: structure.h:151
int degree
Definition: structure.h:155
float betoff[MXPHAS]
Definition: structure.h:197
int end[MSEQ]
Definition: structure.h:168
double rest
Definition: structure.h:136
char line[12]
Definition: structure.h:135
int data_addr
Definition: structure.h:56
int sect_info[45]
Definition: structure.h:56
float area
Definition: structure.h:156
float offsets[2]
Definition: structure.h:43
double lst_time
Definition: structure.h:93
float sigma_base
Definition: structure.h:250
float pa
Definition: structure.h:302
float sigma_raie
Definition: structure.h:261
double rest
Definition: structure.h:233
float cold[MSKY]
Definition: structure.h:238
#define MSKY
Definition: structure.h:228
char line[12]
Definition: structure.h:232
float sigma_base
Definition: structure.h:314
float counts[3]
Definition: structure.h:219
int system
Definition: structure.h:306
float sigma_base
Definition: structure.h:261
int entry
Definition: structure.h:56
int obs
Definition: structure.h:35
int offset_type
Definition: structure.h:44
int size_rec
Definition: structure.h:56
float lamoff[MXPHAS]
Definition: structure.h:197
double rest
Definition: structure.h:282
int nline
Definition: structure.h:271
float bad
Definition: structure.h:285
float angres
Definition: structure.h:285
float xmax
Definition: structure.h:177
int obs_type
Definition: structure.h:44
#define MXPHAS
Definition: structure.h:188
char source[12]
Definition: structure.h:115
float fit[3 *MXGAUS]
Definition: structure.h:250
float fit[20]
Definition: structure.h:261
double ut_time
Definition: structure.h:93
float ymax
Definition: structure.h:177
float pa
Definition: structure.h:285
float sigma
Definition: structure.h:156
int num_sec
Definition: structure.h:56
float sigma_base
Definition: structure.h:272
double decalage[MXPHAS]
Definition: structure.h:193
int addr
Definition: structure.h:35
float duree[MXPHAS]
Definition: structure.h:194
float sigma_raie
Definition: structure.h:314
float azimuth
Definition: structure.h:302
int date_red
Definition: structure.h:41
float wind2[MWIND]
Definition: structure.h:159
float fit[12]
Definition: structure.h:272
float err[12]
Definition: structure.h:272
char telescope[12]
Definition: structure.h:38
double sky
Definition: structure.h:146
float elevation
Definition: structure.h:302
char source[12]
Definition: structure.h:38
float sigma_raie
Definition: structure.h:272
double lambda
Definition: structure.h:117
int size
Definition: structure.h:56
float err[3 *MXGAUS]
Definition: structure.h:250
float vteles
Definition: structure.h:147
#define MSEQ
Definition: structure.h:164