Changeset 5511 for trunk/psLib/src/fits/psFits.h
- Timestamp:
- Nov 14, 2005, 12:18:38 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/fits/psFits.h (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/fits/psFits.h
r5057 r5511 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.2 1$ $Name: not supported by cvs2svn $10 * @date $Date: 2005- 09-15 21:22:21$9 * @version $Revision: 1.22 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-11-14 22:18:30 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 16 16 #define PS_FITS_H 17 17 18 #include <fitsio.h>18 #include <fitsio.h> 19 19 20 20 #include "psType.h" … … 49 49 { 50 50 fitsfile* fd; ///< the CFITSIO fits files handle. 51 const char* filename; ///< the filename of the fits file52 bool writable; ///< Is the file writable?53 51 } 54 52 psFits; … … 59 57 * NULL if the open of the FITS file failed 60 58 */ 61 psFits* psFitsAlloc( 62 const char* name ///< the FITS file name 59 psFits* psFitsOpen( 60 const char* filename, ///< the FITS file name 61 const char* mode 62 /**< File open mode. Could be one of the following: 63 * 'r' (read only), 64 * 'r+' (read & write), 65 * 'rw' (same as 'r+'), or 66 * 'w' (create new file for writing) 67 */ 68 ); 69 70 /** Closes a FITS file. 71 * 72 * @return bool TRUE if FITS file was successfully closed, otherwise FALSE 73 */ 74 bool psFitsClose( 75 psFits* fits ///< psFits object to close 63 76 ); 64 77 65 78 /** Checks the type of a particular pointer. 66 79 * 67 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 80 * Uses the appropriate deallocation function in psMemBlock to check the ptr 81 * datatype. 68 82 * 69 * @return bool: True if the pointer matches a psFits structure, false otherwise. 83 * @return bool: True if the pointer matches a psFits structure, false 84 * otherwise. 70 85 */ 71 86 bool psMemCheckFits( … … 76 91 /** Moves the FITS HDU to the specified extension name. 77 92 * 78 * @return psFitsType The HDU type, or PS_FITS_TYPE_NONE if move failed. 93 * @return bool TRUE if the extension name was found and move was 94 * successful, otherwise FALSE 79 95 */ 80 96 bool psFitsMoveExtName( … … 85 101 /** Moves the FITS HDU to the specified extension number 86 102 * 87 * @return psFitsType The HDU type, or PS_FITS_TYPE_NONE if move failed. 103 * @return bool TRUE if the extension number was found and move was 104 * successful, otherwise FALSE 88 105 */ 89 106 bool psFitsMoveExtNum( … … 91 108 int extnum, ///< the extension number to move to (zero is primary HDU) 92 109 bool relative ///< if true, extnum is a relative number to the current position 110 ); 111 112 /** Moves the FITS HDU to the end of the file 113 * 114 * @return bool TRUE if the move was successful, otherwise FALSE 115 */ 116 bool psFitsMoveLast( 117 const psFits* fits ///< the psFits object to move 93 118 ); 94 119 … … 129 154 ); 130 155 156 /** Remove the an HDU as specified by number 157 * 158 * @return bool TRUE if the specified HDU was removed, otherwise FALSE 159 */ 160 bool psFitsDeleteExtNum( 161 psFits* fits, ///< the psFits object 162 int extnum, ///< the extension number to delete (zero is primary HDU) 163 bool relative ///< if true, extnum is a relative number to the current position 164 ); 165 166 /** Remove the an HDU as specified by extension name 167 * 168 * @return bool TRUE if the specified HDU was removed, otherwise FALSE 169 */ 170 bool psFitsDeleteExtName( 171 psFits* fits, ///< the psFits object 172 const char* extname ///< the extension name to delete 173 ); 174 131 175 /** Get the extension type of the current HDU. 132 176 * … … 138 182 ); 139 183 140 /** Reads the header of the current HDU.184 /** Delete all extensions after the current position 141 185 * 142 * @return psMetadata* the header data186 * @return bool TRUE if the operation was successful, otherwise FALSE 143 187 */ 144 psMetadata* psFitsReadHeader( 145 psMetadata* out, 146 ///< The psMetadata to add the header data. If null, a new psMetadata is created. 147 148 const psFits* fits ///< the psFits object 149 ); 150 151 /** Reads the header of all HDUs. The current HDU is not changed. 152 * 153 * @return psMetadata* the header data set as a number of metadata entries 154 */ 155 psMetadata* psFitsReadHeaderSet( 156 psMetadata* out, 157 ///< The psMetadata to add the header data via psMetadata items. If null, a 158 ///< new psMetadata is created. The keys of the psMetadata are the extension names 159 ///< of the cooresponding HDUs. 160 161 const psFits* fits ///< the psFits object 162 ); 163 164 /** Writes the values of the metadata to the current HDU header. 165 * 166 * @return bool if TRUE, the write was successful, otherwise FALSE. 167 */ 168 bool psFitsWriteHeader( 169 const psMetadata* output, ///< the psMetadata data in which to write 188 bool psFitsTruncate( 170 189 psFits* fits ///< the psFits object 171 );172 173 /** Reads an image, given the desired region and z-plane.174 *175 * @return psImage* the read image or NULL if there was an error.176 */177 psImage* psFitsReadImage(178 psImage* out, ///< a psImage to recycle.179 const psFits* fits, ///< the psFits object180 psRegion region, ///< the region in the FITS image to read181 int z ///< the z-plane in the FITS image cube to read182 );183 184 /** Writes an image, given the desired region and z-plane.185 *186 * @return bool TRUE is the write was successful, otherwise FALSE.187 */188 bool psFitsWriteImage(189 psFits* fits, ///< the psFits object190 psMetadata* header, ///< header items for the new HDU. Can be NULL.191 const psImage* input, ///< the image to output192 int depth ///< the number of z-planes of the FITS image data cube193 );194 195 /** Updates the FITS file image, given the desired region and z-plane.196 *197 * @return bool TRUE is the write was successful, otherwise FALSE.198 */199 bool psFitsUpdateImage(200 psFits* fits, ///< the psFits object201 const psImage* input, ///< the image to output202 psRegion region, ///< the region in the FITS image to write203 int z ///< the z-planes of the FITS image data cube to write204 );205 206 /** Reads a table row. The current HDU type must be either207 * PS_FITS_TYPE_BINARY_TABLE or PS_FITS_TYPE_ASCII_TABLE.208 *209 * @return psMetadata* The table row's data. The keys are the column names.210 */211 psMetadata* psFitsReadTableRow(212 const psFits* fits, ///< the psFits object213 int row ///< row number to read214 );215 216 /** Reads a table column. The current HDU type must be either217 * PS_FITS_TYPE_BINARY_TABLE or PS_FITS_TYPE_ASCII_TABLE.218 *219 * @return psArray* Array of data items for the specified column or NULL220 * if an error occurred.221 */222 psArray* psFitsReadTableColumn(223 const psFits* fits, ///< the psFits object224 const char* colname ///< the column name225 );226 227 /** Reads a table column of numbers. The current HDU type must be either228 * PS_FITS_TYPE_BINARY_TABLE or PS_FITS_TYPE_ASCII_TABLE.229 *230 * @return psVector* Vector of data for the specified column or NULL231 * if an error occurred.232 */233 psVector* psFitsReadTableColumnNum(234 const psFits* fits, ///< the psFits object235 const char* colname ///< the column name236 );237 238 239 /** Reads a whole FITS table. The current HDU type must be either240 * PS_FITS_TYPE_BINARY_TABLE or PS_FITS_TYPE_ASCII_TABLE.241 *242 * @return psArray* Array of psMetadata items, which contains the output243 * data items of each row.244 *245 * @see psFitsReadTableRow246 */247 psArray* psFitsReadTable(248 psFits* fits ///< the psFits object249 );250 251 /** Writes a whole FITS table. The current HDU type must be either252 * PS_FITS_TYPE_BINARY_TABLE or PS_FITS_TYPE_ASCII_TABLE.253 *254 * @return bool TRUE if the write was successful, otherwise FALSE255 *256 * @see psFitsReadTableRow257 */258 bool psFitsWriteTable(259 psFits* fits, ///< the psFits object260 const psMetadata* header, ///< header items for the new HDU. Can be NULL.261 const psArray* table262 ///< Array of psMetadata items, which contains the output data items of each row.263 );264 265 /** Updates a FITS table. The current HDU type must be either266 * PS_FITS_TYPE_BINARY_TABLE or PS_FITS_TYPE_ASCII_TABLE.267 *268 * @return bool TRUE if the write was successful, otherwise FALSE269 *270 * @see psFitsWriteTable271 */272 bool psFitsUpdateTable(273 psFits* fits, ///< the psFits object274 const psMetadata* data,275 ///< Array of psMetadata items, which contains the output data items of each row.276 int row ///< the row number to update.277 190 ); 278 191
Note:
See TracChangeset
for help on using the changeset viewer.
