IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9655


Ignore:
Timestamp:
Oct 19, 2006, 11:57:02 AM (20 years ago)
Author:
eugene
Message:

added error checks and removed test output

File:
1 edited

Legend:

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

    r9647 r9655  
    22
    33bool psastroOneChip (pmFPA *fpa, pmChip *chip, psArray *refstars, psArray *rawstars, psMetadata *recipe, psMetadata *updates) {
    4 
    5     // bool status;
    6     psArray *match;
    7 
    8     psastroWriteStars ("raw.0.dat", rawstars);
    9     psastroWriteStars ("ref.0.dat", refstars);
    10     // psastroWriteTransform (chip->toFPA);
    114
    125    // find initial offset / rotation
     
    1811    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);
    1912
     13    // tweak the position by finding peak of matches stars
    2014    pmAstromStats *stats = pmAstromGridTweak (rawstars, refstars, recipe, gridStats);
    21 
     15    if (stats == NULL) {
     16        psError(PSASTRO_ERR_DATA, false, "failed to measure tweaked grid solution\n");
     17        return false;
     18    }
    2219    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);
    2320
     
    2623    psastroUpdateChipToFPA (fpa, chip, rawstars, refstars);
    2724
    28     psastroWriteStars ("raw.1.dat", rawstars);
    29     psastroWriteStars ("ref.1.dat", refstars);
    30     // psastroWriteTransform (chip->toFPA);
    31 
    3225    // use small radius to match stars
    33     match = pmAstromRadiusMatch (rawstars, refstars, recipe);
     26    psArray *match = pmAstromRadiusMatch (rawstars, refstars, recipe);
     27    if (stats == NULL) {
     28        psError(PSASTRO_ERR_UNKNOWN, false, "failed to find radius-matched sources\n");
     29        return false;
     30    }
    3431
    3532    // improved fit for astrometric terms
     
    4239    psastroUpdateChipToFPA (fpa, chip, rawstars, refstars);
    4340
    44     psastroWriteStars ("raw.2.dat", rawstars);
    45     psastroWriteStars ("ref.2.dat", refstars);
    46     psastroWriteTransform (chip->toFPA);
    47 
    4841    psFree (match);
    4942    psFree (stats);
     
    5245}
    5346
     47// psastroWriteStars ("raw.1.dat", rawstars);
     48// psastroWriteStars ("ref.1.dat", refstars);
     49// psastroWriteTransform (chip->toFPA);
     50
Note: See TracChangeset for help on using the changeset viewer.