Main Page | Class List | Directories | File List | Class Members | File Members

ObitTableNX.h File Reference

ObitTableNX class definition. More...

#include "Obit.h"
#include "ObitErr.h"
#include "ObitTable.h"
#include "ObitData.h"
#include "ObitDef.h"
#include "ObitTableDef.h"
#include "ObitTableRowDef.h"
#include "ObitClassDef.h"
#include "ObitTableClassDef.h"
#include "ObitTableRowClassDef.h"

Go to the source code of this file.

Classes

struct  ObitTableNX
 ObitTableNX Class structure. More...
struct  ObitTableNXRow
 ObitTableNXRow Class structure. More...
struct  ObitTableNXClassInfo
 ClassInfo Structure. More...
struct  ObitTableNXRowClassInfo
 ClassInfo Structure For TableNXRow. More...

Defines

#define MAXKEYCHARTABLENX   24
 Number of characters for Table keyword.
#define ObitTableNXUnref(in)   ObitUnref (in)
 Macro to unreference (and possibly destroy) an ObitTableNX returns an ObitTableNX*.
#define ObitTableNXRef(in)   ObitRef (in)
 Macro to reference (update reference count) an ObitTableNX.
#define ObitTableNXIsA(in)   ObitIsA (in, ObitTableNXGetClass())
 Macro to determine if an object is the member of this or a derived class.
#define ObitTableNXRowUnref(in)   ObitUnref (in)
 Macro to unreference (and possibly destroy) an ObitTableNXRow returns an ObitTableNXRow*.
#define ObitTableNXRowRef(in)   ObitRef (in)
 Macro to reference (update reference count) an ObitTableNXRow.
#define ObitTableNXRowIsA(in)   ObitIsA (in, ObitTableNXRowGetClass())
 Macro to determine if an object is the member of this or a derived class.

Functions

void ObitTableNXRowClassInit (void)
 Public: Row Class initializer.
ObitTableNXRownewObitTableNXRow (ObitTableNX *table)
 Public: Constructor.
gconstpointer ObitTableNXRowGetClass (void)
 Public: ClassInfo pointer.
void ObitTableNXClassInit (void)
 Public: Class initializer.
ObitTableNXnewObitTableNX (gchar *name)
 Public: Constructor.
ObitTableNXnewObitTableNXValue (gchar *name, ObitData *file, glong *ver, ObitIOAccess access, ObitErr *err)
 Public: Constructor from values.
gconstpointer ObitTableNXGetClass (void)
 Public: ClassInfo pointer.
ObitTableNXObitTableNXCopy (ObitTableNX *in, ObitTableNX *out, ObitErr *err)
 Public: Copy (deep) constructor.
ObitTableNXObitTableNXClone (ObitTableNX *in, ObitTableNX *out)
 Public: Copy (shallow) constructor.
ObitTableNXObitTableNXConvert (ObitTable *in)
 Public: Convert an ObitTable to an ObitTableNX.
ObitIOCode ObitTableNXOpen (ObitTableNX *in, ObitIOAccess access, ObitErr *err)
 Public: Create ObitIO structures and open file.
ObitIOCode ObitTableNXReadRow (ObitTableNX *in, glong iNXRow, ObitTableNXRow *row, ObitErr *err)
 Public: Read a table row.
void ObitTableNXSetRow (ObitTableNX *in, ObitTableNXRow *row, ObitErr *err)
 Public: Init a table row for write.
ObitIOCode ObitTableNXWriteRow (ObitTableNX *in, glong iNXRow, ObitTableNXRow *row, ObitErr *err)
 Public: Write a table row.
ObitIOCode ObitTableNXClose (ObitTableNX *in, ObitErr *err)
 Public: Close file and become inactive.


Detailed Description

ObitTableNX class definition.

This class is derived from the ObitTable class.

This class contains tabular data and allows access. "AIPS NX" contains an index for a uv data file giving the times, source and visibility range for a sequence of scans. A scan is a set of observations in the same mode and on the same source. An ObitTableNX is the front end to a persistent disk resident structure. This class is derived from the ObitTable class.

