- Timestamp:
- May 3, 2010, 8:41:49 AM (16 years ago)
- Location:
- branches/tap_branches
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
extsrc/gpcsw/gpcsrc/fits/burntool/trailfit.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/tap_branches
- Property svn:mergeinfo changed
-
branches/tap_branches/extsrc/gpcsw/gpcsrc/fits/burntool/trailfit.c
r25299 r27838 30 30 31 31 if(box->func != BURN_PWR && box->func != BURN_EXP) { 32 fprintf(stderr, "error: unimplemented fit function %d\n", box->func); 32 fprintf(stderr, "error: unimplemented fit function %d (err %d)\n", 33 box->func, box->fiterr); 33 34 return(-1); 34 35 } … … 137 138 box->xfit = (int *)calloc(xe-xs+1, sizeof(int)); 138 139 box->yfit = (int *)calloc(xe-xs+1, sizeof(int)); 140 if(box->zero == NULL || box->xfit == NULL || box->yfit == NULL) { 141 fprintf(stderr, "\rerror: failed to alloc box memory\n"); 142 exit(-679); 143 } 139 144 /* Some defaults */ 140 145 box->slope = 0.0; … … 229 234 box->nfit = 0; 230 235 box->fiterr = FIT_SLOPE_ERROR; 236 /* Check whether it's a significant trail (but with pos slope) or just noise */ 237 linearrms(nfit, ybuf+y1, zbuf+y1, slope, zero, &trial); 238 /* 100203 JT: bad idea: appears to be a bug in read/writing ABS(nfit) */ 239 // if(trial > 2*rms) box->nfit = -box->nfit; 240 if(trial > 2*rms) box->func = BURN_POSSLOPE; 231 241 return(-1); 232 242 } … … 268 278 /* FIXME: what's a really good criterion for negligible fit? */ 269 279 /* 100 pixels up fit is zsum or ~zsum/e */ 270 if(zsum > NEGLIGIBLE_TRAIL*rms) { 280 // if(zsum > NEGLIGIBLE_TRAIL*rms) { 281 if(zsum > NEGLIGIBLE_TRAIL*rms || 282 /* 100113: but also evaluate at the end of the fit for stubby trails */ 283 zbuf[y2]*zsum > NEGLIGIBLE_TRAIL*rms) { 271 284 272 285 /* Ascertain the starting point of where the fit is good */
Note:
See TracChangeset
for help on using the changeset viewer.
