IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9647


Ignore:
Timestamp:
Oct 18, 2006, 5:04:24 PM (20 years ago)
Author:
eugene
Message:

added log outputs, fixed memory leak, added error tests

File:
1 edited

Legend:

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

    r9574 r9647  
    88    psastroWriteStars ("raw.0.dat", rawstars);
    99    psastroWriteStars ("ref.0.dat", refstars);
    10     psastroWriteTransform (chip->toFPA);
     10    // psastroWriteTransform (chip->toFPA);
    1111
    1212    // find initial offset / rotation
    13     pmAstromStats stats = pmAstromGridMatch (rawstars, refstars, recipe);
    14     stats = pmAstromGridTweak (rawstars, refstars, recipe, stats);
    15     psLogMsg ("psastro", 3, "grid search result: %f,%f @ %f deg\n", stats.offset.x, stats.offset.y, DEG_RAD*stats.angle);
     13    pmAstromStats *gridStats = pmAstromGridMatch (rawstars, refstars, recipe);
     14    if (gridStats == NULL) {
     15        psError(PSASTRO_ERR_DATA, false, "failed to find a grid match solution\n");
     16        return false;
     17    }
     18    psLogMsg ("psastro", 3, "basic grid search result - offset: %f,%f pixels, rotation: %f deg\n", gridStats->offset.x, gridStats->offset.y, DEG_RAD*gridStats->angle);
     19
     20    pmAstromStats *stats = pmAstromGridTweak (rawstars, refstars, recipe, gridStats);
     21
     22    psLogMsg ("psastro", 3, "tweak grid search result - offset: %f,%f pixels, rotation: %f deg\n", stats->offset.x, stats->offset.y, DEG_RAD*stats->angle);
    1623
    1724    // adjust the chip.toFPA terms only
     
    2128    psastroWriteStars ("raw.1.dat", rawstars);
    2229    psastroWriteStars ("ref.1.dat", refstars);
    23     psastroWriteTransform (chip->toFPA);
     30    // psastroWriteTransform (chip->toFPA);
    2431
    2532    // use small radius to match stars
     
    2734
    2835    // improved fit for astrometric terms
    29     pmAstromMatchFit (chip->toFPA, rawstars, refstars, match, recipe, updates);
     36    if (!pmAstromMatchFit (chip->toFPA, rawstars, refstars, match, recipe, updates)) {
     37        psError(PSASTRO_ERR_DATA, false, "failed to find a valid fitted match solution\n");
     38        return false;
     39    }
     40
     41    // write results
    3042    psastroUpdateChipToFPA (fpa, chip, rawstars, refstars);
    3143
     
    3547
    3648    psFree (match);
     49    psFree (stats);
     50    psFree (gridStats);
    3751    return true;
    3852}
Note: See TracChangeset for help on using the changeset viewer.