IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 21, 2007, 5:06:16 PM (19 years ago)
Author:
Paul Price
Message:

Adding psFitsError to handle cfitsio errors.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/pap_branch_070920/psLib/src/fits/psFits.h

    r14877 r14984  
    44 * @author Robert DeSonia, MHPCC
    55 *
    6  * @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
    7  * @date $Date: 2007-09-18 02:56:36 $
     6 * @version $Revision: 1.31.2.1 $ $Name: not supported by cvs2svn $
     7 * @date $Date: 2007-09-22 03:06:16 $
    88 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
    99 */
     
    2121#include "psMetadata.h"
    2222#include "psImage.h"
     23
     24#include "psErrorCodes.h"
    2325
    2426/** FITS HDU type.
     
    5153typedef struct
    5254{
    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)
     55    fitsfile* fd;                       ///< the CFITSIO fits files handle.
     56    bool writable;                      ///< Is the file writable?
     57    char *extword;                      ///< user-specified word to name extensions (NULL implies EXTNAME)
    5658}
    5759psFits;
     
    8486);
    8587
    86 /** Creates a new FITS options struct
     88
     89/// Generate an error including the cfitsio error string
     90#ifdef DOXYGEN
     91psErrorCode psFitsError(
     92    int status,                         ///< cfitsio status value
     93    bool new,                           ///< new error?
     94    const char *errorMsg,               ///< printf-style format of header line
     95    ...                                 ///< any parameters required in format
     96    );
     97#else // ifdef DOXYGEN
     98psErrorCode p_psFitsError(
     99    const char* filename,               ///< file name
     100    unsigned int lineno,                ///< line number in file
     101    const char* func,                   ///< function name
     102    int status,                         ///< cfitsio status value
     103    bool new,                           ///< new error?
     104    const char *errorMsg,               ///< printf-style format of header line
     105    ...                                 ///< any parameters required in format
     106    ) PS_ATTR_FORMAT(printf, 6, 7);
     107#ifndef SWIG
     108#define psFitsError(status,new,...) \
     109      p_psFitsError(__FILE__,__LINE__,__func__,status,new,__VA_ARGS__)
     110#endif // ifndef SWIG
     111#endif // ifdef DOXYGEN
     112
     113
     114/** Creates a new FITS options struct
    87115 *
    88116 *  @return psFitsOptions or NULL on failure
     
    146174// a user-defined word in place of EXTNAME
    147175bool p_psFitsMoveExtName_UserKey(const psFits *fits,
    148                                 const char *extname,
    149                                 const char *extword);
     176                                const char *extname,
     177                                const char *extword);
    150178
    151179/** Moves the FITS HDU to the specified extension name.
Note: See TracChangeset for help on using the changeset viewer.