This class contains tabular data and allows access. "AIPS NX" table An ObitTableNX is the front end to a persistent disk resident structure. Both FITS (as Tables) and AIPS cataloged data are supported.

HistoryTable data storage

In memory tables are stored in a fashion similar to how they are stored on disk - in large blocks in memory rather than structures. Due to the word alignment requirements of some machines, they are stored by order of the decreasing element size: double, float long, int, short, char rather than the logical order. The details of the storage in the buffer are kept in the #ObitTableNXDesc.

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:

Specifying desired data transfer parameters

The desired data transfers are specified in the member ObitInfoList. There are separate sets of parameters used to specify the FITS or AIPS data files. In the following an ObitInfoList entry is defined by the name in double quotes, the data type code as an #ObitInfoType enum and the dimensions of the array (? => depends on application). To specify whether the underlying data files are FITS or AIPS The following apply to both types of files:

FITS files

This implementation uses cfitsio which allows using, in addition to regular FITS images, gzip compressed files, pipes, shared memory and a number of other input forms. The convenience Macro #ObitTableNXSetFITS simplifies specifying the desired data. Binary tables are used for storing visibility data in FITS. For accessing FITS files the following entries in the ObitInfoList are used: subsection ObitTableNXAIPS AIPS files The ObitAIPS class must be initialized before accessing AIPS files; this uses ObitAIPSClassInit. For accessing AIPS files the following entries in the ObitInfoList are used:

Creators and Destructors

An ObitTableNX can be created using newObitTableNXValue which attaches the table to an ObitData for the object. If the output ObitTableNX has previously been specified, including file information, then ObitTableNXCopy will copy the disk resident as well as the memory resident information.

A copy of a pointer to an ObitTableNX should always be made using the ObitTableNXRef function which updates the reference count in the object. Then whenever freeing an ObitTableNX or changing a pointer, the function ObitTableNXUnref will decrement the reference count and destroy the object when the reference count hits 0.

I/O

Visibility data is available after an input object is "Opened" and "Read". I/O optionally uses a buffer attached to the ObitTableNX or some external location. To Write an ObitTableNX, create it, open it, and write. The object should be closed to ensure all data is flushed to disk. Deletion of an ObitTableNX after its final unreferencing will automatically close it.

Define Documentation

#define MAXKEYCHARTABLENX   24
 

Number of characters for Table keyword.

#define ObitTableNXIsA in   )     ObitIsA (in, ObitTableNXGetClass())
 

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

#define ObitTableNXRef in   )     ObitRef (in)
 

Macro to reference (update reference count) an ObitTableNX.

returns an ObitTableNX*. in = object to reference

#define ObitTableNXRowIsA in   )     ObitIsA (in, ObitTableNXRowGetClass())
 

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

#define ObitTableNXRowRef in   )     ObitRef (in)
 

Macro to reference (update reference count) an ObitTableNXRow.

returns an ObitTableNXRow*. in = object to reference

#define ObitTableNXRowUnref in   )     ObitUnref (in)
 

Macro to unreference (and possibly destroy) an ObitTableNXRow returns an ObitTableNXRow*.

in = object to unreference

#define ObitTableNXUnref in   )     ObitUnref (in)
 

Macro to unreference (and possibly destroy) an ObitTableNX returns an ObitTableNX*.

in = object to unreference


Function Documentation

ObitTableNX* newObitTableNX gchar *  name  ) 
 

Public: Constructor.

Initializes class if needed on first call.

Parameters:
name An optional name for the object.
Returns:
the new object.

ObitTableNXRow* newObitTableNXRow ObitTableNX table  ) 
 

Public: Constructor.

If table is open and for write, the row is attached to the buffer Initializes Row class if needed on first call.

Parameters:
name An optional name for the object.
Returns:
the new object.

ObitTableNX* newObitTableNXValue gchar *  name,
ObitData file,
glong *  ver,
ObitIOAccess  access,
ObitErr err
 

