IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 2, 2010, 11:32:52 AM (16 years ago)
Author:
eugene
Message:

updates to psphotVisual mandated by kapa API changes; added psphotRadialBins; fixed up petrosian calculations (now correctly generate petRad, petMag, petR50, and petR90); updates to psphotPetrosianVisual to handle structure changes; option to use elliptical or circular profiles for radial flux and petrosians

File:
1 edited

Legend:

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

    r26894 r27819  
    3939    int Nkron = 0;
    4040
     41    psTimerStart ("psphot.extended");
     42
    4143    // find the currently selected readout
    4244    pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest
     
    6668    float skynoise = psMetadataLookupF32 (&status, recipe, "SKY.NOISE");
    6769
    68 # if (0)
    69     // if backModel or backStdev are missing, the values of sky and/or skyErr will be set to NAN
    70     // XXX use this to set skynoise
    71     pmReadout *backModel = psphotSelectBackground (config, view);
    72     pmReadout *backStdev = psphotSelectBackgroundStdev (config, view);
    73 # endif
    74 
    7570    // S/N limit to perform full non-linear fits
    7671    float SN_LIM = psMetadataLookupF32 (&status, recipe, "EXTENDED_SOURCE_SN_LIM");
     
    8176    bool doAnnuli       = psMetadataLookupBool (&status, recipe, "EXTENDED_SOURCE_ANNULI");
    8277    bool doKron         = psMetadataLookupBool (&status, recipe, "EXTENDED_SOURCE_KRON");
     78
     79# if (0)
     80    // if backModel or backStdev are missing, the values of sky and/or skyErr will be set to NAN
     81    // XXX use this to set skynoise
     82    pmReadout *backModel = psphotSelectBackground (config, view);
     83    pmReadout *backStdev = psphotSelectBackgroundStdev (config, view);
     84# endif
    8385
    8486    // source analysis is done in S/N order (brightest first)
     
    119121        Next ++;
    120122
     123        // force source image to be a bit larger...
     124        float radius = source->peak->xf - source->pixels->col0;
     125        radius = PS_MAX (radius, source->peak->yf - source->pixels->row0);
     126        radius = PS_MAX (radius, source->pixels->numRows - source->peak->yf + source->pixels->row0);
     127        radius = PS_MAX (radius, source->pixels->numCols - source->peak->xf + source->pixels->col0);
     128        pmSourceRedefinePixels (source, readout, source->peak->xf, source->peak->yf, 1.5*radius);
     129
    121130        // if we request any of these measurements, we require the radial profile
    122131        if (doPetrosian || doIsophotal || doAnnuli || doKron) {
     
    134143        if (doPetrosian) {
    135144            if (!psphotPetrosian (source, recipe, skynoise, maskVal)) {
    136                 psTrace ("psphot", 5, "measured petrosian flux & radius for source at %7.1f, %7.1f", source->moments->Mx, source->moments->My);
     145                psTrace ("psphot", 5, "FAILED petrosian flux & radius for source at %7.1f, %7.1f", source->moments->Mx, source->moments->My);
    137146            } else {
    138147                psTrace ("psphot", 5, "measured petrosian flux & radius for source at %7.1f, %7.1f", source->moments->Mx, source->moments->My);
     
    169178
    170179        if (source->extpars) {
    171             pmSourceRadialProfileFreeVectors(source->extpars->profile);
     180            psFree(source->extpars->radFlux);
     181            psFree(source->extpars->ellipticalFlux);
    172182        }
    173183    }
    174184
    175     psLogMsg ("psphot", PS_LOG_INFO, "extended source analysis: %f sec for %d objects\n", psTimerMark ("psphot"), Next);
     185    psLogMsg ("psphot", PS_LOG_INFO, "extended source analysis: %f sec for %d objects\n", psTimerMark ("psphot.extended"), Next);
    176186    psLogMsg ("psphot", PS_LOG_INFO, "  %d petrosian\n", Npetro);
    177187    psLogMsg ("psphot", PS_LOG_INFO, "  %d isophotal\n", Nisophot);
Note: See TracChangeset for help on using the changeset viewer.