00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef OBITUV_H
00029 #define OBITUV_H
00030
00031 #include "ObitData.h"
00032 #include "ObitUVDesc.h"
00033 #include "ObitUVSel.h"
00034 #include "ObitTableList.h"
00035
00036
00140
00142 typedef struct {
00143 #include "ObitUVDef.h"
00144 } ObitUV;
00145
00146
00152 #define ObitUVUnref(in) ObitUnref (in)
00153
00159 #define ObitUVRef(in) ObitRef (in)
00160
00167 #define ObitUVIsA(in) ObitIsA (in, ObitUVGetClass())
00168
00178 #define ObitUVSetFITS(in,nvis,disk,file,err) G_STMT_START{ \
00179 in->info->dim[0]=1; in->info->dim[1]=1; in->info->dim[2]=1; \
00180 in->info->dim[3]=1; in->info->dim[4]=1; \
00181 in->info->work[0] = OBIT_IO_FITS; \
00182 in->info->work[1] = nvis; in->info->work[2]= disk; \
00183 ObitInfoListPut (in->info, "FileType", OBIT_int, \
00184 in->info->dim, (gpointer)&in->info->work[0], err);\
00185 ObitInfoListPut (in->info, "nVisPIO", OBIT_int, \
00186 in->info->dim, (gpointer)&in->info->work[1], err);\
00187 ObitInfoListPut (in->info, "IOBy", OBIT_int, in->info->dim, \
00188 (gpointer)&in->info->work[1], err); \
00189 in->info->dim[0] = 1; \
00190 ObitInfoListPut (in->info, "Disk", OBIT_int, \
00191 in->info->dim, (gpointer)&in->info->work[2], err); \
00192 in->info->dim[0] = strlen(file); \
00193 ObitInfoListPut (in->info, "FileName", OBIT_string, \
00194 in->info->dim, (gpointer)file, err); \
00195 }G_STMT_END
00196
00207 #define ObitUVSetAIPS(in,nvis,disk,cno,user,err) G_STMT_START{ \
00208 in->info->dim[0]=1; in->info->dim[1]=1; in->info->dim[2]=1; \
00209 in->info->dim[3]=1; in->info->dim[4]=1; \
00210 in->info->work[0] = OBIT_IO_AIPS; \
00211 in->info->work[1]= nvis; \
00212 ObitInfoListPut (in->info, "FileType", OBIT_int, \
00213 in->info->dim, (gpointer)&in->info->work[0], err);\
00214 ObitInfoListPut (in->info, "nVisPIO", OBIT_int, in->info->dim,\
00215 (gpointer)&in->info->work[1], err); \
00216 in->info->dim[0] = 1; \
00217 ObitInfoListPut (in->info, "Disk", OBIT_int, \
00218 in->info->dim, (gpointer)&disk, err); \
00219 ObitInfoListPut (in->info, "DISK", OBIT_int, \
00220 in->info->dim, (gpointer)&disk, err); \
00221 ObitInfoListPut (in->info, "CNO", OBIT_int, \
00222 in->info->dim, (gpointer)&cno, err); \
00223 ObitInfoListPut (in->info, "User", OBIT_int, \
00224 in->info->dim, (gpointer)&user, err); \
00225 }G_STMT_END
00226
00227
00236 #define ObitUVCpxDivide(in1,in2,out,work) G_STMT_START{ \
00237 work[2] = in2[0]*in2[0] + in2[1]*in2[1]; \
00238 if (work[2]==0.0) work[2] = 1; \
00239 work[0] = in1[0]/work[2]; work[1] = in1[1]/work[2]; \
00240 out[0] = work[0]*in2[0] + work[1]*in2[1]; \
00241 out[1] = work[1]*in2[0] - work[0]*in2[1]; \
00242 }G_STMT_END
00243
00253 #define ObitUVWtCpxDivide(in1,in2,out,work) G_STMT_START{ \
00254 if ((in1[2]<=0.0) || (in2[2]<=0.0)) { \
00255 out[0] = out[1] = out[2] = 0.0; \
00256 } else { \
00257 work[2] = in2[0]*in2[0] + in2[1]*in2[1]; \
00258 if (work[2]==0.0) {out[0] = out[1] = out[2] = 0.0; \
00259 } else { \
00260 work[0] = in1[0]/work[2]; work[1] = in1[1]/work[2];\
00261 out[0] = work[0]*in2[0] + work[1]*in2[1]; \
00262 out[1] = work[1]*in2[0] - work[0]*in2[1]; \
00263 out[2] *= sqrt(work[2]); \
00264 } \
00265 } \
00266 }G_STMT_END
00267
00268
00270 void ObitUVClassInit (void);
00271
00273 ObitUV* newObitUV (gchar* name);
00274
00276 ObitUV* newObitUVScratch (ObitUV *in, ObitErr *err);
00277 typedef ObitUV* (*newObitUVScratchFP) (ObitUV *in, ObitErr *err);
00278
00280 void ObitUVFullInstantiate (ObitUV *in, gboolean exist, ObitErr *err);
00281 typedef void (*ObitUVFullInstantiateFP) (ObitUV *in, gboolean exist,
00282 ObitErr *err);
00283
00285 gconstpointer ObitUVGetClass (void);
00286
00288 ObitUV* ObitUVZap (ObitUV *in, ObitErr *err);
00289
00291 void ObitUVRename (ObitUV *in, ObitErr *err);
00292
00294 ObitUV* ObitUVCopy (ObitUV *in, ObitUV *out, ObitErr *err);
00295
00297 void ObitUVClone (ObitUV *in, ObitUV *out, ObitErr *err );
00298
00300 gboolean ObitUVSame (ObitUV *in1, ObitUV *in2, ObitErr *err );
00301 typedef gboolean (*ObitUVSameFP) (ObitUV *in1, ObitUV *in2,
00302 ObitErr *err);
00303
00305 ObitIOCode ObitUVOpen (ObitUV *in, ObitIOAccess access,
00306 ObitErr *err);
00307
00309 ObitIOCode ObitUVClose (ObitUV *in, ObitErr *err);
00310
00312 ObitIOCode ObitUVIOSet (ObitUV *in, ObitErr *err);
00313
00315 ObitIOCode ObitUVRead (ObitUV *in, gfloat *data, ObitErr *err);
00316 typedef ObitIOCode (*ObitUVReadFP) (ObitUV *in, gfloat *data,
00317 ObitErr *err);
00318
00320 ObitIOCode ObitUVReadSelect (ObitUV *in, gfloat *data, ObitErr *err);
00321 typedef ObitIOCode (*ObitUVReadSelectFP) (ObitUV *in, gfloat *data,
00322 ObitErr *err);
00323
00325 ObitIOCode ObitUVWrite (ObitUV *in, gfloat *data, ObitErr *err);
00326 typedef ObitIOCode (*ObitUVWriteFP) (ObitUV *in, gfloat *data, ObitErr *err);
00327
00329 ObitIOCode ObitUVRewrite (ObitUV *in, gfloat *data, ObitErr *err);
00330 typedef ObitIOCode (*ObitUVRewritefp) (ObitUV *in, gfloat *data, ObitErr *err);
00331
00333 ObitTable* newObitUVTable (ObitUV *in, ObitIOAccess access,
00334 gchar *tabType, glong *tabver, ObitErr *err);
00335 typedef ObitTable* (*newObitUVTableFP) (ObitUV *in, ObitIOAccess access,
00336 gchar *tabType, glong *tabver,
00337 ObitErr *err);
00338
00340 ObitIOCode ObitUVZapTable (ObitUV *in, gchar *tabType, glong tabVer,
00341 ObitErr *err);
00342 typedef ObitIOCode (*ObitUVZapTableFP) (ObitUV *in, gchar *tabType,
00343 glong tabVer, ObitErr *err);
00344
00346 ObitIOCode ObitUVCopyTables (ObitUV *in, ObitUV *out, gchar **exclude,
00347 gchar **include, ObitErr *err);
00348 typedef ObitIOCode (*ObitUVCopyTablesFP) (ObitUV *in, ObitUV *out,
00349 gchar **exclude, gchar **include,
00350 ObitErr *err);
00351
00353 ObitIOCode ObitUVUpdateTables (ObitUV *in, ObitErr *err);
00354 typedef ObitIOCode (*ObitUVUpdateTablesFP) (ObitUV *in, ObitErr *err);
00355
00357 void ObitUVGetFreq (ObitUV* in, ObitErr *err);
00358
00360 ObitIOCode ObitUVGetSubA (ObitUV *in, ObitErr *err);
00361
00363 void ObitUVGetRADec (ObitUV *uvdata, gdouble *ra, gdouble *dec,
00364 ObitErr *err);
00365
00367 void ObitUVGetSouInfo (ObitUV *uvdata, ObitErr *err);
00368
00370 void ObitUVWriteKeyword (ObitUV *in,
00371 gchar* name, ObitInfoType type, gint32 *dim,
00372 gconstpointer data, ObitErr *err);
00374 void ObitUVReadKeyword (ObitUV *in,
00375 gchar* name, ObitInfoType *type, gint32 *dim,
00376 gpointer data, ObitErr *err);
00377
00379 glong ObitUVChanSel (ObitUV *in, gint32 *dim, gint *IChanSel, ObitErr *err);
00380 typedef glong (*ObitUVChanSelFP) (ObitUV *in, gint32 *dim, gint *IChanSel,
00381 ObitErr *err);
00382
00383
00389 typedef struct {
00390 #include "ObitUVClassDef.h"
00391 } ObitUVClassInfo;
00392
00393 #endif