IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 23, 2008, 3:04:23 PM (18 years ago)
Author:
Paul Price
Message:

Stop with the misleading exit status --- if it failed, then give an exit status indicating failure.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psastro/src/psastroAnalysis.c

    r17675 r17786  
    1212    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, PSASTRO_RECIPE);
    1313    if (!recipe) {
    14         psError(PSASTRO_ERR_CONFIG, true, "Can't find PSASTRO recipe");
    15         return false;
     14        psError(PSASTRO_ERR_CONFIG, true, "Can't find PSASTRO recipe");
     15        return false;
    1616    }
    1717
    1818    if (!psastroUseModel (config, recipe)) {
    19         psError (PSASTRO_ERR_UNKNOWN, false, "failed to set model astrometry\n");
    20         return false;
     19        psError (PSASTRO_ERR_UNKNOWN, false, "failed to set model astrometry\n");
     20        return false;
    2121    }
    2222
     
    2424    // apply the initial guess
    2525    if (!psastroAstromGuess (&nStars, config)) {
    26         psError (PSASTRO_ERR_UNKNOWN, false, "failed to determine initial astrometry guess\n");
    27         return false;
     26        psError (PSASTRO_ERR_UNKNOWN, false, "failed to determine initial astrometry guess\n");
     27        return false;
    2828    }
    2929    if (nStars == 0) {
    30         psLogMsg ("psastro", 2, "skipping astrometry analysis : no stars\n");
    31         return true;
     30        psLogMsg ("psastro", 2, "skipping astrometry analysis : no stars\n");
     31        return false;
    3232    }
    3333
     
    3535    psArray *refs = psastroLoadRefstars(config);
    3636    if (!refs) {
    37         psError (PSASTRO_ERR_UNKNOWN, false, "failed to load reference data\n");
    38         return false;
     37        psError (PSASTRO_ERR_UNKNOWN, false, "failed to load reference data\n");
     38        return false;
    3939    }
    4040    if (refs->n == 0) {
    4141        psError(PSASTRO_ERR_REFSTARS, true, "no reference stars found");
    4242        psFree(refs);
    43         return NULL;
     43        return false;
    4444    }
    4545
    4646    if (!psastroChooseRefstars (config, refs)) {
    47         psError (PSASTRO_ERR_UNKNOWN, false, "failed to select reference data for chips\n");
     47        psError (PSASTRO_ERR_UNKNOWN, false, "failed to select reference data for chips\n");
    4848        psFree(refs);
    49         return false;
     49        return false;
    5050    }
    5151
     
    5353    bool chipastro = psMetadataLookupBool (&status, config->arguments, "PSASTRO.CHIP.MODE");
    5454    if (!status) {
    55         chipastro = psMetadataLookupBool (&status, recipe, "PSASTRO.CHIP.MODE");
     55        chipastro = psMetadataLookupBool (&status, recipe, "PSASTRO.CHIP.MODE");
    5656    }
    5757    bool mosastro  = psMetadataLookupBool (&status, config->arguments, "PSASTRO.MOSAIC.MODE");
    5858    if (!status) {
    59         mosastro  = psMetadataLookupBool (&status, recipe, "PSASTRO.MOSAIC.MODE");
     59        mosastro  = psMetadataLookupBool (&status, recipe, "PSASTRO.MOSAIC.MODE");
    6060    }
    6161    if (!chipastro && !mosastro) {
    62         psLogMsg ("psastro", 3, "no astrometry mode selected, assuming chip astrometry\n");
    63         chipastro = true;
     62        psLogMsg ("psastro", 3, "no astrometry mode selected, assuming chip astrometry\n");
     63        chipastro = true;
    6464    }
    6565
    6666    if (chipastro) {
    67         if (!psastroChipAstrom (config)) {
    68             psError (PSASTRO_ERR_UNKNOWN, false, "failed to perform single chip astrometry\n");
    69             psFree(refs);
    70             return false;
    71         }
    72     } 
     67        if (!psastroChipAstrom (config)) {
     68            psError (PSASTRO_ERR_UNKNOWN, false, "failed to perform single chip astrometry\n");
     69            psFree(refs);
     70            return false;
     71        }
     72    }
    7373    if (mosastro) {
    74         if (!psastroMosaicAstrom (config)) {
    75             psError (PSASTRO_ERR_UNKNOWN, false, "failed to perform mosaic camera astrometry\n");
    76             psFree(refs);
    77             return false;
    78         }
     74        if (!psastroMosaicAstrom (config)) {
     75            psError (PSASTRO_ERR_UNKNOWN, false, "failed to perform mosaic camera astrometry\n");
     76            psFree(refs);
     77            return false;
     78        }
    7979    }
    8080
Note: See TracChangeset for help on using the changeset viewer.