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

ObitIOOTFFITS.c File Reference

ObitIOOTFFITS class function definitions. More...

#include "ObitIOOTFFITS.h"
#include "ObitOTFCal.h"
#include "ObitTableList.h"
#include "ObitFile.h"
#include "ObitFITS.h"
#include "ObitMem.h"
#include "ObitOTFArrayGeom.h"

Classes

union  sequiv
 Used for byte swapping shorts. More...
union  fequiv
 Used for byte swapping floats. More...

Functions

void ObitIOOTFFITSInit (gpointer in)
 Private: Initialize newly instantiated object.
void ObitIOOTFFITSClear (gpointer in)
 Private: Deallocate members.
void ObitIOOTFKeysOtherRead (ObitIOOTFFITS *in, gint *status, ObitErr *err)
 Private: Copy other header keywords.
void ObitIOOTFFITSFixBug (gchar *out, gchar *in, glong maxn)
 Private: Fix bug in cfitsio keyword parsing.
ObitIOOTFFITSnewObitIOOTFFITS (gchar *name, ObitInfoList *info, ObitErr *err)
 Public: Constructor.
gconstpointer ObitIOOTFFITSGetClass (void)
 Public: ClassInfo pointer.
gboolean ObitIOOTFFITSSame (ObitIO *in, ObitInfoList *in1, ObitInfoList *in2, ObitErr *err)
 Public: Are underlying structures the same.
void ObitIOOTFFITSRename (ObitIO *in, ObitInfoList *info, ObitErr *err)
 Public: Rename underlying structures.
void ObitIOOTFFITSZap (ObitIOOTFFITS *in, ObitErr *err)
 Public: Delete underlying structures.
ObitIOOTFFITSObitIOOTFFITSCopy (ObitIOOTFFITS *in, ObitIOOTFFITS *out, ObitErr *err)
 Public: Copy constructor.
ObitIOCode ObitIOOTFFITSOpen (ObitIOOTFFITS *in, ObitIOAccess access, ObitInfoList *info, ObitErr *err)
 Public: Open.
ObitIOCode ObitIOOTFFITSClose (ObitIOOTFFITS *in, ObitErr *err)
 Public: Close.
ObitIOCode ObitIOOTFFITSSet (ObitIOOTFFITS *in, ObitInfoList *info, ObitErr *err)
 Public: Init I/O.
ObitIOCode ObitIOOTFFITSRead (ObitIOOTFFITS *in, gfloat *data, ObitErr *err)
 Public: Read.
ObitIOCode ObitIOOTFFITSReadSelect (ObitIOOTFFITS *in, gfloat *data, ObitErr *err)
 Read data from disk applying selection and any calibration.
ObitIOCode ObitIOOTFFITSWrite (ObitIOOTFFITS *in, gfloat *data, ObitErr *err)
 Public: Write.
ObitIOCode ObitIOOTFFITSReadDescriptor (ObitIOOTFFITS *in, ObitErr *err)
 Public: Read Descriptor.
ObitIOCode ObitIOOTFFITSWriteDescriptor (ObitIOOTFFITS *in, ObitErr *err)
 Public: Write Descriptor.
ObitIOCode ObitIOOTFFITSFlush (ObitIOOTFFITS *in, ObitErr *err)
 Public: Flush.
void ObitIOOTFFITSCreateBuffer (gfloat **data, glong *size, ObitIOOTFFITS *in, ObitInfoList *info, ObitErr *err)
 Public: Create buffer.
Obit * newObitIOOTFFITSTable (ObitIOOTFFITS *in, ObitIOAccess access, gchar *tabType, glong *tabVer, ObitErr *err)
 Public: Create an associated Table Typed as base class to avoid problems.
ObitIOCode ObitIOOTFFITSUpdateTables (ObitIOOTFFITS *in, ObitInfoList *info, ObitErr *err)
 Public: Update disk resident tables information.
void ObitIOOTFFITSClassInit (void)
 Public: Class initializer.


Detailed Description

ObitIOOTFFITS class function definitions.

This class is derived from the ObitIO class.


Function Documentation

ObitIOOTFFITS* newObitIOOTFFITS gchar *  name,
ObitInfoList *  info,
ObitErr *  err
 

