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

ObitData.c File Reference

ObitData class function definitions. More...

#include "ObitData.h"
#include "ObitSystem.h"
#include "ObitMem.h"
#include "ObitIOHistoryAIPS.h"
#include "ObitImage.h"
#include "ObitIOTableAIPSUtil.h"
#include "ObitIOTableFITSUtil.h"

Defines

#define ObitGenericData(in)   in->ClassInfo==ObitDataGetClass()
 Macro to determine if an object is a generic ObitData Returns TRUE if a member, else FALSE in = object to reference.

Functions

void ObitDataInit (gpointer in)
 Private: Initialize newly instantiated object.
void ObitDataClear (gpointer in)
 Private: Deallocate members.
ObitDatanewObitData (gchar *name)
 Public: Constructor.
ObitDatanewObitDataScratch (ObitData *in, ObitErr *err)
 Public: Copy Constructor for scratch file.
gconstpointer ObitDataGetClass (void)
 Public: ClassInfo pointer.
gboolean ObitDataSame (ObitData *in1, ObitData *in2, ObitErr *err)
 Public: Do two ObitDatas have the same underlying structures?.
ObitDataObitDataZap (ObitData *in, ObitErr *err)
 Public: Delete underlying structures.
void ObitDataRename (ObitData *in, ObitErr *err)
 Public: Rename underlying structures.
ObitDataObitDataCopy (ObitData *in, ObitData *out, ObitErr *err)
 Public: Copy (deep) constructor.
void ObitDataClone (ObitData *in, ObitData *out, ObitErr *err)
 Public: Copy structure.
ObitIOCode ObitDataOpen (ObitData *in, ObitIOAccess access, ObitErr *err)
 Public: Create ObitIO structures and open file.
ObitIOCode ObitDataClose (ObitData *in, ObitErr *err)
 Public: Close file and become inactive.
void ObitDataFullInstantiate (ObitData *in, gboolean exist, ObitErr *err)
 Public: Fully instantiate.
ObitTablenewObitDataTable (ObitData *in, ObitIOAccess access, gchar *tabType, glong *tabVer, ObitErr *err)
 Public: Return an associated Table.
ObitIOCode ObitDataZapTable (ObitData *in, gchar *tabType, glong tabVer, ObitErr *err)
 Public: Destroy an associated Table.
ObitHistorynewObitDataHistory (ObitData *in, ObitIOAccess access, ObitErr *err)
 Public: Return an associated History.
ObitIOCode ObitDataCopyTables (ObitData *in, ObitData *out, gchar **exclude, gchar **include, ObitErr *err)
 Public: Copy associated Tables.
ObitIOCode ObitDataUpdateTables (ObitData *in, ObitErr *err)
 Public: Update disk resident tables information.
void ObitDataCopyTable (ObitData *in, ObitData *out, gchar *tabType, glong *inver, glong *outver, ObitErr *err)
 Public: Copy a given table from one ObitData to another.
ObitIOCode ObitDataIOSet (ObitData *in, ObitErr *err)
 Public: Reset IO to start of file.
void ObitDataSetupIO (ObitData *in, ObitErr *err)
 Public: Assign/Initialize IO member.
void ObitDataWriteKeyword (ObitData *in, gchar *name, ObitInfoType type, gint32 *dim, gconstpointer data, ObitErr *err)
 Public: Write header keyword.
void ObitDataReadKeyword (ObitData *in, gchar *name, ObitInfoType *type, gint32 *dim, gpointer data, ObitErr *err)
 Public: Read header keyword.
void ObitDataClassInit (void)
 Public: Class initializer.


Detailed Description

ObitData class function definitions.

This class is derived from the Obit base class.


Define Documentation

#define ObitGenericData in   )     in->ClassInfo==ObitDataGetClass()
 

Macro to determine if an object is a generic ObitData Returns TRUE if a member, else FALSE in = object to reference.


Function Documentation

ObitData* newObitData gchar *  name  ) 
 

Public: Constructor.

A generic ObitData object allows access to tables byt not the main data Initializes class if needed on first call.

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

ObitHistory* newObitDataHistory ObitData in,
ObitIOAccess  access,
ObitErr err
 

