Changeset 15179 for trunk/psLib/src/fits/psFits.h
- Timestamp:
- Oct 3, 2007, 11:27:21 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/fits/psFits.h (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/fits/psFits.h
r14877 r15179 4 4 * @author Robert DeSonia, MHPCC 5 5 * 6 * @version $Revision: 1.3 1$ $Name: not supported by cvs2svn $7 * @date $Date: 2007- 09-18 02:56:36$6 * @version $Revision: 1.32 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2007-10-03 21:27:21 $ 8 8 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii 9 9 */ … … 21 21 #include "psMetadata.h" 22 22 #include "psImage.h" 23 24 #include "psErrorCodes.h" 23 25 24 26 /** FITS HDU type. … … 49 51 * 50 52 */ 51 typedef struct 52 { 53 fitsfile* fd; ///< the CFITSIO fits files handle.54 bool writable; ///< Is the file writable?55 char *extword; ///< user-specified word to name extensions (NULL implies EXTNAME)56 } 57 psFits; 58 59 /** FITS options object. */ 60 typedef struct 61 {53 typedef struct { 54 fitsfile* fd; ///< the CFITSIO fits files handle. 55 bool writable; ///< Is the file writable? 56 char *extword; ///< user-specified word to name extensions (NULL implies EXTNAME) 57 struct { 58 bool compression; ///< Honour compression convention, handling compressed images 59 } conventions; ///< Conventions to honour 60 } psFits; 61 62 /** FITS compression settings. */ 63 typedef struct { 62 64 psFitsCompressionType type; ///< type of compression 63 65 psVector *tilesize; ///< vector defining compression tile size … … 65 67 int scale; ///< hcompress scale 66 68 int smooth; ///< hcompress smothing 67 } 68 psFitsOptions; 69 } psFitsCompression; 69 70 70 71 /** Opens a FITS file and allocates the associated psFits object. … … 84 85 ); 85 86 86 /** Creates a new FITS options struct 87 88 /// Generate an error including the cfitsio error string 89 #ifdef DOXYGEN 90 psErrorCode psFitsError( 91 int status, ///< cfitsio status value 92 bool new, ///< new error? 93 const char *errorMsg, ///< printf-style format of header line 94 ... ///< any parameters required in format 95 ); 96 #else // ifdef DOXYGEN 97 psErrorCode p_psFitsError( 98 const char* filename, ///< file name 99 unsigned int lineno, ///< line number in file 100 const char* func, ///< function name 101 int status, ///< cfitsio status value 102 bool new, ///< new error? 103 const char *errorMsg, ///< printf-style format of header line 104 ... ///< any parameters required in format 105 ) PS_ATTR_FORMAT(printf, 6, 7); 106 #ifndef SWIG 107 #define psFitsError(status,new,...) \ 108 p_psFitsError(__FILE__,__LINE__,__func__,status,new,__VA_ARGS__) 109 #endif // ifndef SWIG 110 #endif // ifdef DOXYGEN 111 112 113 /** Creates a new FITS options struct 87 114 * 88 115 * @return psFitsOptions or NULL on failure 89 116 */ 90 psFits Options* psFitsOptionsAlloc(117 psFitsCompression* psFitsCompressionAlloc( 91 118 psFitsCompressionType type, ///< type of compression 92 119 psVector *tilesize, ///< vector defining compression tile size … … 96 123 ); 97 124 125 /// Return the FITS compression type specified by a string 126 psFitsCompressionType psFitsCompressionTypeFromString( 127 const char *string ///< String with compression type 128 ); 129 98 130 /** Closes a FITS file. 99 131 * … … 111 143 */ 112 144 bool psFitsSetCompression( 113 psFits* fits, ///< psFits object to close145 psFits* fits, ///< psFits object for which to set compression 114 146 psFitsCompressionType type, ///< type of compression 115 147 psVector *tilesize, ///< vector defining compression tile size … … 119 151 ); 120 152 153 /// Get the compression options for a file handle 154 psFitsCompression *psFitsCompressionGet( 155 psFits* fits ///< psFits object for which to get compression 156 ); 157 158 /// Get the compression type for a file handle 159 psFitsCompressionType psFitsCompressionGetType( 160 psFits* fits ///< psFits object for which to get compression type 161 ); 162 121 163 /** Sets FITS write options 122 164 * 123 165 * @return bool TRUE if successfully configured, otherwise FALSE 124 166 */ 125 bool psFits SetOptions(126 psFits* fits, ///< psFits object to close127 psFits Options *opt///< options object167 bool psFitsCompressionApply( 168 psFits* fits, ///< psFits object for which to set compression 169 psFitsCompression *compress ///< options object 128 170 ); 129 171 … … 146 188 // a user-defined word in place of EXTNAME 147 189 bool p_psFitsMoveExtName_UserKey(const psFits *fits, 148 const char *extname,149 const char *extword);190 const char *extname, 191 const char *extword); 150 192 151 193 /** Moves the FITS HDU to the specified extension name. … … 261 303 ); 262 304 305 #define PS_ASSERT_FITS_NON_NULL(NAME, RVAL) \ 306 if (!(NAME) || !(NAME)->fd) { \ 307 psError(PS_ERR_UNEXPECTED_NULL, true, "Error: FITS file pointer %s is NULL", #NAME); \ 308 return RVAL; \ 309 } 310 263 311 /// @} 264 312 #endif // #ifndef PS_FITS_H
Note:
See TracChangeset
for help on using the changeset viewer.
