IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 14, 2011, 1:05:28 PM (15 years ago)
Author:
watersc1
Message:

Merge of trunk back into branch.

Location:
branches/czw_branch/20101203
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20101203

  • branches/czw_branch/20101203/ppStack/src/ppStackFinish.c

    r27906 r30631  
    1 #ifdef HAVE_CONFIG_H
    2 #include <config.h>
    3 #endif
     1#include "ppStack.h"
    42
    5 #include <stdio.h>
    6 #include <unistd.h>
    7 #include <pslib.h>
    8 #include <psmodules.h>
    9 #include <psphot.h>
    10 
    11 #include "ppStack.h"
    12 #include "ppStackLoop.h"
    13 
     3// this function unlinks the temporary files (if desired)
    144bool ppStackFinish(ppStackOptions *options, pmConfig *config)
    155{
     
    3222            }
    3323
    34             psString imageResolved = pmConfigConvertFilename(options->convImages->data[i],
    35                                                              config, false, false);
    36             psString maskResolved = pmConfigConvertFilename(options->convMasks->data[i],
    37                                                             config, false, false);
    38             psString varianceResolved = pmConfigConvertFilename(options->convVariances->data[i],
    39                                                                 config, false, false);
     24            // XXX careful about repeatative resolution of nebulous names (though these are probably not neb names)
     25            psString imageResolved = pmConfigConvertFilename(options->convImages->data[i], config, false, false);
     26            psString maskResolved = pmConfigConvertFilename(options->convMasks->data[i], config, false, false);
     27            psString varianceResolved = pmConfigConvertFilename(options->convVariances->data[i], config, false, false);
    4028            if (unlink(imageResolved) == -1 || unlink(maskResolved) == -1 ||
    4129                unlink(varianceResolved) == -1) {
     
    4735        }
    4836    }
    49 
    50 
    5137    return true;
    5238}
     
    6046
    6147    psErrorCode errorCode = psErrorCodeLast(); // Error code
    62     if (errorCode != PS_ERR_NONE) {
    63         psErrorStackPrint(stderr, "Unable to perform stack.");
    64         pmFPAfileFreeSetStrict(false);
    65         switch (errorCode) {
    66           case PPSTACK_ERR_UNKNOWN:
    67           case PS_ERR_UNKNOWN:
    68             psLogMsg("ppStack", PS_LOG_WARN, "Unknown error code: %x", errorCode);
    69             exitValue = PS_EXIT_UNKNOWN_ERROR;
    70             break;
    71           case PS_ERR_IO:
    72           case PS_ERR_DB_CLIENT:
    73           case PS_ERR_DB_SERVER:
    74           case PS_ERR_BAD_FITS:
    75           case PS_ERR_OS_CALL_FAILED:
    76           case PM_ERR_SYS:
    77           case PPSTACK_ERR_IO:
    78             psLogMsg("ppStack", PS_LOG_WARN, "I/O error code: %x", errorCode);
    79             exitValue = PS_EXIT_SYS_ERROR;
    80             break;
    81           case PS_ERR_BAD_PARAMETER_VALUE:
    82           case PS_ERR_BAD_PARAMETER_TYPE:
    83           case PS_ERR_BAD_PARAMETER_NULL:
    84           case PS_ERR_BAD_PARAMETER_SIZE:
    85           case PPSTACK_ERR_ARGUMENTS:
    86           case PPSTACK_ERR_CONFIG:
    87             psLogMsg("ppStack", PS_LOG_WARN, "Configuration error code: %x", errorCode);
    88             exitValue = PS_EXIT_CONFIG_ERROR;
    89             break;
    90           case PPSTACK_ERR_PSF:
    91           case PSPHOT_ERR_PSF:
    92           case PM_ERR_STAMPS:
    93           case PM_ERR_SMALL_AREA:
    94           case PPSTACK_ERR_REJECTED:
    95           case PPSTACK_ERR_DATA:
    96             psLogMsg("ppStack", PS_LOG_WARN, "Data error code: %x", errorCode);
    97             exitValue = PS_EXIT_DATA_ERROR;
    98             break;
    99           case PS_ERR_UNEXPECTED_NULL:
    100           case PS_ERR_PROGRAMMING:
    101           case PPSTACK_ERR_NOT_IMPLEMENTED:
    102           case PPSTACK_ERR_PROG:
    103             psLogMsg("ppStack", PS_LOG_WARN, "Programming error code: %x", errorCode);
    104             exitValue = PS_EXIT_PROG_ERROR;
    105             break;
    106           default:
    107             // It's a programming error if we're not dealing with the error correctly
    108             psLogMsg("ppStack", PS_LOG_WARN, "Unrecognised error code: %x", errorCode);
    109             exitValue = PS_EXIT_PROG_ERROR;
    110             break;
    111         }
     48    if (errorCode == PS_ERR_NONE) {
     49        return exitValue;
     50    }
     51
     52    psErrorStackPrint(stderr, "Unable to perform stack.");
     53    pmFPAfileFreeSetStrict(false);
     54    switch (errorCode) {
     55      case PPSTACK_ERR_UNKNOWN:
     56      case PS_ERR_UNKNOWN:
     57        psLogMsg("ppStack", PS_LOG_WARN, "Unknown error code: %x", errorCode);
     58        exitValue = PS_EXIT_UNKNOWN_ERROR;
     59        break;
     60      case PS_ERR_IO:
     61      case PS_ERR_DB_CLIENT:
     62      case PS_ERR_DB_SERVER:
     63      case PS_ERR_BAD_FITS:
     64      case PS_ERR_OS_CALL_FAILED:
     65      case PM_ERR_SYS:
     66      case PPSTACK_ERR_IO:
     67        psLogMsg("ppStack", PS_LOG_WARN, "I/O error code: %x", errorCode);
     68        exitValue = PS_EXIT_SYS_ERROR;
     69        break;
     70      case PS_ERR_BAD_PARAMETER_VALUE:
     71      case PS_ERR_BAD_PARAMETER_TYPE:
     72      case PS_ERR_BAD_PARAMETER_NULL:
     73      case PS_ERR_BAD_PARAMETER_SIZE:
     74      case PPSTACK_ERR_ARGUMENTS:
     75      case PPSTACK_ERR_CONFIG:
     76        psLogMsg("ppStack", PS_LOG_WARN, "Configuration error code: %x", errorCode);
     77        exitValue = PS_EXIT_CONFIG_ERROR;
     78        break;
     79      case PPSTACK_ERR_PSF:
     80      case PSPHOT_ERR_PSF:
     81      case PM_ERR_STAMPS:
     82      case PM_ERR_SMALL_AREA:
     83      case PPSTACK_ERR_REJECTED:
     84      case PPSTACK_ERR_DATA:
     85        psLogMsg("ppStack", PS_LOG_WARN, "Data error code: %x", errorCode);
     86        exitValue = PS_EXIT_DATA_ERROR;
     87        break;
     88      case PS_ERR_UNEXPECTED_NULL:
     89      case PS_ERR_PROGRAMMING:
     90      case PPSTACK_ERR_NOT_IMPLEMENTED:
     91      case PPSTACK_ERR_PROG:
     92        psLogMsg("ppStack", PS_LOG_WARN, "Programming error code: %x", errorCode);
     93        exitValue = PS_EXIT_PROG_ERROR;
     94        break;
     95      default:
     96        // It's a programming error if we're not dealing with the error correctly
     97        psLogMsg("ppStack", PS_LOG_WARN, "Unrecognised error code: %x", errorCode);
     98        exitValue = PS_EXIT_PROG_ERROR;
     99        break;
    112100    }
    113101    return exitValue;
Note: See TracChangeset for help on using the changeset viewer.