IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 30, 2013, 5:41:48 AM (13 years ago)
Author:
eugene
Message:

getting psphotFullForce to run (not quite there)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130904/psphot/src/psphotGalaxyShape.c

    r36156 r36161  
    1111    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE);
    1212    psAssert (recipe, "missing recipe?");
     13
     14    // perform full non-linear fits / extended source analysis?
     15    // XXX for this to be true for psphotFullForce??
     16    if (!psMetadataLookupBool (&status, recipe, "GALAXY_SHAPES")) {
     17        psLogMsg ("psphot", PS_LOG_INFO, "skipping galaxy shape measurements\n");
     18        return true;
     19    }
    1320
    1421    int num = psphotFileruleCount(config, filerule);
     
    7885    assert (status);
    7986
    80     // source fitting parameters for extended source fits
    81     int fitIter = psMetadataLookupS32(&status, recipe, "EXT_FIT_ITER"); // Max number of fit iterations
    82     assert (status && fitIter > 0);
    83 
    84     float fitMinTol = psMetadataLookupF32 (&status, recipe, "EXT_FIT_MIN_TOL"); // Fit tolerance
    85     if (!status || !isfinite(fitMinTol) || fitMinTol <= 0) {
    86         fitMinTol = psMetadataLookupF32 (&status, recipe, "PSF_FIT_TOL"); // Fit tolerance
    87         if (!status || !isfinite(fitMinTol) || fitMinTol <= 0) {
    88             psAbort("PSF_FIT_MIN_TOL (and PSF_FIT_TOL) not defined or positive");
    89         }
    90     }
    91 
    92     float fitMaxTol = psMetadataLookupF32 (&status, recipe, "EXT_FIT_MAX_TOL"); // Fit tolerance
    93     if (!status || !isfinite(fitMaxTol) || fitMaxTol <= 0) {
    94         fitMaxTol = 1.0;
    95     }
    96 
    97     bool chisqConvergence = psMetadataLookupBool (&status, recipe, "LMM_FIT_CHISQ_CONVERGENCE"); // Fit tolerance
    98     if (!status) {
    99         // default to the old method (chisqConvergence)
    100         chisqConvergence = true;
    101     }
    102 
    103     int gainFactorMode = psMetadataLookupS32 (&status, recipe, "LMM_FIT_GAIN_FACTOR_MODE"); // Fit tolerance
    104     if (!status) {
    105         // default to the old method (chisqConvergence)
    106         gainFactorMode = 0;
    107     }
    108 
    109     // perform full extended source non-linear fits?
    110     bool isInteractive = psMetadataLookupBool (&status, recipe, "EXTENDED_SOURCE_FITS_INTERACTIVE");
    111     if (!status) isInteractive = false;
    112 
    11387    // Define source fitting parameters for extended source fits
     88    // we are not doing LMM fitting, so most options are irrelevant
    11489    pmSourceFitOptions *fitOptions = pmSourceFitOptionsAlloc();
    11590    fitOptions->mode           = PM_SOURCE_FIT_EXT_AND_SKY;
    116     fitOptions->saveCovariance = true;  // XXX make this a user option?
    11791    fitOptions->covarFactor    = psImageCovarianceFactorForAperture(readout->covariance, 10.0); // Covariance matrix
    118     fitOptions->nIter          = fitIter;
    119     fitOptions->minTol         = fitMinTol;
    120     fitOptions->maxTol         = fitMaxTol;
    121 
    122     fitOptions->gainFactorMode   = gainFactorMode;
    123     fitOptions->chisqConvergence = chisqConvergence;
    124     fitOptions->isInteractive    = isInteractive;
    12592
    12693    // source analysis is done in S/N order (brightest first)
Note: See TracChangeset for help on using the changeset viewer.