IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 18, 2010, 6:42:01 PM (16 years ago)
Author:
Paul Price
Message:

Reworked ppStack to be better about error codes and their translation to exit codes.

Location:
trunk/ppStack/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack/src

    • Property svn:ignore
      •  

        old new  
        1010stamp-h1
        1111ppStackVersionDefinitions.h
         12ppStackErrorCodes.c
         13ppStackErrorCodes.h
  • trunk/ppStack/src/ppStackLoop.c

    r26117 r27004  
    2222    psTrace("ppStack", 1, "Setup....\n");
    2323    if (!ppStackSetup(options, config)) {
    24         psError(PS_ERR_UNKNOWN, false, "Unable to setup.");
     24        psError(psErrorCodeLast(), false, "Unable to setup.");
    2525        psFree(options);
    2626        return false;
     
    3333    psTrace("ppStack", 1, "Preparation for stacking: merging sources, determining target PSF....\n");
    3434    if (!ppStackPrepare(options, config)) {
    35         psError(PS_ERR_UNKNOWN, false, "Unable to prepare for stacking.");
     35        psError(psErrorCodeLast(), false, "Unable to prepare for stacking.");
    3636        psFree(options);
    3737        return false;
     
    4545    psTrace("ppStack", 1, "Convolving inputs to target PSF....\n");
    4646    if (!ppStackConvolve(options, config)) {
    47         psError(PS_ERR_UNKNOWN, false, "Unable to convolve images.");
     47        psError(psErrorCodeLast(), false, "Unable to convolve images.");
    4848        psFree(options);
    4949        return false;
     
    5858    ppStackThreadData *stack = ppStackThreadDataSetup(options, config, true);
    5959    if (!stack) {
    60         psError(PS_ERR_IO, false, "Unable to initialise stack threads.");
     60        psError(psErrorCodeLast(), false, "Unable to initialise stack threads.");
    6161        psFree(options);
    6262        return false;
     
    6565    // Prepare for combination
    6666    if (!ppStackCombinePrepare(stack, options, config)) {
    67         psError(PS_ERR_UNKNOWN, false, "Unable to prepare for combination.");
     67        psError(psErrorCodeLast(), false, "Unable to prepare for combination.");
    6868        psFree(stack);
    6969        psFree(options);
     
    7474    psTrace("ppStack", 1, "Initial stack of convolved images....\n");
    7575    if (!ppStackCombineInitial(stack, options, config)) {
    76         psError(PS_ERR_UNKNOWN, false, "Unable to perform initial combination.");
     76        psError(psErrorCodeLast(), false, "Unable to perform initial combination.");
    7777        psFree(stack);
    7878        psFree(options);
     
    8686    psTrace("ppStack", 1, "Reject pixels....\n");
    8787    if (!ppStackReject(options, config)) {
    88         psError(PS_ERR_UNKNOWN, false, "Unable to reject pixels.");
     88        psError(psErrorCodeLast(), false, "Unable to reject pixels.");
    8989        psFree(stack);
    9090        psFree(options);
     
    9898    psTrace("ppStack", 2, "Final stack of convolved images....\n");
    9999    if (!ppStackCombineFinal(options->outRO, stack, options->convCovars, options, config, false, false)) {
    100         psError(PS_ERR_UNKNOWN, false, "Unable to perform final combination.");
     100        psError(psErrorCodeLast(), false, "Unable to perform final combination.");
    101101        psFree(stack);
    102102        psFree(options);
     
    109109    psTrace("ppStack", 2, "Cleaning up after combination....\n");
    110110    if (!ppStackCleanup(stack, options, config)) {
    111         psError(PS_ERR_UNKNOWN, false, "Unable to clean up.");
     111        psError(psErrorCodeLast(), false, "Unable to clean up.");
    112112        psFree(stack);
    113113        psFree(options);
     
    125125        ppStackThreadData *stack = ppStackThreadDataSetup(options, config, false);
    126126        if (!stack) {
    127             psError(PS_ERR_IO, false, "Unable to initialise stack threads.");
     127            psError(psErrorCodeLast(), false, "Unable to initialise stack threads.");
    128128            psFree(options);
    129129            return false;
     
    131131        psTrace("ppStack", 2, "Stack of unconvolved images....\n");
    132132        if (!ppStackCombineFinal(options->unconvRO, stack, options->origCovars, options, config, false, true)) {
    133             psError(PS_ERR_UNKNOWN, false, "Unable to perform unconvolved combination.");
     133            psError(psErrorCodeLast(), false, "Unable to perform unconvolved combination.");
    134134            psFree(stack);
    135135            psFree(options);
     
    147147    psTrace("ppStack", 1, "Photometering stacked image....\n");
    148148    if (!ppStackPhotometry(options, config)) {
    149         psError(PS_ERR_UNKNOWN, false, "Unable to perform photometry.");
     149        psError(psErrorCodeLast(), false, "Unable to perform photometry.");
    150150        psFree(options);
    151151        return false;
     
    157157    psTrace("ppStack", 1, "Finishing up....\n");
    158158    if (!ppStackFinish(options, config)) {
    159         psError(PS_ERR_UNKNOWN, false, "Unable to finish up.");
     159        psError(psErrorCodeLast(), false, "Unable to finish up.");
    160160        psFree(options);
    161161        return false;
Note: See TracChangeset for help on using the changeset viewer.