- Timestamp:
- Sep 19, 2009, 8:49:41 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20090715/psphot/src/psphotRadiiFromProfiles.c
r25433 r25452 1 1 # include "psphotInternal.h" 2 2 3 // Given the Petrosian data (radii, fluxes) determine the radius for each profile at the desisred isophote3 // Given the Radial Profiles (radii, fluxes) determine the radius for each profile at the desired isophote 4 4 5 bool psphotRadiiFromProfiles (pmSource *source, pmPetrosian *petrosian,float fluxMin, float fluxMax) {5 bool psphotRadiiFromProfiles (pmSource *source, float fluxMin, float fluxMax) { 6 6 7 petrosian->isophotalRadii = psVectorAlloc(petrosian->theta->n, PS_TYPE_F32);7 pmSourceRadialProfile *profile = source->extpars->profile; 8 8 9 for (int i = 0; i < petrosian->theta->n; i++) { 10 psVector *radii = petrosian->radii->data[i]; 11 psVector *fluxes = petrosian->fluxes->data[i]; 12 float radius = psphotRadiusFromProfile (source, radii, fluxes, fluxMin, fluxMax); 9 psFree(profile->isophotalRadii); 10 profile->isophotalRadii = psVectorAlloc(profile->theta->n, PS_TYPE_F32); 13 11 14 // psphotPetrosianVisualProfileByAngle (radii, fluxes, radius); 12 for (int i = 0; i < profile->theta->n; i++) { 13 psVector *radii = profile->radii->data[i]; 14 psVector *fluxes = profile->fluxes->data[i]; 15 float radius = psphotRadiusFromProfile (source, radii, fluxes, fluxMin, fluxMax); 15 16 16 // warn on NAN? 17 petrosian->isophotalRadii->data.F32[i] = radius; 18 } 19 return true; 17 // psphotPetrosianVisualProfileByAngle (radii, fluxes, radius); 18 19 // warn on NAN? 20 profile->isophotalRadii->data.F32[i] = radius; 21 } 22 return true; 20 23 } 21 24 … … 79 82 80 83 // sort the flux by the radius 81 p sphotPetrosianSortPair (radius, flux);84 pmSourceRadialProfileSortPair (radius, flux); 82 85 83 86 int nOut = 0; … … 128 131 // XXX is there a macro in psLib that does this interpolation? 129 132 if (i == 0) { 130 ps LogMsg ("psphot", 3, "bogus radial profile for ..., skipping");133 psTrace ("psphot", 4, "bogus radial profile for source at %f, %f, skipping", source->peak->xf, source->peak->yf); 131 134 psFree (fluxBinned); 132 135 psFree (radiusBinned);
Note:
See TracChangeset
for help on using the changeset viewer.
