- Timestamp:
- Oct 28, 2007, 3:41:13 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20071023/psphot/src/psphotIsophotal.c
r15359 r15400 7 7 assert (source->extpars->profile->radius); 8 8 assert (source->extpars->profile->flux); 9 10 bool status; 9 11 10 12 psVector *radius = source->extpars->profile->radius; … … 19 21 // XXX do I need to worry about crazy outliers? 20 22 // XXX should i be smoothing or fitting the curve? 21 firstBelow = -1;22 lastAbove = -1;23 int firstBelow = -1; 24 int lastAbove = -1; 23 25 for (int i = 0; i < flux->n; i++) { 24 26 if (flux->data.F32[i] > ISOPHOT_FLUX) lastAbove = i; … … 31 33 for (int i = 0; i <= PS_MAX(firstBelow, lastAbove); i++) { 32 34 if (i <= firstBelow) { 33 isophot FluxFirst += flux->data.F32[i];35 isophotalFluxFirst += flux->data.F32[i]; 34 36 } 35 37 if (i <= lastAbove) { 36 isophot FluxLast += flux->data.F32[i];38 isophotalFluxLast += flux->data.F32[i]; 37 39 } 38 40 } 39 float isophotalFlux = 0.5*(isophot FluxLast + isophotFluxFirst);40 float isophotalFluxErr = 0.5*fabs(isophot FluxLast - isophotFluxFirst);41 float isophotalFlux = 0.5*(isophotalFluxLast + isophotalFluxFirst); 42 float isophotalFluxErr = 0.5*fabs(isophotalFluxLast - isophotalFluxFirst); 41 43 42 44 float isophotalRad = 0.5*(radius->data.F32[firstBelow] + radius->data.F32[lastAbove]); … … 57 59 58 60 } 59 60 # if (0)61 // XXX cache the tmpScalar62 psScalar fluxScalar;63 fluxScalar.type.type = PS_TYPE_F32;64 fluxScalar.data.F32 = ISOPHOT_FLUX;65 66 // radius and flux must be sorted by radius67 68 // XXX in general, flux decreases monotonically with radius. however, since exceptions are69 // possible we need to do something to smooth or otherwise handle the flux variations70 71 // get the index of the flux-sorted vector72 psVector *fluxIndex = psVectorSortIndex (flux);73 74 // XXX need to write psVectorIndexBinaryDisect, which operates on a75 76 // use disection to get in the right vicinity77 binS = psVectorIndexBinaryDisect (&result, flux, fluxIndex, fluxScalar, PS_BISECT_FIRST);78 binE = psVectorIndexBinaryDisect (&result, flux, fluxIndex, fluxScalar, PS_BISECT_LAST);79 80 // find the min and max radius bins in this range81 82 // XXX do something to choose a more accurate radial bin83 84 # endif
Note:
See TracChangeset
for help on using the changeset viewer.