Public: Return an associated History.

If such an object exists, a reference to it is returned, else a new object is created and if access=OBIT_IO_WriteOnly entered in the ObitTableList if appropriate (AIPS)

Parameters:
in Pointer to object with associated tables. This MUST have been opened before this call.
access access (OBIT_IO_ReadOnly,OBIT_IO_ReadWrite, or OBIT_IO_WriteOnly).
err ObitErr for reporting errors.
Returns:
pointer to created ObitTable, NULL on failure.

ObitData* newObitDataScratch ObitData in,
ObitErr err
 

Public: Copy Constructor for scratch file.

A scratch Data is more or less the same as a normal Data except that it is automatically deleted on the final unreference. The output will have the underlying files of the same type as in already allocated. Virtual - calls actual class member; not supported for Generic ObitData

Parameters:
in The object to copy
err Error stack, returns if not empty.
Returns:
pointer to the new object.

ObitTable* newObitDataTable ObitData in,
ObitIOAccess  access,
gchar *  tabType,
glong *  tabVer,
ObitErr err
 

Public: Return an associated Table.

If such an object exists, a reference to it is returned, else a new object is created and entered in the ObitTableList.

Parameters:
in Pointer to object with associated tables. This MUST have been opened before this call.
access access (OBIT_IO_ReadOnly,OBIT_IO_ReadWrite, or OBIT_IO_WriteOnly). This is used to determine defaulted version number and a different value may be used for the actual Open.
tabType The table type (e.g. "AIPS CC").
tabVer Desired version number, may be zero in which case the highest extant version is returned for read and the highest+1 for write.
err ObitErr for reporting errors.
Returns:
pointer to created ObitTable, NULL on failure.

void ObitDataClassInit void   ) 
 

Public: Class initializer.

void ObitDataClear gpointer  inn  ) 
 

Private: Deallocate members.

Does (recursive) deallocation of parent class members. For some reason this wasn't build into the GType class.

Parameters:
inn Pointer to the object to deallocate. Actually it should be an ObitData* cast to an Obit*.

void ObitDataClone ObitData in,
ObitData out,
ObitErr err
 

Public: Copy structure.

Virtual - calls actual class member; not supported for Generic ObitData

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.

ObitIOCode ObitDataClose ObitData in,
ObitErr err
 

Public: Close file and become inactive.

Virtual - calls actual class member

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

ObitData* ObitDataCopy ObitData in,
ObitData 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. If the contents of the data are copied, all associated tables are copied first. 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. Virtual - calls actual class member; not supported for Generic ObitData

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.

void ObitDataCopyTable ObitData in,
ObitData out,
gchar *  tabType,
glong *  inver,
glong *  outver,
ObitErr err
 

Public: Copy a given table from one ObitData to another.

Any previous data in the output table will be lost.

Parameters:
in The ObitData with tables to copy.
out An ObitData to copy the tables to, old ones replaced.
tabType Table type, e.g. "AIPS CC"
inver Input table version number, 0=>highest, actual returned
outver Output table version number, 0=>new, actual returned
err ObitErr for reporting errors.

ObitIOCode ObitDataCopyTables ObitData in,
ObitData out,
gchar **  exclude,
gchar **  include,
ObitErr err
 

Public: Copy associated Tables.

Parameters:
in The ObitData with tables to copy.
out An ObitData to copy the tables to, old ones replaced.
exclude a NULL termimated list of table types NOT to copy. If NULL, use include
include a NULL termimated list of table types to copy. ignored if exclude nonNULL.
err ObitErr for reporting errors.
Returns:
return code, OBIT_IO_OK=> OK

void ObitDataFullInstantiate ObitData in,
gboolean  exist,
ObitErr err
 

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; not supported for Generic ObitData

Parameters:
in Pointer to object
exist TRUE if object should previously exist, else FALSE
err ObitErr for reporting errors.
Returns:
error code, OBIT_IO_OK=> OK

gconstpointer ObitDataGetClass void   ) 
 

Public: ClassInfo pointer.

Returns:
pointer to the class structure.

void ObitDataInit gpointer  inn  ) 
 

