IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30741


Ignore:
Timestamp:
Feb 22, 2011, 2:31:46 PM (15 years ago)
Author:
eugene
Message:

address some new failure modes

Location:
tags/ipp-20110218/psModules
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-20110218/psModules

  • tags/ipp-20110218/psModules/src/imcombine/pmSubtraction.c

    r30622 r30741  
    939939    // which are significantly deviant from that distribution.
    940940
     941    // if we only have 3 or fewer stars, we have to accept them all
     942    if (match->nGood < 3) {
     943        kernels->mean = NAN;
     944        kernels->rms = NAN;
     945        kernels->numStamps = match->nGood;
     946       
     947        psLogMsg("psModules.imcombine", PS_LOG_INFO, "only %d stars, keeping them all (good luck!)",  kernels->numStamps);
     948        return 0;
     949    }
     950
    941951    kernels->mean = NAN;
    942952    kernels->rms = NAN;
  • tags/ipp-20110218/psModules/src/imcombine/pmSubtractionMatch.c

    r30622 r30741  
    667667            }
    668668
     669            int nTries = 0;
    669670            bool tryAgain = true;
    670671            while (tryAgain) {
     
    677678
    678679                // generate the window function from the set of stamps
     680                // we attempt to set the window based on the measured kron radius, but the
     681                // initial guess may be too small. allow the window to grow if the kron radius
     682                // implies the need for a larger windon.  But only allow 2 additional tries
    679683                if (!pmSubtractionStampsGetWindow(&tryAgain, stamps, size)) {
    680684                    // if we failed, it might be due to the desired normWindow being larger than the current footprint.
    681685                    // in this case, just adjust the footprint and try again.
     686                    if (tryAgain && (nTries >= 2)) {
     687                        // unrecoverable error
     688                        psError(PM_ERR_STAMPS, true, "Unable to get stamp window (failure to converge).");
     689                        goto MATCH_ERROR;
     690                    }
    682691                    if (tryAgain) {
    683692                        // keep the border constant
     
    688697                        // we need to reconstruct everything, so just free the stamps here and retry
    689698                        psFree(stamps);
     699                        nTries ++;
    690700                    } else {
    691                         // unrecoverable error
     701                        // unrecoverable error generated in pmSubtractionStampsGetWindow
    692702                        psError(psErrorCodeLast(), false, "Unable to get stamp window.");
    693703                        goto MATCH_ERROR;
  • tags/ipp-20110218/psModules/src/imcombine/pmSubtractionStamps.c

    r30622 r30741  
    913913        psFree (norm2);
    914914        return false;
     915    }
     916
     917    if (!isfinite(R1) || !isfinite(R2)) {
     918        psError(PM_ERR_STAMPS, true, "Kron Radii are not finite (failure to converge).");
     919        psFree (stats);
     920        psFree (flux1);
     921        psFree (flux2);
     922        psFree (norm1);
     923        psFree (norm2);
     924        return false;
    915925    }
    916926
  • tags/ipp-20110218/psModules/src/imcombine/pmSubtractionVisual.c

    r30622 r30741  
    292292        type = im->type.type;
    293293    }
    294     if (imageMax == -1) return false;
     294    if (imageMax == -1) {
     295        psFree (matrixNorm);
     296        return false;
     297    }
    295298
    296299    int border = 15;
     
    350353    psFree(canvas);
    351354    psFree(canvas32);
     355    psFree (matrixNorm);
    352356    return true;
    353357}
     
    503507            psFitsClose(fits);
    504508        }
     509        psFree (output);
    505510    }
    506511       
     
    710715            pmSubtractionVisualShowFitAddStamp (image2, image1, residual, background, norm, i);
    711716        }
     717        psFree(polyValues);
    712718    }
    713719    pmSubtractionVisualShowFitImage(norm);
    714720
     721    psFree (residual);
    715722    return true;
    716723}
     
    10291036    KapaPlotVector (kapa3, lflx->n, lMxx->data.F32, "y");
    10301037
     1038    psFree (lflx);
     1039    psFree (lchi);
     1040    psFree (lMxx);
     1041
    10311042    pmVisualAskUser(NULL);
    10321043    return true;
Note: See TracChangeset for help on using the changeset viewer.