text: /* $Id$   */
  /* DO NOT EDIT - file generated by ObitTables.pl                      */
  /*--------------------------------------------------------------------*/
  /*;  Copyright (C)  2009                                              */
  /*;  Associated Universities, Inc. Washington DC, USA.                */
  /*;                                                                   */
  /*;  This program is free software; you can redistribute it and/or    */
  /*;  modify it under the terms of the GNU General Public License as   */
  /*;  published by the Free Software Foundation; either version 2 of   */
  /*;  the License, or (at your option) any later version.              */
  /*;                                                                   */
  /*;  This program is distributed in the hope that it will be useful,  */
  /*;  but WITHOUT ANY WARRANTY; without even the implied warranty of   */
  /*;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    */
  /*;  GNU General Public License for more details.                     */
  /*;                                                                   */
  /*;  You should have received a copy of the GNU General Public        */
  /*;  License along with this program; if not, write to the Free       */
  /*;  Software Foundation, Inc., 675 Massachusetts Ave, Cambridge,     */
  /*;  MA 02139, USA.                                                   */
  /*;                                                                   */
  /*;Correspondence about this software should be addressed as follows: */
  /*;         Internet email: bcotton@nrao.edu.                         */
  /*;         Postal address: William Cotton                            */
  /*;                         National Radio Astronomy Observatory      */
  /*;                         520 Edgemont Road                         */
  /*;                         Charlottesville, VA 22903-2475 USA        */
  /*--------------------------------------------------------------------*/
  #ifndef OBITTABLEAT_H 
  #define OBITTABLEAT_H 
  
  #include "Obit.h"
  #include "ObitErr.h"
  #include "ObitTable.h"
  #include "ObitData.h"
  
  /*-------- Obit: Merx mollis mortibus nuper ------------------*/
  /**
   * \file ObitTableAT.h
   * ObitTableAT class definition.
   *
   * This class is derived from the #ObitTable class.
   *
   * This class contains tabular data and allows access.
   * "AIPS AT" contains Antenna polarization and something else.
   * An ObitTableAT is the front end to a persistent disk resident structure.
   * Both FITS and AIPS cataloged data are supported.
   * This class is derived from the ObitTable class. 
   *
   * This class contains tabular data and allows access.
   * "AIPS AT" table
   * An ObitTableAT is the front end to a persistent disk resident structure.
   * Both FITS (as Tables) and AIPS cataloged data are supported.
   *
   * \section TableDataStorage Table 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 
   * #ObitTableATDesc.
   *
   * 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:
   * \li status = 0 => normal
   * \li status = 1 => row has been modified (or created) and needs to be
   *                   written.
   * \li status = -1 => row has been marked invalid.
   *
   * \section ObitTableATSpecification 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
   * \li "FileType" OBIT_int (1,1,1) OBIT_IO_FITS or OBIT_IO_AIPS 
   * which are values of an #ObitIOType enum defined in ObitIO.h.
   *
   * The following apply to both types of files:
   * \li "nRowPIO", OBIT_int, Max. Number of visibilities per 
   *     "Read" or "Write" operation.  Default = 1.
   *
   * \subsection TableFITS 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 #ObitTableATSetFITS 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:
   * \li "FileName" OBIT_string (?,1,1) FITS file name.
   * \li "TabName"  OBIT_string (?,1,1) Table name (e.g. "AIPS CC").
   * \li "Ver"      OBIT_int    (1,1,1) Table version number
   *
   * subsection ObitTableATAIPS 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:
   * \li "Disk" OBIT_int (1,1,1) AIPS "disk" number.
   * \li "User" OBIT_int (1,1,1) user number.
   * \li "CNO"  OBIT_int (1,1,1) AIPS catalog slot number.
   * \li "TableType" OBIT_string (2,1,1) AIPS Table type
   * \li "Ver"  OBIT_int    (1,1,1) AIPS table version number.
   *
   * \section ObitTableATaccess Creators and Destructors
   * An ObitTableAT can be created using newObitTableATValue which attaches the 
   * table to an ObitData for the object.  
   * If the output ObitTableAT has previously been specified, including file information,
   * then ObitTableATCopy will copy the disk resident as well as the memory 
   * resident information.
   *
   * A copy of a pointer to an ObitTableAT should always be made using the
   * ObitTableATRef function which updates the reference count in the object.
   * Then whenever freeing an ObitTableAT or changing a pointer, the function
   * ObitTableATUnref will decrement the reference count and destroy the object
   * when the reference count hits 0.
   *
   * \section ObitTableATUsage I/O
   * Visibility data is available after an input object is "Opened"
   * and "Read".
   * I/O optionally uses a buffer attached to the ObitTableAT or some external
   * location.
   * To Write an ObitTableAT, create it, open it, and write.
   * The object should be closed to ensure all data is flushed to disk.
   * Deletion of an ObitTableAT after its final unreferencing will automatically
   * close it.
   */
  
  /*--------------Class definitions-------------------------------------*/
  
  /** Number of characters for Table keyword */
   #define MAXKEYCHARTABLEAT 24
  
  /** ObitTableAT Class structure. */
  typedef struct {
  #include "ObitTableATDef.h"   /* this class definition */
  } ObitTableAT;
  
  /** ObitTableATRow Class structure. */
  typedef struct {
  #include "ObitTableATRowDef.h"   /* this class row definition */
  } ObitTableATRow;
  
  /*----------------- Macroes ---------------------------*/
  /** 
   * Macro to unreference (and possibly destroy) an ObitTableAT
   * returns an ObitTableAT*.
   * in = object to unreference
   */
  #define ObitTableATUnref(in) ObitUnref (in)
  
  /** 
   * Macro to reference (update reference count) an ObitTableAT.
   * returns an ObitTableAT*.
   * in = object to reference
   */
  #define ObitTableATRef(in) ObitRef (in)
  
  /** 
   * 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 ObitTableATIsA(in) ObitIsA (in, ObitTableATGetClass())
  
  /** 
   * Macro to unreference (and possibly destroy) an ObitTableATRow
   * returns an ObitTableATRow*.
   * in = object to unreference
   */
  #define ObitTableATRowUnref(in) ObitUnref (in)
  
  /** 
   * Macro to reference (update reference count) an ObitTableATRow.
   * returns an ObitTableATRow*.
   * in = object to reference
   */
  #define ObitTableATRowRef(in) ObitRef (in)
  
  /** 
   * 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 ObitTableATRowIsA(in) ObitIsA (in, ObitTableATRowGetClass())
  
  /*---------------Public functions---------------------------*/
  /*----------------Table Row Functions ----------------------*/
  /** Public: Row Class initializer. */
  void ObitTableATRowClassInit (void);
  
  /** Public: Constructor. */
  ObitTableATRow* newObitTableATRow (ObitTableAT *table);
  
  /** Public: ClassInfo pointer */
  gconstpointer ObitTableATRowGetClass (void);
  
  /*------------------Table Functions ------------------------*/
  /** Public: Class initializer. */
  void ObitTableATClassInit (void);
  
  /** Public: Constructor. */
  ObitTableAT* newObitTableAT (gchar* name);
  
  /** Public: Constructor from values. */
  ObitTableAT* 
  newObitTableATValue (gchar* name, ObitData *file, olong *ver,
    		     ObitIOAccess access,
                       oint numBand,
  		     ObitErr *err);
  
  /** Public: Class initializer. */
  void ObitTableATClassInit (void);
  
  /** Public: ClassInfo pointer */
  gconstpointer ObitTableATGetClass (void);
  
  /** Public: Copy (deep) constructor. */
  ObitTableAT* ObitTableATCopy  (ObitTableAT *in, ObitTableAT *out, 
  			   ObitErr *err);
  
  /** Public: Copy (shallow) constructor. */
  ObitTableAT* ObitTableATClone (ObitTableAT *in, ObitTableAT *out);
  
  /** Public: Convert an ObitTable to an ObitTableAT */
  ObitTableAT* ObitTableATConvert  (ObitTable *in);
  
  /** Public: Create ObitIO structures and open file */
  ObitIOCode ObitTableATOpen (ObitTableAT *in, ObitIOAccess access, 
  			  ObitErr *err);
  
  /** Public: Read a table row */
  ObitIOCode 
  ObitTableATReadRow  (ObitTableAT *in, olong iATRow, ObitTableATRow *row,
  		     ObitErr *err);
  
  /** Public: Init a table row for write */
  void 
  ObitTableATSetRow  (ObitTableAT *in, ObitTableATRow *row,
  		     ObitErr *err);
  
  /** Public: Write a table row */
  ObitIOCode 
  ObitTableATWriteRow  (ObitTableAT *in, olong iATRow, ObitTableATRow *row,
  		     ObitErr *err);
  
  /** Public: Close file and become inactive */
  ObitIOCode ObitTableATClose (ObitTableAT *in, ObitErr *err);
  
  /*----------- ClassInfo Structure -----------------------------------*/
  /**
   * ClassInfo Structure.
   * Contains class name, a pointer to any parent class
   * (NULL if none) and function pointers.
   */
  typedef struct  {
  #include "ObitTableATClassDef.h"
  } ObitTableATClassInfo; 
  
  /**
   * ClassInfo Structure For TableATRow.
   * Contains class name, a pointer to any parent class
   * (NULL if none) and function pointers.
   */
  typedef struct  {
  #include "ObitTableATRowClassDef.h"
  } ObitTableATRowClassInfo; 
  #endif /* OBITTABLEAT_H */ 
  