IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 2, 2010, 7:06:18 PM (17 years ago)
Author:
watersc1
Message:

new burntool code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20091201/extsrc/gpcsw/gpcsrc/fits/burntool/trailfit.c

    r25299 r26764  
    137137   box->xfit = (int *)calloc(xe-xs+1, sizeof(int));
    138138   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   }
    139143/* Some defaults */
    140144   box->slope = 0.0;
     
    226230/* FIXME: sanity check fits */
    227231   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);
    228236      box->slope = slope;
    229       box->nfit = 0;
     237      if(trial > 2*rms) box->nfit = -box->nfit;
     238      else box->nfit = 0;
    230239      box->fiterr = FIT_SLOPE_ERROR;
    231240      return(-1);
     
    268277/* FIXME: what's a really good criterion for negligible fit? */
    269278/* 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) {
    271283
    272284/* Ascertain the starting point of where the fit is good */
Note: See TracChangeset for help on using the changeset viewer.