IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 17786


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.

Location:
trunk/psastro/src
Files:
2 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
  • trunk/psastro/src/psastroMosaicChipAstrom.c

    r17108 r17786  
    1313        psTrace ("psastro", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);
    1414        if (!chip->process || !chip->file_exists) { continue; }
    15         if (!chip->toFPA) { continue; }
    16        
    17         while ((cell = pmFPAviewNextCell (view, fpa, 1)) != NULL) {
     15        if (!chip->toFPA) { continue; }
     16
     17        while ((cell = pmFPAviewNextCell (view, fpa, 1)) != NULL) {
    1818            psTrace ("psastro", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
    1919            if (!cell->process || !cell->file_exists) { continue; }
    2020
    21             // process each of the readouts
    22             // XXX there can only be one readout per chip, right?
    23             while ((readout = pmFPAviewNextReadout (view, fpa, 1)) != NULL) {
    24                 if (! readout->data_exists) { continue; }
     21            // process each of the readouts
     22            // XXX there can only be one readout per chip, right?
     23            while ((readout = pmFPAviewNextReadout (view, fpa, 1)) != NULL) {
     24                if (! readout->data_exists) { continue; }
    2525
    26                 // save WCS and analysis metadata in update header
    27                 psMetadata *updates = psMetadataAlloc();
     26                // save WCS and analysis metadata in update header
     27                psMetadata *updates = psMetadataAlloc();
    2828
    29                 if (!psastroMosaicOneChip (chip, readout, recipe, updates, iteration)) {
    30                     readout->data_exists = false;
    31                     psLogMsg ("psastro", 3, "failed to find a solution for %d,%d,%d\n", view->chip, view->cell, view->readout);
    32                     psFree (updates);
    33                     continue;
    34                 }
     29                if (!psastroMosaicOneChip (chip, readout, recipe, updates, iteration)) {
     30                    readout->data_exists = false;
     31                    psError(PS_ERR_UNKNOWN, false, "failed to find a solution for %d,%d,%d\n",
     32                            view->chip, view->cell, view->readout);
     33                    psFree(updates);
     34                    psFree(view);
     35                    return false;
     36                }
    3537
    36                 // create the header keywords to descripe the results
    37                 pmAstromWriteBilevelChip (updates, chip, NONLIN_TOL);
    38                 psMetadataAddMetadata (readout->analysis, PS_LIST_TAIL, "PSASTRO.HEADER",  PS_META_REPLACE, "psastro header stats", updates);
    39                 psFree (updates);
    40             }
    41         }
     38                // create the header keywords to descripe the results
     39                pmAstromWriteBilevelChip (updates, chip, NONLIN_TOL);
     40                psMetadataAddMetadata (readout->analysis, PS_LIST_TAIL, "PSASTRO.HEADER",  PS_META_REPLACE, "psastro header stats", updates);
     41                psFree (updates);
     42            }
     43        }
    4244    }
    4345    psFree (view);
Note: See TracChangeset for help on using the changeset viewer.