IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 41493 for trunk


Ignore:
Timestamp:
Feb 11, 2021, 2:34:01 PM (5 years ago)
Author:
eugene
Message:

avoid crashing / error on bad data (bad quality instead)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/astrom/pmAstrometryObjects.c

    r40430 r41493  
    285285    for (int i = 0; i < nIter; i++) {
    286286        if (!psVectorClipFitPolynomial2D (map->x, results->xStats, mask, 0xff, x, wt, X, Y)) {
    287             psError(PS_ERR_UNKNOWN, false, "failure in clip-fitting for x\n");
     287            // psError(PS_ERR_UNKNOWN, false, "failure in clip-fitting for x\n");
     288            psLogMsg("psModule.astrom", 4, "failure in clip-fitting for x\n");
    288289            psFree (x);
    289290            psFree (y);
     
    299300
    300301        if (!psVectorClipFitPolynomial2D (map->y, results->yStats, mask, 0xff, y, wt, X, Y)) {
    301             psError(PS_ERR_UNKNOWN, false, "failure in clip-fitting for y\n");
     302            // psError(PS_ERR_UNKNOWN, false, "failure in clip-fitting for y\n");
     303            psLogMsg("psModule.astrom", 4, "failure in clip-fitting for y\n");
    302304            psFree (x);
    303305            psFree (y);
     
    363365    }
    364366
    365     results->dXsys = psVectorSystematicError (xResGood, xErr, 0.05);
    366     results->dYsys = psVectorSystematicError (yResGood, yErr, 0.05);
    367 
    368     results->dXrange = pmAstromVectorRange (xResGood, 0.1, 0.9, results->xStats->clippedStdev);
    369     results->dYrange = pmAstromVectorRange (yResGood, 0.1, 0.9, results->yStats->clippedStdev);
     367    // if xResGood or yResGood have no valid data, set these to NAN
     368    if ((xResGood->n == 0) || (yResGood->n == 0)) {
     369      results->dXsys   = results->dYsys   = NAN;
     370      results->dXrange = results->dYrange = NAN;
     371    } else {
     372      results->dXsys = psVectorSystematicError (xResGood, xErr, 0.05);
     373      results->dYsys = psVectorSystematicError (yResGood, yErr, 0.05);
     374
     375      results->dXrange = pmAstromVectorRange (xResGood, 0.1, 0.9, results->xStats->clippedStdev);
     376      results->dYrange = pmAstromVectorRange (yResGood, 0.1, 0.9, results->yStats->clippedStdev);
     377    }
    370378
    371379    psTrace ("psModules.astrom", 3, "dXsys: %f, dXrange: %f\n", results->dXsys, results->dXrange);
     
    442450
    443451    // Get the minimum and maximum values
     452    // XXX either clear the associated error, or disallow in psVectorStats
    444453    if (!psVectorStats(stats, myVector, NULL, NULL, 0)) {
    445454        psFree(stats);
     
    10421051
    10431052    if (minStat->nSigma < minSigma) {
    1044         psError(PS_ERR_UNKNOWN, true, "Failed to find a valid match (%f sigma for best)", minStat->nSigma);
     1053        psLogMsg ("psModule.astrom.grid.match", 3, "Failed to find a valid match (%f sigma for best)", minStat->nSigma);
    10451054        psFree (minStat);
    10461055        return NULL;
Note: See TracChangeset for help on using the changeset viewer.