- Timestamp:
- Aug 18, 2009, 6:24:53 AM (17 years ago)
- Location:
- branches/eam_branches/20090715/psphot/src
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
psphotPetrosianProfile.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/psphotPetrosianProfile.c
r25032 r25105 1 1 # include "psphotInternal.h" 2 3 // generate the Petrosian radius and flux using elliptical contours 4 5 // XXX much of this function is focused on generating the clean contours, which can be used by 6 // any number of aperture-like measurements. probably will want to rename the pmPetrosian 7 // structure to something the pmRadialProfile 2 8 3 9 bool psphotPetrosianProfile (pmSource *source) { 4 10 11 // container to hold results from the radial profile analysis 5 12 pmPetrosian *petrosian = pmPetrosianAlloc(); 6 13 7 if (!psphotRadialProfilesByAngle (petrosian, source, Nsec, Rmax)) { 14 int Nsec = 24; 15 float Rmax = 64; 16 float fluxMin = 0.0; 17 float fluxMax = 1000.0; 18 19 // generate a series of radial profiles at Nsec evenly spaced angles. the profile flux 20 // is measured by interpolation for small radii; for large radii, the pixels in a box 21 // are averaged to increase the S/N (XXX not yet done) 22 if (!psphotRadialProfilesByAngles (petrosian, source, Nsec, Rmax)) { 8 23 psError (PS_ERR_UNKNOWN, false, "failed to measure radial profile for petrosian"); 9 24 return false; 10 25 } 11 26 27 // use the radial profiles to determine the radius of a given isophote. this isophote 28 // is used to determine the elliptical shape of the object, so it has a relatively high 29 // value (nominally 50% of the peak) 12 30 if (!psphotRadiiFromProfiles (petrosian, fluxMin, fluxMax)) { 13 31 psError (PS_ERR_UNKNOWN, false, "failed to measure isophotal radii from profiles"); … … 15 33 } 16 34 35 // convert the isophotal radius vs angle measurements to an elliptical contour 17 36 if (!psphotEllipticalContour (petrosian)) { 18 37 psError (PS_ERR_UNKNOWN, false, "failed to measure elliptical contour"); … … 20 39 } 21 40 41 // generate a single, normalized radial profile following the elliptical contours. 42 // the radius is normalized by the axis ratio so that on the major axis, 1 pixel = 1 pixel 43 if (!psphotEllipticalProfile (source, petrosian)) { 44 psError (PS_ERR_UNKNOWN, false, "failed to generate elliptical profile"); 45 return false; 46 } 47 48 // integrate the radial profile for radial bins defined for the petrosian measurement: 49 // SB_i (r_i) where \alpha r_i < r < \beta r_i 50 if (!psphotPetrosianRadialBins (source, petrosian, Rmax)) { 51 psError (PS_ERR_UNKNOWN, false, "failed to generate elliptical profile"); 52 return false; 53 } 54 55 // use the SB_i from above to calculate the petrosian radius and the flux within that radius 56 if (!psphotPetrosianStats (petrosian)) { 57 psError (PS_ERR_UNKNOWN, false, "failed to generate elliptical profile"); 58 return false; 59 } 60 61 psphotPetrosianFreeVectors(petrosian); 22 62 63 fprintf (stderr, "petrosian radius: %f, flux: %f, axis ratio: %f, angle: %f\n", 64 petrosian->petrosianRadius, petrosian->petrosianFlux, petrosian->axes.minor/petrosian->axes.major, PS_DEG_RAD*petrosian->axes.theta); 65 66 return true; 23 67 }
Note:
See TracChangeset
for help on using the changeset viewer.
