IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12341


Ignore:
Timestamp:
Mar 8, 2007, 1:27:24 PM (19 years ago)
Author:
rhl
Message:

When psVectorClipFitPolynomial1D fails in pmPSFtryModel, fall back
on un-clipped version.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/rel-1_0/psModules/src/objects/pmPSFtry.c

    r11158 r12341  
    55 *  @author EAM, IfA
    66 *
    7  *  @version $Revision: 1.34 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2007-01-19 04:35:53 $
     7 *  @version $Revision: 1.34.2.1 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2007-03-08 23:27:24 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    215215    bool result = psVectorClipFitPolynomial1D(psfTry->psf->ChiTrend, stats, mask, 1, chisq, NULL, flux);
    216216    psLogMsg ("pmPSFtry", 4, "chisq vs flux fit: %f +/- %f\n", stats->robustMedian, stats->robustStdev);
     217    if (!result) {
     218        result = psVectorFitPolynomial1D(psfTry->psf->ChiTrend, mask, 1, chisq, NULL, flux);
     219    }
    217220
    218221    psFree (flux);
     
    276279    bool result = psVectorClipFitPolynomial1D (poly, stats, psfTry->mask, PSFTRY_MASK_ALL, psfTry->metric, psfTry->metricErr, r2rflux);
    277280    if (!result) {
    278         psError(PS_ERR_UNKNOWN, false, "Failed to fit clipped poly");
    279         return false;
     281        psLogMsg(__func__, 3, "Failed to fit clipped poly");
     282        if (!psVectorFitPolynomial1D(poly, psfTry->mask, PSFTRY_MASK_ALL,
     283                                     psfTry->metric, psfTry->metricErr, r2rflux)) {
     284            return false;
     285        }
    280286    }
    281287    psLogMsg ("pmPSFtryMetric", 4, "fit stats: %f +/- %f\n", stats->robustMedian, stats->robustStdev);
     
    361367    // we are doing a robust fit.  after each pass, we drop points which are
    362368    // more deviant than three sigma.
    363     // mask is currently updated for each pass. this is inconsistent?
     369    // mask is currently updated for each parameter, so potentially
     370    // different sets of stars are used for SXX, SYY, SXY, ...
    364371
    365372    psStats *stats = psStatsAlloc (PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV);
     
    397404        // the weight is either the parameter error or NULL, depending on 'applyWeights'
    398405        if (!psVectorClipFitPolynomial2D(psf->params_NEW->data[i], stats, psfTry->mask, 0xff, z, NULL, x, y)) {
    399             psError(PS_ERR_UNKNOWN, false, "failed to build psf model for parameter %d", i);
    400             return false;
     406            // Should save error stack at this point, and add any new errors on the end if
     407            // we still have problems; but we don't have an API to do this
     408            psLogMsg ("pmPSFtry", 4, "failed to build psf model for parameter %d with clipping", i);
     409
     410            if (!psVectorFitPolynomial2D(psf->params_NEW->data[i], psfTry->mask, 0xff, z, NULL, x, y)) {
     411                psError(PS_ERR_UNKNOWN, false, "failed to build unclipped psf model for parameter %d", i);
     412                return false;
     413            }
    401414        }
    402415    }
Note: See TracChangeset for help on using the changeset viewer.