IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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

handle poor norm window as bad quality

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/imcombine/pmSubtractionMatch.c

    r30622 r30740  
    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;
Note: See TracChangeset for help on using the changeset viewer.