IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 18, 2009, 6:24:53 AM (17 years ago)
Author:
eugene
Message:

updates for petrosian analysis study

Location:
branches/eam_branches/20090715/psphot/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20090715/psphot/src

    • Property svn:ignore
      •  

        old new  
        1818psphotVersionDefinitions.h
        1919psphotMomentsStudy
         20psphotPetrosianStudy
  • branches/eam_branches/20090715/psphot/src/psphotEllipticalProfile.c

    r25032 r25105  
    33bool psphotEllipticalProfile (pmSource *source, pmPetrosian *petrosian) {
    44
    5     petrosian->radiusElli = psArrayAllocEmpty(100);
    6     petrosian->fluxElli = psArrayAllocEmpty(100);
     5    petrosian->radiusElliptical = psVectorAllocEmpty(100, PS_TYPE_F32);
     6    petrosian->fluxElliptical = psVectorAllocEmpty(100, PS_TYPE_F32);
    77
    8     psVector *radius = petrosian->radiusElli;
    9     psVector *flux = petrosian->fluxElli;
     8    psVector *radius = petrosian->radiusElliptical;
     9    psVector *flux = petrosian->fluxElliptical;
    1010
    1111    // the psEllipse functions use z = 0.5(x/Sxx)^2 + 0.5(y/Syy)^2 + x y Sxy
     
    1414    // a = A / sqrt(2)
    1515
     16    // we have the shape parameters of the elliptical contour at the reference isophote.
     17    // use the axis ratio (major/minor) to rescale the radial profile so that 1 pixel
     18    // along the major axis is 1 pixel, and a smaller amount on the minor axis
     19
    1620    psEllipseAxes axes;
    17     axes.major = petrosian->axes.major * M_SQRT1_2;
    18     axes.minor = petrosian->axes.minor * M_SQRT1_2;
     21    axes.major = M_SQRT1_2;
     22    axes.minor = M_SQRT1_2 * (petrosian->axes.minor / petrosian->axes.major);
     23
     24    // axes.major = 1.0;
     25    // axes.minor = petrosian->axes.minor / petrosian->axes.major;
     26
    1927    axes.theta = petrosian->axes.theta;
    20     psEllipseShape shape = psEllipseShapeFromAxes (petrosian->axes);
     28    psEllipseShape shape = psEllipseAxesToShape (axes);
    2129
    2230    float Sxx = shape.sx;
     
    2432    float Syy = shape.sy;
    2533
    26     for (int iy = 0; iy < Ny; iy++) {
    27         for (int ix = 0; ix < Nx; ix++) {
     34    psVector *radiusRaw = psVectorAllocEmpty(100, PS_TYPE_F32);
     35    psVector *fluxRaw = psVectorAllocEmpty(100, PS_TYPE_F32);
     36
     37    for (int iy = 0; iy < source->pixels->numRows; iy++) {
     38        for (int ix = 0; ix < source->pixels->numCols; ix++) {
    2839
    2940            float x = ix - source->peak->xf + source->pixels->col0;
    3041            float y = iy - source->peak->yf + source->pixels->row0;
    3142
    32             psVectorAppend(radius, sqrt(0.5*PS_SQR(x/Sxx) + 0.5*PS_SQR(y/Syy) + x*y*Sxy));
    33             psVectorAppend(flux, pixels[iy][ix]);
     43            float r2 = 0.5*PS_SQR(x/Sxx) + 0.5*PS_SQR(y/Syy) + x*y*Sxy;
     44            // float r2 = PS_SQR(x/Sxx) + PS_SQR(y/Syy) + x*y*Sxy;
     45
     46            psVectorAppend(radius, sqrt(r2));
     47            psVectorAppend(flux, source->pixels->data.F32[iy][ix]);
     48
     49            float Rraw = hypot(x, y);
     50            psVectorAppend(radiusRaw, Rraw);
     51            psVectorAppend(fluxRaw, source->pixels->data.F32[iy][ix]);
    3452        }
    3553    }
    3654
     55    // psVector *radiusRaw = psVectorAllocEmpty(100, PS_TYPE_F32);
     56    // psVector *fluxRaw = psVectorAllocEmpty(100, PS_TYPE_F32);
     57    // for (int i = 0; i < petrosian->radii->n; i++) {
     58    //   psVector *r = petrosian->radii->data[i];
     59    //   psVector *f = petrosian->fluxes->data[i];
     60    //   for (int j = 0; j < r->n; j++) {
     61    //  psVectorAppend(radiusRaw, r->data.F32[j]);
     62    //  psVectorAppend(fluxRaw, f->data.F32[j]);
     63    //   }
     64    // }
     65
     66    // psphotPetrosianVisualProfileRadii (radius, flux, radiusRaw, fluxRaw, 0.0);
     67    psphotPetrosianVisualProfileByAngle (radius, flux);
    3768    return true;
    3869}
Note: See TracChangeset for help on using the changeset viewer.