Public: Constructor.

Initializes class on the first call.

Parameters:
name An optional name for the object.
info if non-NULL it is used to initialize the new object.
err ObitErr for error messages.
Returns:
the new object.

Obit* newObitIOOTFFITSTable ObitIOOTFFITS in,
ObitIOAccess  access,
gchar *  tabType,
glong *  tabVer,
ObitErr *  err
 

Public: Create an associated Table Typed as base class to avoid problems.

If such an object exists, a reference to it is returned, else a new object is created and entered in the ObitTableList. Returned object is typed an Obit to prevent circular definitions between the ObitTable and the ObitIO classes.

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 OBIT_IO_WriteOnly.
err ObitErr for reporting errors.
Returns:
pointer to created ObitTable, NULL on failure.

void ObitIOOTFFITSClassInit void   ) 
 

Public: Class initializer.

void ObitIOOTFFITSClear gpointer  inn  ) 
 

Private: Deallocate members.

Does (recursive) deallocation of parent class members.

Parameters:
inn Pointer to the object to deallocate.

ObitIOCode ObitIOOTFFITSClose ObitIOOTFFITS in,
ObitErr *  err
 

Public: Close.

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

ObitIOOTFFITS* ObitIOOTFFITSCopy ObitIOOTFFITS in,
ObitIOOTFFITS out,
ObitErr *  err
 

Public: Copy constructor.

The result will have pointers to the more complex members. 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 Obit error stack object.
Returns:
pointer to the new object.

void ObitIOOTFFITSCreateBuffer gfloat **  data,
glong *  size,
ObitIOOTFFITS in,
ObitInfoList *  info,
ObitErr *  err
 

Public: Create buffer.

Should be called after ObitIO is opened.

Parameters:
data (output) pointer to data array
size (output) size of data array in floats.
in Pointer to object to be accessed.
info ObitInfoList with instructions
err ObitErr for reporting errors.

void ObitIOOTFFITSFixBug gchar *  out,
gchar *  in,
glong  maxn
 

Private: Fix bug in cfitsio keyword parsing.

This routine blank fills out and null terminates at out[maxn-1].

Parameters:
out Output string
in Input string from cfitsio keyword read
maxn length of out

ObitIOCode ObitIOOTFFITSFlush ObitIOOTFFITS in,
ObitErr *  err
 

Public: Flush.

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

gconstpointer ObitIOOTFFITSGetClass void   ) 
 

Public: ClassInfo pointer.

Initializes class if needed on first call.

Returns:
pointer to the class structure.

void ObitIOOTFFITSInit gpointer  inn  ) 
 

Private: Initialize newly instantiated object.

Parameters:
inn Pointer to the object to initialize.

ObitIOCode ObitIOOTFFITSOpen ObitIOOTFFITS in,
ObitIOAccess  access,
ObitInfoList *  info,
ObitErr *  err
 

Public: Open.

The file etc. info should have been stored in the ObitInfoList. The descriptor is read if ReadOnly or ReadOnly and written to disk if opened WriteOnly. For accessing FITS files the following entries in the ObitInfoList are used:

  • "Disk" OBIT_int (1,1,1) FITS "disk" number.
  • "FileName" OBIT_string (?,1,1) FITS file name.
    Parameters:
    in Pointer to object to be opened.
    access access (OBIT_IO_ReadOnly,OBIT_IO_ReadWrite)
    info ObitInfoList with instructions for opening
    err ObitErr for reporting errors.
    Returns:
    return code, 0=> OK

ObitIOCode ObitIOOTFFITSRead ObitIOOTFFITS in,
gfloat *  data,
ObitErr *  err
 

Public: Read.

The number read will be mySel->nRecPIO (until the end of the selected range of records in which case it will be smaller). The first row number after a read is myDesc->firstRec and the number of rows attempted is mySel->numRecRead; actual value saved as myDesc->numRecBuff. When OBIT_IO_EOF is returned all data has been read (then is no new data in data) and the I/O has been closed.

Parameters:
in Pointer to object to be read.
data pointer to buffer to write results.
err ObitErr for reporting errors.
Returns:
return code, 0=> OK

