uvmio.h
1 /***************************************************************************
2  *
3  * Copyright (C) 2013 by Willem van Straten
4  * Licensed under the Academic Free License version 2.1
5  *
6  ***************************************************************************/
7 /*
8  *
9  * uvmio.h - defines a C interface to uvmlib routines
10  *
11  * The structs defined in this header file must be a binary match to
12  * the common blocks defined in libuvm. This includes:
13  *
14  * #define UVM_MAXBIN mmm // where: parameter (apbinsmax=2048)
15  *
16  * Willem van Straten - April 2013
17  *
18  */
19 
20 #ifndef __UVMIO_H
21 #define __UVMIO_H
22 
23 #include "f77util.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29  /* Header block: common/header/ */
30  typedef struct
31  {
32  double period;
33  double samint;
34  double scantime;
35  int date;
36  int startime;
37  int arecnum;
38  int nscan;
39  int aendscan;
40  float abandwd;
41  int aposcrd;
42  float apos1st;
43  float apos2st;
44  float aazst;
45  float za;
46  float azaend;
47  float aclkrat;
48  int admptim;
49  int admplen;
50  int admpsrd;
51  int ainttim;
52  int aextst;
53  float obfreq;
54  int apoladd;
55  int anumsbc;
56  int alensbc;
57  int apbins;
58  float adm;
59  float arm;
60  float abintot;
61  int admptot;
62  float abtwscn;
63  float scaleI;
64  float sigmaI;
65  float abbm3lo;
66  float abbm4lo;
67  float baseval; // asynfreq;
68  int anrecscn;
69  float rm;
70  float erm;
71  char aver[3];
72  char source[9];
73  int controlword;
74  int nwins;
75  int nwbins[5];
76  char wndows[5];
77  char sver[3];
78  int nseq;
79  char obsvtry[11];
80 
81  } uvm_header;
82 
83  /* return the null-terminated string for char aver[3] */
84  inline void uvm_get_version (const uvm_header* hdr, char* txt)
85  { f2cstr(hdr->aver, txt, 3); }
86 
87  /* return the null-terminated string for char source[9] */
88  inline void uvm_get_source (const uvm_header* hdr, char* txt)
89  { f2cstr(hdr->source, txt, 9); }
90 
91  /* return the null-terminated string for char wndows[5] */
92  inline void uvm_get_windows (const uvm_header* hdr, char* txt)
93  { f2cstr(hdr->wndows, txt, 5); }
94 
95  /* return the null-terminated string for char sver[3] */
96  inline void uvm_get_software_version (const uvm_header* hdr, char* txt)
97  { f2cstr(hdr->sver, txt, 3); }
98 
99  /* return the null-terminated string for char obsvtry[11] */
100  inline void uvm_get_observatory (const uvm_header* hdr, char* txt)
101  { f2cstr(hdr->obsvtry, txt, 11); }
102 
103 
104  /* Maximum number of phase bins: parameter (apbinsmax=2048)) */
105  #define UVM_MAXBIN 2048
106  #define UVM_NPOL 4
107 
108  /* Data block: common/iquv/ */
109  typedef struct
110  {
111  float data [UVM_NPOL][UVM_MAXBIN];
112  } uvm_data;
113 
114 
115  /* limitation built into getheader */
116 # define UVM_MAX_FILENAME 80
117 
118 
119  /* C wrapper of the Fortran getheader function */
120  int uvm_getheader ( const char* filename,
121  int* program, /* return value encodes file format */
122  int* newscan, /* not yet sure what this does */
123  uvm_header*);
124 
125  int uvm_getdata ( int program, uvm_header*, uvm_data* );
126 
127  void uvm_dump (const uvm_header*);
128 
129 #ifdef __cplusplus
130 }
131 #endif
132 
133 #endif

Generated using doxygen 1.8.17