Changeset 32347 for trunk/psModules/src/objects/models/pmModel_PS1_V1.c
- Timestamp:
- Sep 6, 2011, 1:02:53 PM (15 years ago)
- Location:
- trunk/psModules/src/objects
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
models/pmModel_PS1_V1.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects
- Property svn:ignore
-
old new 5 5 *.la 6 6 *.lo 7 pmSourceIO_CMF_PS1_V1.c 8 pmSourceIO_CMF_PS1_V2.c 9 pmSourceIO_CMF_PS1_V3.c
-
- Property svn:ignore
-
trunk/psModules/src/objects/models/pmModel_PS1_V1.c
r31670 r32347 14 14 * PM_PAR_XPOS 2 - X center of object 15 15 * PM_PAR_YPOS 3 - Y center of object 16 * PM_PAR_SXX 4 - X^2 term of elliptical contour ( sqrt(2) / SigmaX)17 * PM_PAR_SYY 5 - Y^2 term of elliptical contour ( sqrt(2) / SigmaY)16 * PM_PAR_SXX 4 - X^2 term of elliptical contour (SigmaX / sqrt(2)) 17 * PM_PAR_SYY 5 - Y^2 term of elliptical contour (SigmaY / sqrt(2)) 18 18 * PM_PAR_SXY 6 - X*Y term of elliptical contour 19 19 * PM_PAR_7 7 - amplitude of the linear component (k) … … 239 239 } 240 240 241 // integrate the model to get the full flux 241 242 psF64 PM_MODEL_FLUX (const psVector *params) 242 243 { … … 250 251 shape.sxy = PAR[PM_PAR_SXY]; 251 252 252 // Area is equivalent to 2 pi sigma^2253 253 psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0); 254 psF64 Area = 2.0 * M_PI * axes.major * axes.minor;255 256 // the area needs to be multiplied by the integral of f(z)254 float AspectRatio = axes.minor / axes.major; 255 256 // flux = 2 \pi \int f(r) r dr 257 257 norm = 0.0; 258 258 259 # define DZ 0.25 260 261 float f0 = 1.0; 259 # define DR 0.25 260 261 // f = f(r) * r 262 float f0 = 0.0; 262 263 float f1, f2; 263 for (z = DZ; z < 150; z += DZ) { 264 f1 = 1.0 / (1 + PAR[PM_PAR_7]*z + pow(z, ALPHA)); 265 z += DZ; 266 f2 = 1.0 / (1 + PAR[PM_PAR_7]*z + pow(z, ALPHA)); 264 for (float r = DR; r < 150; r += DR) { 265 z = 0.5 * PS_SQR(r / axes.major); 266 f1 = r / (1 + PAR[PM_PAR_7]*z + pow(z, ALPHA)); 267 r += DR; 268 z = 0.5 * PS_SQR(r / axes.major); 269 f2 = r / (1 + PAR[PM_PAR_7]*z + pow(z, ALPHA)); 267 270 norm += f0 + 4*f1 + f2; 268 271 f0 = f2; 269 272 } 270 norm *= D Z/ 3.0;271 272 psF64 Flux = PAR[PM_PAR_I0] * Area * norm;273 norm *= DR / 3.0; 274 275 psF64 Flux = PAR[PM_PAR_I0] * norm * 2.0 * M_PI * AspectRatio; 273 276 274 277 return(Flux);
Note:
See TracChangeset
for help on using the changeset viewer.