ObitIOCode ObitIOOTFFITSReadDescriptor ObitIOOTFFITS in,
ObitErr *  err
 

Public: Read Descriptor.

Also reads the Array Geometry table.

Parameters:
in Pointer to object with ObitOTFDesc to be read.
err ObitErr for reporting errors.
Returns:
return code, 0=> OK

ObitIOCode ObitIOOTFFITSReadSelect ObitIOOTFFITS in,
gfloat *  data,
ObitErr *  err
 

Read data from disk applying selection and any calibration.

The number read will be mySel->nRecPIO (until the end of the selected range of records in which case it will be smaller). The first record number after a read is myDesc->firstRec and the number of records is myDesc->numRecBuff (which may be zero); number attempted is mySel->numRecRead. When OBIT_IO_EOF is returned all data has been read (then is no new data in data) and the I/O has been closed.

Parameters:
in Pointer to object to be read.
data pointer to buffer to write results.
err ObitErr for reporting errors.
Returns:
return code, 0=> OK

void ObitIOOTFFITSRename ObitIO *  in,
ObitInfoList *  info,
ObitErr *  err
 

Public: Rename underlying structures.

New name information is given on the info member:

  • "newFileName" OBIT_string (?,1,1) New Name of disk file.
    Parameters:
    in Pointer to object to be renamed
    info Associated ObitInfoList
    err ObitErr for reporting errors.

gboolean ObitIOOTFFITSSame ObitIO *  in,
ObitInfoList *  in1,
ObitInfoList *  in2,
ObitErr *  err
 

Public: Are underlying structures the same.

This test is done using values entered into the #ObitInfoList in case the object has not yet been opened.

Parameters:
in ObitIO for test
in1 ObitInfoList for first object to be tested
in2 ObitInfoList for second object to be tested
err ObitErr for reporting errors.
Returns:
TRUE if to objects have the same underlying structures else FALSE

ObitIOCode ObitIOOTFFITSSet ObitIOOTFFITS in,
ObitInfoList *  info,
ObitErr *  err
 

Public: Init I/O.

Parameters:
in Pointer to object to be accessed.
info ObitInfoList with instructions
err ObitErr for reporting errors.
Returns:
return code, 0=> OK

ObitIOCode ObitIOOTFFITSUpdateTables ObitIOOTFFITS in,
ObitInfoList *  info,
ObitErr *  err
 

Public: Update disk resident tables information.

Nothing is needed for FITS files.

Parameters:
in Pointer to object to be updated.
info ObitInfoList of parent object (not used here).
err ObitErr for reporting errors.
Returns:
return code, OBIT_IO_OK=> OK

ObitIOCode ObitIOOTFFITSWrite ObitIOOTFFITS in,
gfloat *  data,
ObitErr *  err
 

Public: Write.

The data in the buffer will be written starting at record myDesc->firstRec and the number written will be myDesc->numRecBuff which should not exceed mySel->nRecPIO if the internal buffer is used. myDesc->firstRec will be maintained and need not be changed for sequential writing.

Parameters:
in Pointer to object to be written.
data pointer to buffer containing input data.
err ObitErr for reporting errors.
Returns:
return code, 0=> OK

ObitIOCode ObitIOOTFFITSWriteDescriptor ObitIOOTFFITS in,
ObitErr *  err
 

Public: Write Descriptor.

Also writes the Array Geometry table.

Parameters:
in Pointer to object with ObitOTFDesc to be written.
err ObitErr for reporting errors.
Returns:
return code, 0=> OK

void ObitIOOTFFITSZap ObitIOOTFFITS in,
ObitErr *  err
 

Public: Delete underlying structures.

Delete the whole FITS file.

Parameters:
in Pointer to object to be zapped.
err ObitErr for reporting errors.

void ObitIOOTFKeysOtherRead ObitIOOTFFITS in,
gint *  status,
ObitErr *  err
 

Private: Copy other header keywords.

Parameters:
in Pointer to ObitIOOTFFITS.
status (Output) cfitsio status.
err ObitErr stack.
Returns:
return code, 0=> OK


Generated on Mon Sep 3 20:43:53 2007 by  doxygen 1.3.9.1