- Timestamp:
- Aug 18, 2009, 6:24:53 AM (17 years ago)
- Location:
- branches/eam_branches/20090715/psphot/src
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
psphotEllipticalProfile.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20090715/psphot/src
- Property svn:ignore
-
old new 18 18 psphotVersionDefinitions.h 19 19 psphotMomentsStudy 20 psphotPetrosianStudy
-
- Property svn:ignore
-
branches/eam_branches/20090715/psphot/src/psphotEllipticalProfile.c
r25032 r25105 3 3 bool psphotEllipticalProfile (pmSource *source, pmPetrosian *petrosian) { 4 4 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); 7 7 8 psVector *radius = petrosian->radiusElli ;9 psVector *flux = petrosian->fluxElli ;8 psVector *radius = petrosian->radiusElliptical; 9 psVector *flux = petrosian->fluxElliptical; 10 10 11 11 // the psEllipse functions use z = 0.5(x/Sxx)^2 + 0.5(y/Syy)^2 + x y Sxy … … 14 14 // a = A / sqrt(2) 15 15 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 16 20 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 19 27 axes.theta = petrosian->axes.theta; 20 psEllipseShape shape = psEllipse ShapeFromAxes (petrosian->axes);28 psEllipseShape shape = psEllipseAxesToShape (axes); 21 29 22 30 float Sxx = shape.sx; … … 24 32 float Syy = shape.sy; 25 33 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++) { 28 39 29 40 float x = ix - source->peak->xf + source->pixels->col0; 30 41 float y = iy - source->peak->yf + source->pixels->row0; 31 42 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]); 34 52 } 35 53 } 36 54 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); 37 68 return true; 38 69 }
Note:
See TracChangeset
for help on using the changeset viewer.
