IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 12, 2005, 3:54:26 PM (22 years ago)
Author:
desonia
Message:

Added test for psFitsMoveExtNum.

Location:
trunk/psLib/src/dataIO
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/dataIO/psFileUtilsErrors.dat

    r2962 r2965  
    2121psFits_EXTNAME_NULL                    Specified extension name can not be NULL.
    2222psFits_EXTNAME_INVALID                 Could not find HDU '%s' in file %s.\nCFITSIO Error: %s
    23 psFits_EXTNUM_INVALID                  Could not find HDU #%d in file %s.\nCFITSIO Error: %s
     23psFits_EXTNUM_ABS_MOVE_FAILED          Could not move to specified HDU #%d in file %s.\nCFITSIO Error: %s
     24psFits_EXTNUM_REL_MOVE_FAILED          Could not move %d HDUs from current position in file %s.\nCFITSIO Error: %s
    2425psFits_GET_EXTNUM_FAILED               Failed to determine the current HDU number in file %s.\nCFITSIO Error: %s
    2526psFits_GETNUMHDUS_FAILED               Failed to determine the number of HDUs in file %s.\nCFITSIO Error: %s
  • trunk/psLib/src/dataIO/psFileUtilsErrors.h

    r2962 r2965  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-01-12 22:17:01 $
     9 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-01-13 01:54:25 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4343#define PS_ERRORTEXT_psFits_EXTNAME_NULL "Specified extension name can not be NULL."
    4444#define PS_ERRORTEXT_psFits_EXTNAME_INVALID "Could not find HDU '%s' in file %s.\nCFITSIO Error: %s"
    45 #define PS_ERRORTEXT_psFits_EXTNUM_INVALID "Could not find HDU #%d in file %s.\nCFITSIO Error: %s"
     45#define PS_ERRORTEXT_psFits_EXTNUM_ABS_MOVE_FAILED "Could not move to specified HDU #%d in file %s.\nCFITSIO Error: %s"
     46#define PS_ERRORTEXT_psFits_EXTNUM_REL_MOVE_FAILED "Could not move %d HDUs from current position in file %s.\nCFITSIO Error: %s"
    4647#define PS_ERRORTEXT_psFits_GET_EXTNUM_FAILED "Failed to determine the current HDU number in file %s.\nCFITSIO Error: %s"
    4748#define PS_ERRORTEXT_psFits_GETNUMHDUS_FAILED "Failed to determine the number of HDUs in file %s.\nCFITSIO Error: %s"
  • trunk/psLib/src/dataIO/psFits.c

    r2962 r2965  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-01-12 22:17:01 $
     9 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-01-13 01:54:25 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    287287
    288288    if (relative) {
    289         fits_movrel_hdu(fits->p_fd, extnum+1, &hdutype, &status);
     289        fits_movrel_hdu(fits->p_fd, extnum, &hdutype, &status);
     290        if (status != 0) {
     291            char fitsErr[MAX_STRING_LENGTH];
     292            fits_get_errstatus(status, fitsErr);
     293            psError(PS_ERR_LOCATION_INVALID, true,
     294                    PS_ERRORTEXT_psFits_EXTNUM_REL_MOVE_FAILED,
     295                    extnum, fits->filename, fitsErr);
     296            return false;
     297        }
    290298    } else {
    291299        fits_movabs_hdu(fits->p_fd, extnum+1, &hdutype, &status);
    292     }
    293 
    294     if (status != 0) {
    295         char fitsErr[MAX_STRING_LENGTH];
    296         fits_get_errstatus(status, fitsErr);
    297         psError(PS_ERR_LOCATION_INVALID, true,
    298                 PS_ERRORTEXT_psFits_EXTNUM_INVALID,
    299                 extnum, fits->filename, fitsErr);
    300         return false;
     300        if (status != 0) {
     301            char fitsErr[MAX_STRING_LENGTH];
     302            fits_get_errstatus(status, fitsErr);
     303            psError(PS_ERR_LOCATION_INVALID, true,
     304                    PS_ERRORTEXT_psFits_EXTNUM_ABS_MOVE_FAILED,
     305                    extnum, fits->filename, fitsErr);
     306            return false;
     307        }
    301308    }
    302309
Note: See TracChangeset for help on using the changeset viewer.