IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 15, 2006, 8:30:16 AM (21 years ago)
Author:
eugene
Message:

API cleanup, removed old test files, some re-organization, changed FLT/GAL to EXT

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotFullFit.c

    r5828 r5993  
    1414    sources = psArraySort (sources, psphotSortBySN);
    1515   
    16     // galaxy model parameters
    17     float GAL_MIN_SN       = psMetadataLookupF32 (&status, config, "GAL_MIN_SN");
    18     float GAL_MOMENTS_RAD  = psMetadataLookupF32 (&status, config, "GAL_MOMENTS_RADIUS");
     16    // extended source model parameters
     17    float EXT_MIN_SN       = psMetadataLookupF32 (&status, config, "EXT_MIN_SN");
     18    float EXT_MOMENTS_RAD  = psMetadataLookupF32 (&status, config, "EXT_MOMENTS_RADIUS");
    1919
    20     // 'galaxy' model descriptions
    21     char         *modelNameFLT = psMetadataLookupPtr (&status, config, "GAL_MODEL");
    22     pmModelType   modelTypeFLT = pmModelSetType (modelNameFLT);
     20    // extended source model descriptions
     21    char         *modelNameEXT = psMetadataLookupPtr (&status, config, "EXT_MODEL");
     22    pmModelType   modelTypeEXT = pmModelSetType (modelNameEXT);
    2323
    2424    psphotInitLimitsPSF (config);
    2525    psphotInitRadiusPSF (config, sky, psf->type);
    26     psphotInitRadiusFLT (config, sky, modelTypeFLT);
     26    psphotInitRadiusEXT (config, sky, modelTypeEXT);
    2727
    2828    for (int i = 0; i < sources->n; i++) {
     
    8282
    8383        // skip the source if we don't think it is extended
    84         if (source->type != PM_SOURCE_GALAXY) goto subLINEAR;
    85         if (source->moments->SN < GAL_MIN_SN) goto subLINEAR;
     84        if (source->type != PM_SOURCE_EXTENDED) goto subLINEAR;
     85        if (source->moments->SN < EXT_MIN_SN) goto subLINEAR;
    8686
    8787        // add the double-PSF fit mode
    8888        // how do we compare the results?  chisq?
    8989       
    90         // recalculate the source moments using the larger galaxy moments radius
    91         if (!pmSourceMoments (source, GAL_MOMENTS_RAD)) goto subLINEAR;
     90        // recalculate the source moments using the larger extended-source moments radius
     91        if (!pmSourceMoments (source, EXT_MOMENTS_RAD)) goto subLINEAR;
    9292
    9393        // use the source moments, etc to guess basic model parameters
    94         source->modelFLT = pmSourceModelGuess (source, modelTypeFLT);
    95         pmModel *modelFLT = source->modelFLT;
     94        source->modelEXT = pmSourceModelGuess (source, modelTypeEXT);
     95        pmModel *modelEXT = source->modelEXT;
    9696
    97         psphotCheckRadiusFLT (imdata, source, modelFLT);
     97        psphotCheckRadiusEXT (imdata, source, modelEXT);
    9898
    99         x = modelFLT->params->data.F32[2];
    100         y = modelFLT->params->data.F32[3];
     99        x = modelEXT->params->data.F32[2];
     100        y = modelEXT->params->data.F32[3];
    101101
    102         // fit FLT (not PSF) model (set/unset the pixel mask)
    103         psImageKeepCircle (source->mask, x, y, modelFLT->radius, "OR", PSPHOT_MASK_MARKED);
    104         pmSourceFitModel (source, modelFLT, false);
    105         psImageKeepCircle (source->mask, x, y, modelFLT->radius, "AND", ~PSPHOT_MASK_MARKED);
     102        // fit EXT (not PSF) model (set/unset the pixel mask)
     103        psImageKeepCircle (source->mask, x, y, modelEXT->radius, "OR", PSPHOT_MASK_MARKED);
     104        pmSourceFitModel (source, modelEXT, false);
     105        psImageKeepCircle (source->mask, x, y, modelEXT->radius, "AND", ~PSPHOT_MASK_MARKED);
    106106
    107107        // track model evaluations
    108         Niter += modelFLT[0].nIter;
     108        Niter += modelEXT[0].nIter;
    109109        Nfit++;
    110110
    111         // does the FLT model succeed?
    112         if (psphotEvalFLT (source, source->modelFLT)) {
    113             pmSourceSubModel (source->pixels, source->mask, source->modelFLT, false, false);
     111        // does the EXT model succeed?
     112        if (psphotEvalEXT (source, source->modelEXT)) {
     113            pmSourceSubModel (source->pixels, source->mask, source->modelEXT, false, false);
    114114            source->mode |=  PM_SOURCE_SUBTRACTED;
    115115            source->mode &= ~PM_SOURCE_TEMPSUB;
Note: See TracChangeset for help on using the changeset viewer.