- Timestamp:
- Aug 25, 2013, 12:08:56 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130711/psModules/src/objects/models/pmModel_DEV.c
r35966 r36021 63 63 # define PM_MODEL_SET_LIMITS pmModelSetLimits_DEV 64 64 65 // f = exp(-z^0.125) 65 // f = exp(-kappa*r^(1/index)) 66 // f = exp(-kappa*z^(0.5/index)) 67 // index = 4, 0.5/index = 0.125 66 68 # define ALPHA 0.125 67 // # define ALPHA 0.2568 69 69 70 // the model is a function of the pixel coordinate (pixcoord[0,1] = x,y) … … 86 87 static float *paramsMinUse = paramsMinLax; 87 88 static float *paramsMaxUse = paramsMaxLax; 88 static float betaUse[] = { 2, 3e6, 5, 5, 3.0, 3.0, 0.5 };89 static float betaUse[] = { 2, 3e6, 5, 5, 10.0, 10.0, 0.5 }; 89 90 90 91 static bool limitsApply = true; // Apply limits? … … 113 114 // r = sqrt(z) 114 115 float q = kappa*pow(z,ALPHA); 115 psF32 f0 = exp(-q); 116 117 psF32 f1 = PAR[PM_PAR_I0]*f0; 118 psF32 f = PAR[PM_PAR_SKY] + f1; 116 float f0 = exp(-q); 119 117 120 118 assert (isfinite(q)); 121 119 assert (isfinite(f0)); 122 assert (isfinite(f1)); 123 assert (isfinite(f)); 124 125 // only worry about the central 4 pixels at most 126 // If I use DELTA = 0.2, I'm way off for the total flux 127 // If I use DELTA = 0.02, I'm totally good (but I am under on the total flux for R = 30 by 0.2 mags -- aperture failure) 128 // For DELTA = 0.02 & Rmin/Rmaj = 0.25, I'm over flux by 0.15 mags (due to the central pixel) 129 psF32 radius = hypot(X, Y); 120 121 // only worry about the central pixels at most 122 float radius = hypot(X, Y); 130 123 if (radius <= 1.5) { 131 124 // Nsub ~ 10*index^2 + 1 … … 135 128 Nsub = PS_MAX (Nsub, 11); 136 129 f0 = pmModelCP_SersicSubpix (X, Y, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], 4.0, Nsub); 137 f1 = PAR[PM_PAR_I0]*f0;138 f = PAR[PM_PAR_SKY] + f1;139 130 } 131 132 float f1 = PAR[PM_PAR_I0]*f0; 133 float f = PAR[PM_PAR_SKY] + f1; 134 135 assert (isfinite(f1)); 136 assert (isfinite(f)); 140 137 141 138 if (deriv != NULL) { … … 304 301 // f = Io exp(-kappa*z^n) -> z^n = ln(Io/f) / kappa 305 302 psF64 zn = log(PAR[PM_PAR_I0] / flux) / kappa; 306 psF64 radius = axes.major * sqrt (2.0) *pow(zn, 0.5 / ALPHA);303 psF64 radius = axes.major * pow(zn, 0.5 / ALPHA); 307 304 308 305 psAssert (isfinite(radius), "fix this code: radius should not be nan for Io = %f, flux = %f, major = %f (%f, %f, %f)",
Note:
See TracChangeset
for help on using the changeset viewer.
