IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 18, 2006, 8:44:12 AM (20 years ago)
Author:
eugene
Message:

select refstars by magnitude, fix various memory leaks, better error tests, fix luminosity function test

File:
1 edited

Legend:

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

    r9587 r9627  
    22
    33static void usage (void) {
    4     psErrorStackPrint(stderr, "USAGE: psastro [-file image(s)] [-list imagelist] (output)");
     4    psErrorStackPrint(stderr, "USAGE: psastro [-file image(s)] [-list imagelist] (output)\n");
    55    exit (2);
    66}
     
    2020    // load identify the data sources
    2121    if (!psastroParseCamera (config)) {
    22         psErrorStackPrint(stderr, "error setting up the camera");
     22        psErrorStackPrint(stderr, "error setting up the camera\n");
    2323        exit (1);
    2424    }
     
    2727    // select subset of stars for astrometry
    2828    if (!psastroDataLoad (config)) {
    29         psErrorStackPrint(stderr, "error loading input data");
     29        psErrorStackPrint(stderr, "error loading input data\n");
    3030        exit (1);
    3131    }
     
    3434    // apply the initial guess
    3535    if (!psastroAstromGuess (config)) {
    36         psErrorStackPrint(stderr, "failed to determine initial astrometry guess");
     36        psErrorStackPrint(stderr, "failed to determine initial astrometry guess\n");
    3737        exit (1);
    3838    }
     
    4141    psArray *refs = psastroLoadRefstars (config);
    4242    if (!refs) {
    43         psErrorStackPrint(stderr, "failed to load reference data");
     43        psErrorStackPrint(stderr, "failed to load reference data\n");
    4444        exit (1);
    4545    }
    4646
    4747    // choose reference stars corresponding to the selected chips
    48     if (psastroChooseRefstars (config, refs)) {
    49         psErrorStackPrint(stderr, "failed to select reference data for chips");
     48    if (!psastroChooseRefstars (config, refs)) {
     49        psErrorStackPrint(stderr, "failed to select reference data for chips\n");
    5050        exit (1);
    5151    }
     
    5454    if (mosastro == NULL) {
    5555        if (!psastroChipAstrom (config, refs)) {
    56             psErrorStackPrint(stderr, "failed to perform single chip astrometry");
     56            psErrorStackPrint(stderr, "failed to perform single chip astrometry\n");
    5757            exit (1);
    5858        }
    5959    } else {
    6060        if (!psastroMosaicAstrom (config, refs)) {
    61             psErrorStackPrint(stderr, "failed to perform mosaic camera astrometry");
     61            psErrorStackPrint(stderr, "failed to perform mosaic camera astrometry\n");
    6262            exit (1);
    6363        }
     
    6969    // write out the results
    7070    if (!psastroDataSave (config)) {
    71         psErrorStackPrint(stderr, "failed to write out data");
     71        psErrorStackPrint(stderr, "failed to write out data\n");
    7272        exit (1);
    7373    }
     
    7575    psLogMsg ("psastro", 3, "complete psastro run: %f sec\n", psTimerMark ("complete"));
    7676
    77     psFree (refs);
    78     psFree (config);
    79 
    80     psTimerStop ();
    81     psMemCheckCorruption (true);
    82     pmModelGroupCleanup ();
    83     psTimeFinalize ();
    84     pmConceptsDone ();
    85     pmConfigDone ();
    86     // fprintf (stderr, "found %d leaks at %s\n", psMemCheckLeaks (0, NULL, stdout, false), "psastro");
    87     fprintf (stderr, "found %d leaks at %s\n", psMemCheckLeaks (0, NULL, NULL, false), "psastro");
    88 
    89     exit (0);
     77    psastroCleanup (config, refs);
     78    exit (EXIT_SUCCESS);
    9079}
Note: See TracChangeset for help on using the changeset viewer.