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

    r25755 r27819  
    11# include "psphotInternal.h"
    22
    3 bool psphotEllipticalProfile (pmSource *source) {
     3bool psphotEllipticalProfile (pmSource *source, bool RAW_RADIUS) {
    44
    5     pmSourceRadialProfile *profile = source->extpars->profile;
     5    psAssert (source, "missing source");
     6    psAssert (source->extpars, "missing extpars");
     7    psAssert (source->pixels, "missing pixels");
     8
     9    pmSourceExtendedPars *extpars = source->extpars;
     10
     11    if (!source->extpars->ellipticalFlux) {
     12        source->extpars->ellipticalFlux = pmSourceEllipticalFluxAlloc();
     13    }
     14    pmSourceEllipticalFlux *profile = source->extpars->ellipticalFlux;
    615
    716    profile->radiusElliptical = psVectorAllocEmpty(100, PS_TYPE_F32);
     
    2130
    2231    psEllipseAxes axes;
    23     axes.major = M_SQRT1_2;
    24     axes.minor = M_SQRT1_2 * (profile->axes.minor / profile->axes.major);
     32    if (RAW_RADIUS) {
     33        // force circular profile
     34        axes.major = M_SQRT1_2;
     35        axes.minor = M_SQRT1_2;
     36    } else {
     37        axes.major = M_SQRT1_2;
     38        axes.minor = M_SQRT1_2 * (extpars->axes.minor / extpars->axes.major);
     39    }
    2540
    2641    // axes.major = 1.0;
    27     // axes.minor = profile->axes.minor / profile->axes.major;
     42    // axes.minor = extpars->axes.minor / extpars->axes.major;
    2843
    29     axes.theta = profile->axes.theta;
     44    axes.theta = extpars->axes.theta;
    3045    psEllipseShape shape = psEllipseAxesToShape (axes);
    3146
     
    4661
    4762            float r2 = 0.5*PS_SQR(x/Sxx) + 0.5*PS_SQR(y/Syy) + x*y*Sxy;
     63            float Rraw = hypot(x, y);
    4864
    4965            psVectorAppend(radius, sqrt(r2));
    5066            psVectorAppend(flux, source->pixels->data.F32[iy][ix]);
    5167
    52             float Rraw = hypot(x, y);
    5368            psVectorAppend(radiusRaw, Rraw);
    5469            psVectorAppend(fluxRaw, source->pixels->data.F32[iy][ix]);
     
    6782    // }
    6883
    69     // psphotPetrosianVisualProfileRadii (radius, flux, radiusRaw, fluxRaw, 0.0);
     84    psphotPetrosianVisualProfileRadii (radius, flux, radiusRaw, fluxRaw, source->peak->flux, 0.0);
    7085    // psphotPetrosianVisualProfileByAngle (radius, flux);
    7186
Note: See TracChangeset for help on using the changeset viewer.