IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 2, 2009, 2:51:37 PM (17 years ago)
Author:
Paul Price
Message:

Merging in branches/pap/ from r23685. Some conflicts, most notably in ippTools, but these resolved fairly simply. Only question mark is on regtool reversion, but I think I got it right. Everything builds fine.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/psastro

  • trunk/psastro/src/psastro.c

    r23195 r23688  
    1313# include "psastroStandAlone.h"
    1414
    15 static void usage (void) {
    16     fprintf (stderr, "USAGE: psastro [-file image(s)] [-list imagelist] (output)\n");
    17     exit (2);
     15static void usage(void) {
     16    fprintf(stderr, "USAGE: psastro [-file image(s)] [-list imagelist] (output)\n");
     17    exit(PS_EXIT_CONFIG_ERROR);
    1818}
    1919
    20 int main (int argc, char **argv) {
    21 
    22     pmConfig *config = NULL;
    23 
     20int main (int argc, char **argv)
     21{
    2422    psTimerStart ("complete");
    2523
     
    2826    // model inits are needed in pmSourceIO
    2927    // models defined in psphot/src/models are not available in psastro
    30     pmModelClassInit ();
     28    pmModelClassInit();
    3129
    3230    // load configuration information
    33     config = psastroArguments (argc, argv);
    34     if (!config) usage ();
     31    pmConfig *config = config = psastroArguments(argc, argv);
     32    if (!config) {
     33        usage();
     34    }
    3535
    3636    psastroVersionPrint();
     
    3939    if (!psastroParseCamera (config)) {
    4040        psErrorStackPrint(stderr, "error setting up the camera\n");
    41         exit (1);
     41        psFree(config);
     42        exit(PS_EXIT_CONFIG_ERROR);
    4243    }
    4344
     
    4647    if (!psastroDataLoad (config)) {
    4748        psErrorStackPrint(stderr, "error loading input data\n");
    48         exit (1);
     49        psFree(config);
     50        exit(PS_EXIT_DATA_ERROR);
    4951    }
    5052
     53    psMetadata *stats = psMetadataAlloc(); // Statistics, for output
     54    psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", 0, "No problems", 0);
     55
    5156    // run the full astrometry analysis (chip and/or mosaic)
    52     if (!psastroAnalysis (config)) {
     57    if (!psastroAnalysis(config, stats)) {
    5358        psErrorStackPrint(stderr, "failure in psastro analysis\n");
    54         exit (1);
     59        psFree(config);
     60        psFree(stats);
     61        exit(PS_EXIT_SYS_ERROR);
    5562    }
    5663
    5764    // write out the results
    58     if (!psastroDataSave (config)) {
     65    if (!psastroDataSave(config, stats)) {
    5966        psErrorStackPrint(stderr, "failed to write out data\n");
    60         exit (1);
     67        psFree(config);
     68        psFree(stats);
     69        exit(PS_EXIT_DATA_ERROR);
    6170    }
    6271
    63     psLogMsg ("psastro", 3, "complete psastro run: %f sec\n", psTimerMark ("complete"));
     72    psLogMsg("psastro", 3, "complete psastro run: %f sec\n", psTimerMark ("complete"));
    6473
    65     psastroCleanup (config);
    66     exit (EXIT_SUCCESS);
     74    psastroCleanup(config);
     75    exit(PS_EXIT_SUCCESS);
    6776}
Note: See TracChangeset for help on using the changeset viewer.