- Timestamp:
- Feb 2, 2010, 7:06:18 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20091201/extsrc/gpcsw/gpcsrc/fits/burntool/trailfit.c
r25299 r26764 137 137 box->xfit = (int *)calloc(xe-xs+1, sizeof(int)); 138 138 box->yfit = (int *)calloc(xe-xs+1, sizeof(int)); 139 if(box->zero == NULL || box->xfit == NULL || box->yfit == NULL) { 140 fprintf(stderr, "\rerror: failed to alloc box memory\n"); 141 exit(-679); 142 } 139 143 /* Some defaults */ 140 144 box->slope = 0.0; … … 226 230 /* FIXME: sanity check fits */ 227 231 if(slope >= FIT_MAX_SLOPE || slope < FIT_MIN_SLOPE) { 232 /* Check whether it's a significant trail (but with wrong slope) or just 233 * noise. In the former case negate box->nfit, 234 * in the latter case set it to zero. */ 235 linearrms(nfit, ybuf+y1, zbuf+y1, slope, zero, &trial); 228 236 box->slope = slope; 229 box->nfit = 0; 237 if(trial > 2*rms) box->nfit = -box->nfit; 238 else box->nfit = 0; 230 239 box->fiterr = FIT_SLOPE_ERROR; 231 240 return(-1); … … 268 277 /* FIXME: what's a really good criterion for negligible fit? */ 269 278 /* 100 pixels up fit is zsum or ~zsum/e */ 270 if(zsum > NEGLIGIBLE_TRAIL*rms) { 279 // if(zsum > NEGLIGIBLE_TRAIL*rms) { 280 if(zsum > NEGLIGIBLE_TRAIL*rms || 281 /* 100113: but also evaluate at the end of the fit for stubby trails */ 282 zbuf[y2]*zsum > NEGLIGIBLE_TRAIL*rms) { 271 283 272 284 /* Ascertain the starting point of where the fit is good */
Note:
See TracChangeset
for help on using the changeset viewer.
