Skip to content
Merged
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
5b1db39
WIP: reference file array broadcasting
tapastro Aug 20, 2025
1c20343
WIP: labelmapperarray requires only 2 inputs
tapastro Aug 29, 2025
1fb3c74
use mapping for labelmapperarray from nden
tapastro Sep 2, 2025
51a3f2d
WIP but usable state
tapastro Sep 8, 2025
1c8841c
clean up DHS PR from SOSS details
tapastro Sep 15, 2025
1707e90
small bugfixes
tapastro Sep 16, 2025
984c40c
calc shift using subarray posn
tapastro Sep 24, 2025
40599ff
fix rebase issues
tapastro Feb 11, 2026
f5498c7
more rebase issues
tapastro Feb 11, 2026
5b09dcb
baseline functionality
tapastro Feb 17, 2026
819e5f4
minor code cleanup
tapastro Feb 17, 2026
2a7125d
fix bad test
tapastro Feb 18, 2026
0ece877
update tests to accommodate TSO MultiSlitModel
tapastro Feb 18, 2026
429fa83
rebase failures
tapastro Feb 18, 2026
450f293
missed rebase failure
tapastro Feb 18, 2026
feac120
update RTs
tapastro Feb 23, 2026
e2b2b97
uncomment some lines for mr qube
tapastro Feb 24, 2026
c021155
fix mockmodel usage
tapastro Feb 24, 2026
3ff1512
use CRDS-fetched DHS dark
tapastro Feb 25, 2026
4d74aeb
reorganize usage of regions ref model
tapastro Feb 27, 2026
34cb2ff
drop dnu refpix
tapastro Mar 10, 2026
3b53f6c
some review cleanup
tapastro Mar 13, 2026
c526583
Merge branch 'main' into jp-3955-dhs-wcs
tapastro Mar 13, 2026
ea32376
reduce code dup in x2d
tapastro Mar 13, 2026
ec6dcd6
remove copy
tapastro Mar 13, 2026
d990b16
update x1d to populate int_times
tapastro Mar 15, 2026
749ab90
commit storing code that assumes grism wcs is functional (it isnt)
tapastro Mar 16, 2026
c614b0b
force behavior for subarray xfrm shift
tapastro Mar 16, 2026
1ed0bff
update test coverage
tapastro Mar 16, 2026
77e545e
First attempt at simple roundtrip test
emolter Mar 16, 2026
675b157
Merge branch 'jp-3955-dhs-wcs' of https://github.com/tapastro/jwst in…
emolter Mar 16, 2026
7dcddf5
Improvements to test
emolter Mar 16, 2026
4e57971
Don't attempt to pass inverse models through specwcs
emolter Mar 16, 2026
fe3cbcf
Mock the regions file
emolter Mar 17, 2026
dcc7f1f
Expand tests to run whole step and do nrcalong
emolter Mar 17, 2026
9fbe452
Refactor assign_wcs.nircam to share common code across grism modes
emolter Mar 18, 2026
a2e196e
Add basic unit tests for extract_2d
emolter Mar 18, 2026
e9b1859
Fix failures in non-DHS TSO data
emolter Mar 18, 2026
c2ae9a2
Split DHS into its own method
emolter Mar 18, 2026
9bbd1c6
Minor refactor for readability
emolter Mar 19, 2026
017c7e3
Merge pull request #1 from emolter/JP-3955
tapastro Mar 19, 2026
d2cc7c1
Add unit test for repeat_stripe=0 mode
emolter Mar 19, 2026
e668fb1
Grammar
emolter Mar 19, 2026
29e2a7d
Merge branch 'jp-3955-dhs-squash' of https://github.com/tapastro/jwst…
emolter Mar 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions jwst/lib/tests/test_reffile_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,61 @@ def test_generate_stripe():
assert stripe4_array[83, 1024] == 972 # nreads1 + nskips1, stripe 3


def test_generate_stripe_repeat_stripe_zero():
"""
Test generate_stripe_array in DHS mode when repeat_stripe=0.

When repeat_stripe=0 the read head does not reset between stripes.
Successive nreads2 blocks are separated by nskips2 rows advancing
monotonically through the detector.
"""
# Array where every pixel value equals its row index.
test_array = (np.ones((2048, 2048), dtype=int) * np.arange(2048)).T

xsize_sci = 2048
nreads1, nreads2 = 1, 20
nskips1, nskips2 = 10, 5
repeat_stripe = 0
interleave_reads1 = 0
superstripe_step, num_superstripe = 0, 0
fastaxis, slowaxis, ngroups = -1, 2, 1
# Detector read sequence: row 0 (nreads1), skip 10 (nskips1),
# rows 11-30 (nreads2), skip 5 (nskips2), rows 36-55 (nreads2),
# skip 5 (nskips2), rows 61-80 (nreads2)
# yielding 61 non-skip output rows total.
ysize_sci = nreads1 + nreads2 * 3

stripe_params = (
xsize_sci,
ysize_sci,
nreads1,
nreads2,
nskips1,
nskips2,
repeat_stripe,
interleave_reads1,
superstripe_step,
num_superstripe,
fastaxis,
slowaxis,
ngroups,
)
test_array_sciframe = science_detector_frame_transform(test_array, *stripe_params[-3:-1])
stripe_array = generate_stripe_array(test_array_sciframe, *stripe_params)

assert stripe_array.shape == (ysize_sci, xsize_sci)
# Output row 0: first nreads1 read from detector row 0.
assert stripe_array[0, 1024] == 0
# Output row 1: start of first nreads2 block; head advanced by nreads1 + nskips1.
assert stripe_array[1, 1024] == nreads1 + nskips1
# Output row nreads1 + nreads2: start of second nreads2 block;
# head advanced by an additional nreads2 + nskips2.
assert stripe_array[nreads1 + nreads2, 1024] == nreads1 + nskips1 + nreads2 + nskips2
# Output row nreads1 + 2*nreads2: start of third nreads2 block;
# head advanced by yet another nreads2 + nskips2.
assert stripe_array[nreads1 + 2 * nreads2, 1024] == nreads1 + nskips1 + 2 * (nreads2 + nskips2)


def test_multistripe_subarray_model():
mock_rn = ReadnoiseModel(data=(np.ones((2048, 2048), dtype=int) * np.arange(2048)).T)
mock_rn.meta.instrument.name = "NIRCAM"
Expand Down
Loading