Public: Constructor from values.

Creates a new table structure and attaches to the TableList of file. If the specified table already exists then it is returned. Initializes class if needed on first call. Forces an update of any disk resident structures (e.g. AIPS header).

Parameters:
name An optional name for the object.
file ObitData which which the table is to be associated.
ver Table version number. 0=> add higher, value used returned
access access (OBIT_IO_ReadOnly, means do not create if it doesn't exist.
err Error stack, returns if not empty.
Returns:
the new object, NULL on failure.

void ObitTableNXClassInit void   ) 
 

Public: Class initializer.

ObitTableNX* ObitTableNXClone ObitTableNX in,
ObitTableNX out
 

Public: Copy (shallow) constructor.

ObitIOCode ObitTableNXClose ObitTableNX in,
ObitErr err
 

Public: Close file and become inactive.

Parameters:
in Pointer to object to be closed.
err ObitErr for reporting errors.
Returns:
error code, OBIT_IO_OK=> OK

ObitTableNX* ObitTableNXConvert ObitTable in  ) 
 

Public: Convert an ObitTable to an ObitTableNX.

New object will have references to members of in.

Parameters:
in The object to copy, will still exist afterwards and should be Unrefed if not needed.
Returns:
pointer to the new object.

ObitTableNX* ObitTableNXCopy ObitTableNX in,
ObitTableNX out,
ObitErr err
 

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.

Parameters:
in The object to copy
out An existing object pointer for output or NULL if none exists.
err Error stack, returns if not empty.
Returns:
pointer to the new object.

gconstpointer ObitTableNXGetClass void   ) 
 

Public: ClassInfo pointer.

Returns:
pointer to the class structure.

ObitIOCode ObitTableNXOpen ObitTableNX in,
ObitIOAccess  access,
ObitErr err
 

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:

  • "FileType" OBIT_int scalar = OBIT_IO_FITS or OBIT_IO_AIPS for file type (see class documentation for details).
  • "nRowPIO" OBIT_int scalar = Maximum number of table rows per transfer, this is the target size for Reads (may be fewer) and is used to create buffers.
    Parameters:
    in Pointer to object to be opened.
    access access (OBIT_IO_ReadOnly,OBIT_IO_ReadWrite, or OBIT_IO_WriteOnly). If OBIT_IO_WriteOnly any existing data in the output file will be lost.
    err ObitErr for reporting errors.
    Returns:
    return code, OBIT_IO_OK=> OK

ObitIOCode ObitTableNXReadRow ObitTableNX in,
glong  iNXRow,
ObitTableNXRow row,
ObitErr err
 

Public: Read a table row.

Scalar values are copied but for array values, pointers into the data array are returned.

Parameters:
in Table to read
iNXRow Row number, -1 -> next
row Table Row structure to receive data
err ObitErr for reporting errors.
Returns:
return code, OBIT_IO_OK=> OK

void ObitTableNXRowClassInit void   ) 
 

Public: Row Class initializer.

gconstpointer ObitTableNXRowGetClass void   ) 
 

Public: ClassInfo pointer.

Returns:
pointer to the Row class structure.

void ObitTableNXSetRow ObitTableNX in,
ObitTableNXRow row,
ObitErr err
 

Public: Init a table row for write.

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..

Parameters:
in Table with buffer to be written
row Table Row structure to attach
err ObitErr for reporting errors.

ObitIOCode ObitTableNXWriteRow ObitTableNX in,
glong  iNXRow,
ObitTableNXRow row,
ObitErr err
 

Public: Write a table row.

Before calling this routine, the row structure needs to be initialized and filled with data. The array members of the row structure are pointers to independently allocated memory. These pointers can be set to the correct table buffer locations using ObitTableNXSetRow

Parameters:
in Table to read
iNXRow Row number, -1 -> next
row Table Row structure containing data
err ObitErr for reporting errors.
Returns:
return code, OBIT_IO_OK=> OK


Generated on Fri Aug 31 22:13:09 2007 for Obit by  doxygen 1.3.9.1