Private: Initialize newly instantiated object.

Parent classes portions are (recursively) initialized first

Parameters:
inn Pointer to the object to initialize.

ObitIOCode ObitDataIOSet ObitData in,
ObitErr err
 

Public: Reset IO to start of file.

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

ObitIOCode ObitDataOpen ObitData in,
ObitIOAccess  access,
ObitErr err
 

Public: Create ObitIO structures and open file.

Virtual - calls actual class member Reads table list if in generic ObitData Object

Parameters:
in Pointer to object to be opened.
access access (OBIT_IO_ReadOnly,OBIT_IO_ReadWrite, OBIT_IO_ReadCal 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

void ObitDataReadKeyword ObitData in,
gchar *  name,
ObitInfoType *  type,
gint32 *  dim,
gpointer  data,
ObitErr err
 

Public: Read header keyword.

Parameters:
in object to update, must be fully instantiated
name [out] The label (keyword) of the information. Max 8 char
type [out] Data type of data element (enum defined in ObitInfoList class).
dim [out] Dimensionality of datum. Only scalars and strings up to 8 char are supported Note: for strings, the first element is the length in char.
data [out] Pointer to the data.
err ObitErr for reporting errors.

void ObitDataRename ObitData in,
ObitErr err
 

Public: Rename underlying structures.

New name information depends on the underlying file type and is given on the info member. Not supported for Generic ObitData For FITS files:

  • "newFileName" OBIT_string (?,1,1) New Name of disk file.
For AIPS:
  • "newName" OBIT_string (12,1,1) New AIPS Name Blank = don't change
  • "newClass" OBIT_string (6,1,1) New AIPS Class Blank = don't changeO
  • "newSeq" OBIT_int (1,1,1) New AIPS Sequence 0 => unique value
    Parameters:
    in Pointer to object to be zapped.
    err ObitErr for reporting errors.

gboolean ObitDataSame ObitData in1,
ObitData in2,
ObitErr err
 

Public: Do two ObitDatas have the same underlying structures?.

This test is done using values entered into the ObitInfoList in case the object has not yet been opened. Not supported for Generic ObitData

Parameters:
in1 First object to compare
in2 Second object to compare
err ObitErr for reporting errors.
Returns:
TRUE if to objects have the same underlying structures else FALSE

void ObitDataSetupIO ObitData in,
ObitErr err
 

Public: Assign/Initialize IO member.

This is the principle place where the underlying file type is known. Virtual - calls actual class member; not supported for Generic ObitData

Parameters:
in object to attach myIO
err ObitErr for reporting errors.

ObitIOCode ObitDataUpdateTables ObitData in,
ObitErr err
 

Public: Update disk resident tables information.

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

void ObitDataWriteKeyword ObitData in,
gchar *  name,
ObitInfoType  type,
gint32 *  dim,
gconstpointer  data,
ObitErr err
 

Public: Write header keyword.

Parameters:
in object to update, must be open during call with Write access
name The label (keyword) of the information. Max 8 char
type Data type of data element (enum defined in ObitInfoList class).
dim Dimensionality of datum. Only scalars and strings up to 8 char are allowed Note: for strings, the first element is the length in char.
data Pointer to the data.
err ObitErr for reporting errors.

ObitData* ObitDataZap ObitData in,
ObitErr err
 

Public: Delete underlying structures.

Virtual - calls actual class member; not supported for Generic ObitData

Parameters:
in Pointer to object to be zapped.
err ObitErr for reporting errors.
Returns:
pointer for input object, NULL if deletion successful

ObitIOCode ObitDataZapTable ObitData in,
gchar *  tabType,
glong  tabVer,
ObitErr err
 

Public: Destroy an associated Table.

The table is removed from the ObitTableList but it is not updated. A call to ObitDataUpdateTables to update disk structures.

Parameters:
in Pointer to object with associated tables.
tabType The table type (e.g. "AIPS CC").
tabVer Desired version number, may be zero in which case the highest extant version is returned for read and the highest+1 for write. -1 => all versions of tabType
err ObitErr for reporting errors.
Returns:
return code, OBIT_IO_OK=> OK


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