Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
mwregan2 committed Mar 20, 2024
1 parent 087c18c commit b3af440
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/stcal/ramp_fitting/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ def calc_slope_vars(ramp_data, rn_sect, gain_sect, gdq_sect, group_time, max_seg
gdq_2d_nan[np.bitwise_and(gdq_2d, ramp_data.flags_saturated).astype(bool)] = np.nan

# Get lengths of semiramps for all pix [number_of_semiramps, number_of_pix]
segs = np.zeros_like(gdq_2d).astype(np.int16)
segs = np.zeros_like(gdq_2d).astype(np.uint16)

# Counter of semiramp for each pixel
sr_index = np.zeros(npix, dtype=np.uint16)
Expand Down
13 changes: 7 additions & 6 deletions tests/test_ramp_fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,23 @@

# -----------------------------------------------------------------------------
# Test Suite
def test_Poisson_variance():

def test_long_integration():
nints, nrows, ncols = 1, 1, 1
rnoise_val, gain_val = 1.0, 40.0
rnoise_val, gain_val = 0.1, 40.0
nframes, gtime, ftime = 1, 3, 3
tm = (nframes, gtime, ftime)
num_grps1 = 300
num_grps2 = 0
num_grps1 = 301
num_grps2 = 20
ramp_data, rnoise_array, gain_array = create_test_2seg_obs(rnoise_val, nints, num_grps1, num_grps2, ncols,
nrows, tm, rate=0, Poisson=True, grptime=gtime,
gain=gain_val, bias=0)
ramp_data.data[0, 280:, 0, 0] = 300 * 3
ramp_data.data[0, 291:, 0, 0] = 320 * 3
# Run ramp fit on RampData
buffsize, save_opt, algo, wt, ncores = 512, True, "OLS", "optimal", "none"
slopes, cube, optional, gls_dummy = ramp_fit_data(
ramp_data, buffsize, save_opt, rnoise_array, gain_array, algo, wt, ncores, dqflags)
np.testing.assert_almost_equal(slopes[0], .9, 2)
np.testing.assert_almost_equal(slopes[0], .65, 2)


def base_neg_med_rates_single_integration():
Expand Down

0 comments on commit b3af440

Please sign in to comment.