Skip to content

Commit

Permalink
Raise exception when read_pattern does not match resultant data
Browse files Browse the repository at this point in the history
  • Loading branch information
stscieisenhamer committed Jul 12, 2023
1 parent 44a7109 commit 0832df9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/stcal/ramp_fitting/ols_cas22.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ def fit_ramps(np.ndarray[float, ndim=2] resultants,
The last resultant in this ramp.
"""
cdef int nresultant = len(ma_table)
if nresultant != resultants.shape[0]:
raise RuntimeError(f'MA table length {nresultant} does not match number of resultants {resultants.shape[0]}')

cdef np.ndarray[int] nn = np.array([x[1] for x in ma_table]).astype('i4')
# number of reads in each resultant
cdef np.ndarray[float] tbar = ma_table_to_tbar(
Expand Down

0 comments on commit 0832df9

Please sign in to comment.