Skip to content

Commit

Permalink
JP-3223: Extract_2d 'slit_name' parameter fails for NRS_MSASPEC slits (
Browse files Browse the repository at this point in the history
…#8272)

Co-authored-by: Howard Bushouse <[email protected]>
  • Loading branch information
penaguerrero and hbushouse authored Feb 15, 2024
1 parent d63fb5a commit 8f723b7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
12 changes: 8 additions & 4 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,14 @@ extract_1d

- Added a hook to bypass the ``extract_1d`` step for NIRISS SOSS data in
the FULL subarray with warning. [#8225]


extract_2d
----------

- Fixed crash when user provides an integer value for the `slit_name` argument,
by converting to a string. This change had been done in #8108, but it got undone
by another PR. [#8272]

outlier_detection
-----------------

Expand Down Expand Up @@ -219,9 +226,6 @@ extract_2d
be passed as a string, e.g. slit_name='67'. Included this
in the corresponding documentation. [#8081]

- Fixed potential future crash if MSA slitlet name is not an
integer. [#8108]

general
-------

Expand Down
7 changes: 2 additions & 5 deletions jwst/extract_2d/nirspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,9 @@ def nrs_extract2d(input_model, slit_name=None):
open_slits = slit2msa.slits[:]
if slit_name is not None:
new_open_slits = []
if not isinstance(slit_name, str):
slit_name = str(slit_name)
slit_name = str(slit_name)
for sub in open_slits:
if not isinstance(sub.name, str):
str_subnme = str(sub.name)
if str_subnme == slit_name:
if str(sub.name) == slit_name:
new_open_slits.append(sub)
break
if len(new_open_slits) == 0:
Expand Down

0 comments on commit 8f723b7

Please sign in to comment.