#include "Obit.h"
#include "ObitErr.h"
#include "ObitThread.h"
#include "ObitInfoList.h"
#include "ObitIO.h"
#include "ObitTableDesc.h"
#include "ObitTableSel.h"
#include "ObitDef.h"
#include "ObitClassDef.h"
Go to the source code of this file.
Classes | |
| struct | ObitTable |
| ObitTable Class structure. More... | |
| struct | ObitTableRow |
| ObitTableRow Class structure. More... | |
| struct | ObitTableClassInfo |
| ClassInfo Structure For Table. More... | |
| struct | ObitTableRowClassInfo |
| ClassInfo Structure For TableRow. More... | |
Defines | |
| #define | ObitTableUnref(in) ObitUnref (in) |
| Macro to unreference (and possibly destroy) an ObitTable returns an ObitTable*. | |
| #define | ObitTableRef(in) ObitRef (in) |
| Macro to reference (update reference count) an ObitTable. | |
| #define | ObitTableIsA(in) ObitIsA (in, ObitTableGetClass()) |
| Macro to determine if an object is the member of this or a derived class. | |
| #define | ObitTableRowUnref(in) ObitUnref (in) |
| Macro to unreference (and possibly destroy) an ObitTableRow returns an ObitTableRow*. | |
| #define | ObitTableRowRef(in) ObitRef (in) |
| Macro to reference (update reference count) an ObitTableRow. | |
| #define | ObitTableRowIsA(in) ObitIsA (in, ObitTableRowGetClass()) |
| Macro to determine if an object is the member of this or a derived class. | |
| #define | ObitTableSetFITS(in, disk, file, tab, ver, nrow, err) |
| Convenience Macro to define Table I/O to a FITS file. | |
| #define | ObitTableSetAIPS(in, disk, cno, tab, ver, user, nrow, err) |
| Convenience Macro to define Table I/O to an AIPS file. | |
Typedefs | |
| typedef ObitTableRow *(* | newObitTableRowFP )(ObitTable *in) |
| Typedef for definition of class pointer structure. | |
| typedef void(* | ObitTableFullInstantiateFP )(ObitTable *in, gboolean exist, ObitErr *err) |
| typedef void(* | ObitTableClearRowsFP )(ObitTable *in, ObitErr *err) |
| typedef ObitTable *(* | ObitTableZapFP )(ObitTable *in, ObitErr *err) |
| Typedef for definition of class pointer structure. | |
| typedef ObitTable *(* | ObitTableConvertFP )(ObitTable *in) |
| typedef ObitIOCode(* | ObitTableOpenFP )(ObitTable *in, ObitIOAccess access, ObitErr *err) |
| typedef ObitIOCode(* | ObitTableCloseFP )(ObitTable *in, ObitErr *err) |
| typedef ObitIOCode(* | ObitTableReadFP )(ObitTable *in, glong row, gfloat *data, ObitErr *err) |
| typedef ObitIOCode(* | ObitTableReadSelectFP )(ObitTable *in, glong row, gfloat *data, ObitErr *err) |
| typedef void(* | ObitTableSetRowFP )(ObitTable *in, ObitTableRow *row, ObitErr *err) |
| typedef ObitIOCode(* | ObitTableWriteFP )(ObitTable *in, glong row, gfloat *data, ObitErr *err) |
| typedef ObitIOCode(* | ObitTableReadRowFP )(ObitTable *in, glong rowno, ObitTableRow *row, ObitErr *err) |
| typedef ObitIOCode(* | ObitTableWriteRowFP )(ObitTable *in, glong rowno, ObitTableRow *row, ObitErr *err) |
| typedef gchar *(* | ObitTableGetTypeFP )(ObitTable *in, ObitErr *err) |
| typedef glong(* | ObitTableGetVersionFP )(ObitTable *in, ObitErr *err) |
Functions | |
| void | ObitTableRowClassInit (void) |
| Public: Row Class initializer. | |
| ObitTableRow * | newObitTableRow (ObitTable *table) |
| Public: Constructor. | |
| gconstpointer | ObitTableRowGetClass (void) |
| Public: ClassInfo pointer. | |
| void | ObitTableClassInit (void) |
| Public: Class initializer. | |
| ObitTable * | newObitTable (gchar *name) |
| Public: Default constructor. | |
| void | ObitTableFullInstantiate (ObitTable *in, gboolean exist, ObitErr *err) |
| Public: Fully instantiate. | |
| void | ObitTableClearRows (ObitTable *in, ObitErr *err) |
| Public: Remove any previous entries - also forces instantiate. | |
| gconstpointer | ObitTableGetClass (void) |
| Public: ClassInfo pointer. | |
| ObitTable * | ObitTableZap (ObitTable *in, ObitErr *err) |
| Public: Delete underlying structures. | |
| ObitTable * | ObitTableCopy (ObitTable *in, ObitTable *out, ObitErr *err) |
| Public: Copy (deep) constructor. | |
| ObitTable * | ObitTableClone (ObitTable *in, ObitTable *out) |
| Public: Copy (shallow) constructor. | |
| void | ObitTableConcat (ObitTable *in, ObitTable *out, ObitErr *err) |
| Public: Concatenate two tables. | |
| ObitTable * | ObitTableConvert (ObitTable *in) |
| Public: Convert an ObitTable to a derived type. | |
| ObitIOCode | ObitTableOpen (ObitTable *in, ObitIOAccess access, ObitErr *err) |
| Public: Create ObitIO structures and open file. | |
| ObitIOCode | ObitTableClose (ObitTable *in, ObitErr *err) |
| Public: Close file and become inactive. | |
| ObitIOCode | ObitTableRead (ObitTable *in, glong row, gfloat *data, ObitErr *err) |
| Public: Read specified data. | |
| ObitIOCode | ObitTableReadSelect (ObitTable *in, glong row, gfloat *data, ObitErr *err) |
| Public: Read/select data. | |
| void | ObitTableSetRow (ObitTable *in, ObitTableRow *row, ObitErr *err) |
| Public: Attach Row to buffer. | |
| ObitIOCode | ObitTableWrite (ObitTable *in, glong row, gfloat *data, ObitErr *err) |
| Public: Write specified data. | |
| ObitIOCode | ObitTableReadRow (ObitTable *in, glong rowno, ObitTableRow *row, ObitErr *err) |
| Public: Read specified Row. | |
| ObitIOCode | ObitTableWriteRow (ObitTable *in, glong rowno, ObitTableRow *row, ObitErr *err) |
| Public: Write specified Row. | |
| gchar * | ObitTableGetType (ObitTable *in, ObitErr *err) |
| Public: Return table type. | |
| glong | ObitTableGetVersion (ObitTable *in, ObitErr *err) |
| Public: Return table version. | |
This class contains tabular data and allows access. An ObitTable is the front end to a persistent disk resident structure. Both FITS (as Tables) and AIPS cataloged data are supported.
This class is derived from the Obit class. Related functions are in the ObitImageUtil module and table type specific classes and utility modules.
In addition to the normal tabular data, a table will have a "_status" column to indicate the status of each row. The status value is read from and written to (some modification) AIPS tables but are not written to externally generated FITS tables which don't have these colummns. It will be written to Obit generated tables which will have these columns. Status values:
A copy of a pointer to an ObitTable should always be made using the ObitTableRef function which updates the reference count in the object. Then whenever freeing an ObitTable or changing a pointer, the function ObitTableUnref will decrement the reference count and destroy the object when the reference count hits 0.
|
|
Macro to determine if an object is the member of this or a derived class. Returns TRUE if a member, else FALSE in = object to reference |
|
|
Macro to reference (update reference count) an ObitTable. returns an ObitTable*. in = object to reference |
|
|
Macro to determine if an object is the member of this or a derived class. Returns TRUE if a member, else FALSE in = object to reference |
|
|
Macro to reference (update reference count) an ObitTableRow. returns an ObitTableRow*. in = object to reference |
|
|
Macro to unreference (and possibly destroy) an ObitTableRow returns an ObitTableRow*. in = object to unreference |
|
|
Value: G_STMT_START{ \
in->info->dim[0]=1; in->info->dim[1]=1; in->info->dim[2]=1; \
in->info->dim[3]=1; in->info->dim[4]=1; \
in->info->work[0] = OBIT_IO_AIPS; \
in->info->work[1]= ver; in->info->work[2]= nrow; \
ObitInfoListPut (in->info, "FileType", OBIT_int, \
in->info->dim, (gpointer)&in->info->work[0], err);\
in->info->dim[0] = 1; \
ObitInfoListPut (in->info, "Disk", OBIT_int, \
in->info->dim, (gpointer)&disk, err); \
ObitInfoListPut (in->info, "Ver", OBIT_int, \
in->info->dim, (gpointer)&in->info->work[1], err); \
ObitInfoListPut (in->info, "CNO", OBIT_int, \
in->info->dim, (gpointer)&cno, err); \
ObitInfoListPut (in->info, "User", OBIT_int, \
in->info->dim, (gpointer)&user, err); \
ObitInfoListPut (in->info, "nRowPIO", OBIT_int, \
in->info->dim, (gpointer)&in->info->work[2], err); \
in->info->dim[0] = 2; \
ObitInfoListPut (in->info, "TableType", OBIT_string, \
in->info->dim, (gpointer)&tab, err); \
}G_STMT_END
Sets values on ObitInfoList on input object. |
|
|
Value: G_STMT_START{ \
in->info->dim[0]=1; in->info->dim[1]=1; in->info->dim[2]=1; \
in->info->dim[3]=1; in->info->dim[4]=1; \
in->info->work[0] = OBIT_IO_FITS; \
in->info->work[1] = ver; in->info->work[2]= nrow; \
in->info->work[2] = disk; \
in->info->dim[0] = 1; \
ObitInfoListPut (in->info, "Disk", OBIT_int, \
in->info->dim, (gpointer)&in->info->work[2], err); \
ObitInfoListPut (in->info, "FileType", OBIT_int, \
in->info->dim, (gpointer)&in->info->work[0], err);\
ObitInfoListPut (in->info, "Ver", OBIT_int, \
in->info->dim, (gpointer)&in->info->work[1], err); \
ObitInfoListPut (in->info, "nRowPIO", OBIT_int, \
in->info->dim, (gpointer)&in->info->work[2], err); \
in->info->dim[0] = strlen(tab); \
ObitInfoListPut (in->info, "TabName", OBIT_string, \
in->info->dim, (gpointer)tab, err); \
in->info->dim[0] = strlen(file); \
ObitInfoListPut (in->info, "FileName", OBIT_string, \
in->info->dim, (gpointer)file, err); \
}G_STMT_END
Sets values on ObitInfoList on input object. |
|
|
Macro to unreference (and possibly destroy) an ObitTable returns an ObitTable*. in = object to unreference |
|
|
Typedef for definition of class pointer structure.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Typedef for definition of class pointer structure.
|
|
|
Public: Default constructor. Initializes class if needed on first call.
|
|
|
Public: Constructor. Initializes Row class if needed on first call.
|
|
|
Public: Class initializer.
|
|
||||||||||||
|
Public: Remove any previous entries - also forces instantiate.
|
|
||||||||||||
|
Public: Copy (shallow) constructor. The result will have pointers to the more complex members. Parent class members are included but any derived class info is ignored.
|
|
||||||||||||
|
Public: Close file and become inactive.
|
|
||||||||||||||||
|
Public: Concatenate two tables.
|
|
|
Public: Convert an ObitTable to a derived type.
|
|
||||||||||||||||
|
Public: Copy (deep) constructor. Copies are made of complex members including disk files; these will be copied applying whatever selection is associated with the input. Objects should be closed on input and will be closed on output. In order for the disk file structures to be copied, the output file must be sufficiently defined that it can be written. The copy will be attempted but no errors will be logged until both input and output have been successfully opened. ObitInfoList and ObitThread members are only copied if the output object didn't previously exist. Parent class members are included but any derived class info is ignored.
|
|
||||||||||||||||
|
Public: Fully instantiate. If object has previously been opened, as demonstrated by the existance of its myIO member, this operation is a no-op. Virtual - calls actual class member
|
|
|
Public: ClassInfo pointer.
|
|
||||||||||||
|
Public: Return table type. "AIPS AN")
|
|
||||||||||||
|
Public: Return table version.
|
|
||||||||||||||||
|
Public: Create ObitIO structures and open file. The image descriptor is read if OBIT_IO_ReadOnly or OBIT_IO_ReadWrite and written to disk if opened OBIT_IO_WriteOnly. After the file has been opened the member, buffer is initialized for reading/storing the table unless member bufferSize is <0. If the requested version ("Ver" in InfoList) is 0 then the highest numbered table of the same type is opened on Read or Read/Write, or a new table is created on on Write. The file etc. info should have been stored in the ObitInfoList:
|
|
||||||||||||||||||||
|
Public: Read specified data. The ObitTableDesc maintains the current location in the table. The number read will be mySel->nRowPIO (until the end of the selected range of rows in which case it will be smaller). The first row number after a read is myDesc->firstRow and the number of row is myDesc->numRowBuff. If there are existing rows in the buffer marked as modified ("_status" column value =1) the buffer is rewritten to disk before the new buffer is read.
|
|
||||||||||||||||||||
|
Public: Read specified Row. The ObitTableDesc maintains the current location in the table. If there are existing rows in the buffer marked as modified ("_status" column value =1) the buffer is rewritten to disk before the new buffer is read.
|
|
||||||||||||||||||||
|
Public: Read/select data. The number read will be mySel->nRowPIO (until the end of the selected range of visibilities in which case it will be smaller). The first visibility number after a read is myDesc->firstRow and the number of visibilities is myDesc->numRowBuff. If there are existing rows in the buffer marked as modified ("_status" column value =1) the buffer is rewritten to disk before the new buffer is read.
|
|
|
Public: Row Class initializer.
|
|
|
Public: ClassInfo pointer.
|
|
||||||||||||||||
|
Public: Attach Row to buffer. This is only useful prior to filling a row structure in preparation . for a WriteRow operation. Array members of the Row structure are . pointers to independently allocated memory, this routine allows using . the table IO buffer instead of allocating yet more memory.. This routine need only be called once to initialize a Row structure for write..
|
|
||||||||||||||||||||
|
Public: Write specified data. The data in the buffer will be written starting at visibility myDesc->firstRow and the number written will be myDesc->numRowBuff which should not exceed mySel->nRowPIO if the internal buffer is used. myDesc->firstRow will be maintained and need not be changed for sequential writing.
|
|
||||||||||||||||||||
|
Public: Write specified Row.
|
|
||||||||||||
|
Public: Delete underlying structures.
|
1.3.9.1