00001 /** @file psFitsTable.h 00002 * 00003 * @brief Contains Fits I/O routines 00004 * 00005 * @ingroup FileIO 00006 * 00007 * @author Robert DeSonia, MHPCC 00008 * 00009 * @version $Revision: 1.5 $ $Name: rel12 $ 00010 * @date $Date: 2006/06/13 22:28:02 $ 00011 * 00012 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii 00013 */ 00014 00015 #ifndef PS_FITSTABLE_H 00016 #define PS_FITSTABLE_H 00017 00018 #include "psFits.h" 00019 00020 #include "psType.h" 00021 #include "psArray.h" 00022 #include "psVector.h" 00023 #include "psMetadata.h" 00024 #include "psImage.h" 00025 00026 /// @addtogroup FileIO 00027 /// @{ 00028 00029 /** Reads a table row. The current HDU type must be either 00030 * PS_FITS_TYPE_BINARY_TABLE or PS_FITS_TYPE_ASCII_TABLE. 00031 * 00032 * @return psMetadata* The table row's data. The keys are the column names. 00033 */ 00034 psMetadata* psFitsReadTableRow( 00035 const psFits* fits, ///< the psFits object 00036 int row ///< row number to read 00037 ); 00038 00039 /** Reads a table column. The current HDU type must be either 00040 * PS_FITS_TYPE_BINARY_TABLE or PS_FITS_TYPE_ASCII_TABLE. 00041 * 00042 * @return psArray* Array of data items for the specified column or NULL 00043 * if an error occurred. 00044 */ 00045 psArray* psFitsReadTableColumn( 00046 const psFits* fits, ///< the psFits object 00047 const char* colname ///< the column name 00048 ); 00049 00050 /** Reads a table column of numbers. The current HDU type must be either 00051 * PS_FITS_TYPE_BINARY_TABLE or PS_FITS_TYPE_ASCII_TABLE. 00052 * 00053 * @return psVector* Vector of data for the specified column or NULL 00054 * if an error occurred. 00055 */ 00056 psVector* psFitsReadTableColumnNum( 00057 const psFits* fits, ///< the psFits object 00058 const char* colname ///< the column name 00059 ); 00060 00061 00062 /** Reads a whole FITS table. The current HDU type must be either 00063 * PS_FITS_TYPE_BINARY_TABLE or PS_FITS_TYPE_ASCII_TABLE. 00064 * 00065 * @return psArray* Array of psMetadata items, which contains the output 00066 * data items of each row. 00067 * 00068 * @see psFitsReadTableRow 00069 */ 00070 psArray* psFitsReadTable( 00071 const psFits* fits ///< the psFits object 00072 ); 00073 00074 /** Writes a whole FITS table. A new HDU of the type BINTABLE is appended 00075 * to the file. 00076 * 00077 * @return bool TRUE if the write was successful, otherwise FALSE 00078 * 00079 * @see psFitsReadTable 00080 * @see psFitsInsertTable 00081 */ 00082 bool psFitsWriteTable( 00083 psFits* fits, ///< the psFits object 00084 const psMetadata* header, ///< header items for the new HDU. Can be NULL. 00085 const psArray* table, ///< Array of psMetadata items, which contains the output data items of each row. 00086 const char *extname ///< Extension name 00087 ); 00088 00089 /** Inserts a whole FITS table. A new HDU of the type BINTABLE is inserted either 00090 * before or after, depending on the AFTER parameter, the current HDU. 00091 * 00092 * @return bool TRUE if the insert/write was successful, otherwise FALSE 00093 * 00094 * @see psFitsWriteTable 00095 */ 00096 bool psFitsInsertTable( 00097 psFits* fits, ///< the psFits object 00098 const psMetadata* header, ///< header items for the new HDU. Can be NULL. 00099 const psArray* table, ///< Array of psMetadata items, which contains the output data items of each row. 00100 const char *extname, ///< Extension name 00101 bool after ///< TRUE if insert is done after CHDU, otherwise table is inserted before CHDU 00102 ); 00103 00104 /** Updates a FITS table. The current HDU type must be either 00105 * PS_FITS_TYPE_BINARY_TABLE or PS_FITS_TYPE_ASCII_TABLE. 00106 * 00107 * @return bool TRUE if the write was successful, otherwise FALSE 00108 * 00109 * @see psFitsWriteTable 00110 */ 00111 bool psFitsUpdateTable( 00112 psFits* fits, ///< the psFits object 00113 const psMetadata* data, 00114 ///< Array of psMetadata items, which contains the output data items of each row. 00115 int row ///< the row number to update. 00116 ); 00117 00118 /// @} 00119 00120 #endif // #ifndef PS_FITS_H
1.4.4