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/psphotFitGalaxies.c

    r5828 r5993  
    11# include "psphot.h"
    22
    3 bool psphotFitGalaxies (eamReadout *imdata, psMetadata *config, psArray *sources, psStats *skyStats)
     3bool psphotFitExtended (eamReadout *imdata, psMetadata *config, psArray *sources, psStats *skyStats)
    44{
    55    bool  status;
     
    1212    psTimerStart ("psphot");
    1313
    14     float GAL_MIN_SN       = psMetadataLookupF32 (&status, config, "GAL_MIN_SN");
    15     float GAL_MOMENTS_RAD  = psMetadataLookupF32 (&status, config, "GAL_MOMENTS_RADIUS");
    16     char       *modelName  = psMetadataLookupPtr (&status, config, "GAL_MODEL");
     14    float EXT_MIN_SN       = psMetadataLookupF32 (&status, config, "EXT_MIN_SN");
     15    float EXT_MOMENTS_RAD  = psMetadataLookupF32 (&status, config, "EXT_MOMENTS_RADIUS");
     16    char       *modelName  = psMetadataLookupPtr (&status, config, "EXT_MODEL");
    1717    pmModelType modelType  = pmModelSetType (modelName);
    1818
    19     psphotInitRadiusFLT (config, skyStats, modelType);
     19    psphotInitRadiusEXT (config, skyStats, modelType);
    2020
    2121    for (int i = 0; i < sources->n; i++) {
     
    2323
    2424        // only fit suspected extended sources
    25         if (source->type != PM_SOURCE_GALAXY) continue;
     25        if (source->type != PM_SOURCE_EXTENDED) continue;
    2626        if (source->mode  & PM_SOURCE_BLEND) continue;
    2727
    2828        // skip possible extended sources below fit threshold
    29         if (source->moments->SN < GAL_MIN_SN) continue;
     29        if (source->moments->SN < EXT_MIN_SN) continue;
    3030
    31         // recalculate the source moments using the larger galaxy moments radius
    32         status = pmSourceMoments (source, GAL_MOMENTS_RAD);
     31        // recalculate the source moments using the larger extended-source moments radius
     32        status = pmSourceMoments (source, EXT_MOMENTS_RAD);
    3333        if (!status) {
    3434          source->mode |= PM_SOURCE_FAIL;  // better choice?
     
    3838        // use the source moments, etc to guess basic model parameters
    3939        pmModel  *model  = pmSourceModelGuess (source, modelType);
    40         source->modelFLT = model;
     40        source->modelEXT = model;
    4141        x = model->params->data.F32[2];
    4242        y = model->params->data.F32[3];
    4343
    4444        // sets the model radius (via source->model) and adjusts pixels as needed
    45         psphotCheckRadiusFLT (imdata, source, model);
     45        psphotCheckRadiusEXT (imdata, source, model);
    4646
    47         // fit FLT (not PSF) model (set/unset the pixel mask)
     47        // fit EXT (not PSF) model (set/unset the pixel mask)
    4848        psImageKeepCircle (source->mask, x, y, model->radius, "OR", PSPHOT_MASK_MARKED);
    4949        pmSourceFitModel (source, model, false);
     
    6161        }
    6262    }
    63     psLogMsg ("psphot", 3, "fit GAL models: %f sec for %d galaxies (%d total iterations)\n", psTimerMark ("psphot"), Nfit, Niter);
    64     psLogMsg ("psphot", 4, "subtracted %d GAL models\n", Nsub);
     63    psLogMsg ("psphot", 3, "fit EXT models: %f sec for %d objects (%d total iterations)\n", psTimerMark ("psphot"), Nfit, Niter);
     64    psLogMsg ("psphot", 4, "subtracted %d EXT objects\n", Nsub);
    6565    return (true);
    6666}
Note: See TracChangeset for help on using the changeset viewer.