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