00001
00002
00070 #ifndef EXCHANGE_H
00071 #define EXCHANGE_H
00072
00073 #include "fitsio.h"
00074
00075 typedef char BOOL;
00076 typedef double DATA;
00077 typedef int STATUS;
00078
00079
00080 extern int oi_hush_errors;
00083
00084
00085
00086
00087
00089 typedef struct {
00090 char tel_name[17];
00091 char sta_name[17];
00092 int sta_index;
00093 float diameter;
00094 double staxyz[3];
00095 } element;
00096
00098 typedef struct {
00099 int revision;
00100 char arrname[FLEN_VALUE];
00101 char frame[FLEN_VALUE];
00102 double arrayx, arrayy, arrayz;
00103 int nelement;
00104 element *elem;
00105 } oi_array;
00106
00111 typedef struct {
00112 int target_id;
00113 char target[17];
00114 double raep0, decep0;
00115 float equinox;
00116 double ra_err, dec_err;
00117 double sysvel;
00118 char veltyp[9], veldef[9];
00119 double pmra, pmdec;
00120 double pmra_err, pmdec_err;
00121 float parallax, para_err;
00122 char spectyp[17];
00123 } target;
00124
00126 typedef struct {
00127 int revision;
00128 int ntarget;
00129 target *targ;
00130 } oi_target;
00131
00133 typedef struct {
00134 int revision;
00135 char insname[FLEN_VALUE];
00136 int nwave;
00137 float *eff_wave;
00138 float *eff_band;
00139 } oi_wavelength;
00140
00143 typedef struct {
00144 int target_id;
00145 double time;
00146 double mjd;
00147 double int_time;
00148 DATA *visamp, *visamperr;
00149 DATA *visphi, *visphierr;
00150 double ucoord, vcoord;
00151 int sta_index[2];
00152 BOOL *flag;
00153 } oi_vis_record;
00154
00156 typedef struct {
00157 int revision;
00158 char date_obs[FLEN_VALUE];
00159 char arrname[FLEN_VALUE];
00160 char insname[FLEN_VALUE];
00161 long numrec;
00162 int nwave;
00163 oi_vis_record *record;
00164 } oi_vis;
00165
00168 typedef struct {
00169 int target_id;
00170 double time;
00171 double mjd;
00172 double int_time;
00173 DATA *vis2data, *vis2err;
00174 double ucoord, vcoord;
00175 int sta_index[2];
00176 BOOL *flag;
00177 } oi_vis2_record;
00178
00180 typedef struct {
00181 int revision;
00182 char date_obs[FLEN_VALUE];
00183 char arrname[FLEN_VALUE];
00184 char insname[FLEN_VALUE];
00185 long numrec;
00186 int nwave;
00187 oi_vis2_record *record;
00188 } oi_vis2;
00189
00191 typedef struct {
00192 int target_id;
00193 double time;
00194 double mjd;
00195 double int_time;
00196 DATA *t3amp, *t3amperr;
00197 DATA *t3phi, *t3phierr;
00198 double u1coord, v1coord, u2coord, v2coord;
00199 int sta_index[3];
00200 BOOL *flag;
00201 } oi_t3_record;
00202
00204 typedef struct {
00205 int revision;
00206 char date_obs[FLEN_VALUE];
00207 char arrname[FLEN_VALUE];
00208 char insname[FLEN_VALUE];
00209 long numrec;
00210 int nwave;
00211 oi_t3_record *record;
00212 } oi_t3;
00213
00214
00215
00216
00217
00218
00219
00220 STATUS write_oi_array(fitsfile *fptr, oi_array array, int extver,
00221 STATUS *pStatus);
00222 STATUS write_oi_target(fitsfile *fptr, oi_target targets, STATUS *pStatus);
00223 STATUS write_oi_wavelength(fitsfile *fptr, oi_wavelength wave, int extver,
00224 STATUS *pStatus);
00225 STATUS write_oi_vis(fitsfile *fptr, oi_vis vis, int extver, STATUS *pStatus);
00226 STATUS write_oi_vis2(fitsfile *fptr, oi_vis2 vis2, int extver,
00227 STATUS *pStatus);
00228 STATUS write_oi_t3(fitsfile *fptr, oi_t3 t3, int extver, STATUS *pStatus);
00229
00230 STATUS read_oi_target(fitsfile *fptr, oi_target *pTargets, STATUS *pStatus);
00231 STATUS read_oi_array(fitsfile *fptr, char *arrname, oi_array *pArray,
00232 STATUS *pStatus);
00233 STATUS read_next_oi_array(fitsfile *fptr, oi_array *pArray, STATUS *pStatus);
00234 STATUS read_oi_wavelength(fitsfile *fptr, char *insname, oi_wavelength *pWave,
00235 STATUS *pStatus);
00236 STATUS read_next_oi_wavelength(fitsfile *fptr, oi_wavelength *pWave,
00237 STATUS *pStatus);
00238 STATUS read_next_oi_vis(fitsfile *fptr, oi_vis *pVis, STATUS *pStatus);
00239 STATUS read_next_oi_vis2(fitsfile *fptr, oi_vis2 *pVis2, STATUS *pStatus);
00240 STATUS read_next_oi_t3(fitsfile *fptr, oi_t3 *pT3, STATUS *pStatus);
00241
00242 void free_oi_array(oi_array *pArray);
00243 void free_oi_target(oi_target *pTargets);
00244 void free_oi_wavelength(oi_wavelength *pWave);
00245 void free_oi_vis(oi_vis *pVis);
00246 void free_oi_vis2(oi_vis2 *pVis2);
00247 void free_oi_t3(oi_t3 *pT3);
00248
00249 #endif
00250