Changeset 20232
- Timestamp:
- Oct 17, 2008, 12:58:23 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/objects/pmGrowthCurve.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmGrowthCurve.c
r15165 r20232 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $8 * @date $Date: 200 7-10-03 00:42:40$7 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2008-10-17 22:58:23 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 46 46 } 47 47 48 # define NPTS 25 48 49 pmGrowthCurve *pmGrowthCurveAlloc (psF32 minRadius, psF32 maxRadius, psF32 refRadius) 49 50 { … … 52 53 psMemSetDeallocator(growth, (psFreeFunc) pmGrowthCurveFree); 53 54 54 // fractional pixel radii are not well defined; use integer steps 55 growth->radius = psVectorCreate (NULL, minRadius, maxRadius, 1.0, PS_TYPE_F32); 55 // set the scaling factor 56 float dR = log10(maxRadius / minRadius) / (float) NPTS; 57 float fR = pow (10.0, dR); 58 59 // Fractional pixel radii are not well defined; use integer pixel radii. Use 1 pixel steps 60 // until the scaling factor steps in intervals larger than 1 pixel 61 float Rlin = 1.0 / (fR - 1.0); 62 63 growth->radius = psVectorAllocEmpty (NPTS, PS_DATA_F32); 64 65 // there will be NPTS radii + a few extras 66 float radius = minRadius; 67 while (radius < Rlin) { 68 // fprintf (stderr, "r: %f\n", radius); 69 psVectorAppend (growth->radius, radius); 70 radius += 1.0; 71 } 72 while (radius < maxRadius) { 73 // fprintf (stderr, "r: %f\n", radius); 74 psVectorAppend (growth->radius, radius); 75 radius *= fR; 76 radius = (int) (radius + 0.5); 77 } 78 psVectorAppend (growth->radius, radius); 56 79 growth->apMag = psVectorAlloc (growth->radius->n, PS_TYPE_F32); 57 80
Note:
See TracChangeset
for help on using the changeset viewer.
