diff --git a/src/stcal/ramp_fitting/src/slope_fitter.c b/src/stcal/ramp_fitting/src/slope_fitter.c index eb64fe3cc..ecbd28c38 100644 --- a/src/stcal/ramp_fitting/src/slope_fitter.c +++ b/src/stcal/ramp_fitting/src/slope_fitter.c @@ -2058,6 +2058,7 @@ ols_slope_fit_pixels( ret = 1; goto END; } + // goto END; /* XXX REMOVED THIS!!! */ } } @@ -2217,6 +2218,7 @@ ramp_fit_pixel( ret = 1; goto END; } + // dbg_ols_print("(%ld, %ld) median rate = %f\n", pr->row, pr->col, pr->median_rate); /* Clean up any thing from the last pixel ramp */ clean_segment_list(pr->nints, pr->segs); @@ -2328,15 +2330,15 @@ ramp_fit_pixel_integration_fit_slope( /* Fit slope to each segment. */ for (current = pr->segs[integ].head; current; current = current->flink) { segcnt++; +#if 0 + dbg_ols_print(" *** [%ld] (%ld, %ld) Seg: %d, Length: %ld, Start: %ld, End: %ld\n", + integ, pr->row, pr->col, segcnt, current->length, current->start, current->end); +#endif ret = ramp_fit_pixel_integration_fit_slope_seg( current, rd, pr, current, integ, segcnt); if (-1 == ret) { continue; } -#if 0 - dbg_ols_print(" *** [%ld] (%ld, %ld) Seg: %d, Length: %ld, Start: %ld, End: %ld\n", - integ, pr->row, pr->col, segcnt, current->length, current->start, current->end); -#endif invvar_r += (1. / current->var_r); if (pr->median_rate > 0.) { @@ -2394,17 +2396,17 @@ ramp_fit_pixel_integration_fit_slope_seg( { // dbg_ols_print("[%ld] segnum = %d, length = %ld\n", integ, segnum, current->length); if (1 == current->length) { - //dbg_ols_print("(%ld, %ld) Segment %d has length 1\n", pr->row, pr->col, segnum); + // dbg_ols_print("(%ld, %ld) Segment %d has length 1\n", pr->row, pr->col, segnum); rd->special1++; return ramp_fit_pixel_integration_fit_slope_seg_len1( rd, pr, current, integ, segnum); } else if (2 == current->length) { - //dbg_ols_print("(%ld, %ld) Segment %d has length 2\n", pr->row, pr->col, segnum); + // dbg_ols_print("(%ld, %ld) Segment %d has length 2\n", pr->row, pr->col, segnum); rd->special2++; return ramp_fit_pixel_integration_fit_slope_seg_len2( rd, pr, current, integ, segnum); } - //dbg_ols_print("(%ld, %ld) Segment %d has length >2\n", pr->row, pr->col, segnum); + // dbg_ols_print("(%ld, %ld) Segment %d has length >2\n", pr->row, pr->col, segnum); return ramp_fit_pixel_integration_fit_slope_seg_default( rd, pr, current, integ, segnum); @@ -2783,7 +2785,6 @@ segment_snr( { npy_intp idx_s, idx_e; float data, num, den, S, start, end; - //char * msg = NULL; idx_s = get_ramp_index(rd, integ, seg->start); idx_e = idx_s + seg->length - 1; @@ -2792,17 +2793,8 @@ segment_snr( data = end - start; den = pr->rnoise * pr->rnoise + data * pr->gain; - if (den < 0.) { - /* XXX - * Not sure if this exception should be here. - * If not exception could set snr to -1. as an - * indication of failure. - */ - // msg = "SNR denominator is less than or equal to zero"; - //PyErr_SetString(PyExc_ValueError, msg); - //err_ols_print("(%ld, %ld) %s\n", pr->row, pr->col, msg); - *snr = -1.; - return 1; + if (0.0 == den) { + *snr = 0.; } else { num = data * pr->gain; S = num / sqrt(den);