diff --git a/src/stcal/ramp_fitting/src/slope_fitter.c b/src/stcal/ramp_fitting/src/slope_fitter.c index a6e88a3d1..ab8f758cb 100644 --- a/src/stcal/ramp_fitting/src/slope_fitter.c +++ b/src/stcal/ramp_fitting/src/slope_fitter.c @@ -2852,12 +2852,7 @@ save_ramp_fit( #endif ptr = PyArray_GETPTR2(rate_prod->dq, pr->row, pr->col); -#if REAL_IS_DOUBLE - float_tmp = (float) pr->rate.dq; - memcpy(ptr, &(float_tmp), sizeof(float_tmp)); -#else memcpy(ptr, &(pr->rate.dq), sizeof(pr->rate.dq)); -#endif ptr = PyArray_GETPTR2(rate_prod->var_poisson, pr->row, pr->col); #if REAL_IS_DOUBLE @@ -2894,12 +2889,7 @@ save_ramp_fit( #endif ptr = PyArray_GETPTR3(rateint_prod->dq, integ, pr->row, pr->col); -#if REAL_IS_DOUBLE - float_tmp = (float) pr->rateints[integ].dq; - memcpy(ptr, &(float_tmp), sizeof(float_tmp)); -#else memcpy(ptr, &(pr->rateints[integ].dq), sizeof(pr->rateints[integ].dq)); -#endif ptr = PyArray_GETPTR3(rateint_prod->var_poisson, integ, pr->row, pr->col); #if REAL_IS_DOUBLE diff --git a/tests/test_ramp_fitting_cases.py b/tests/test_ramp_fitting_cases.py index 9d26a2983..d4a4f0311 100644 --- a/tests/test_ramp_fitting_cases.py +++ b/tests/test_ramp_fitting_cases.py @@ -239,6 +239,7 @@ def test_pix_4(): NOTE: There are small differences in the slope computation due to architectural differences of C and python. + Switching to doubles from floats in the C code fixed this problem. -------------------------------------------------------------------------------- *** [2627] Segment 2, Integration 0 *** @@ -282,7 +283,6 @@ def test_pix_4(): """ -@pytest.mark.skip(reason="C architecture gives small differences for slope.") def test_pix_5(): """ CASE B: segment has >2 groups, not at end of ramp. @@ -308,17 +308,12 @@ def test_pix_5(): ramp_data, bufsize, save_opt, rnoise, gain, algo, "optimal", ncores, dqflags ) - # XXX see the note above for the differences in C and python testing values. # Set truth values for PRIMARY results: - p_true_p = [1.076075, JUMP, 0.16134359, 0.00227273, 0.02375903] - # p_true_c = [1.076122522354126, JUMP, 0.16134359, 0.00227273, 0.02375903] # To be used with C - p_true = p_true_p + p_true = [1.076075, JUMP, 0.16134359, 0.00227273, 0.02375903] # Set truth values for OPTIONAL results: - oslope_p = [1.2799551, 1.0144024] - # oslope_c = [1.2799551, 1.0144479] # To be used with C o_true = [ - oslope_p, + [1.2799551, 1.0144024], [18.312422, 9.920552], [0.00606061, 0.00363636], [0.10691562, 0.03054732],