Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JP-1693: Fix extract_1d for SourceContainer with 1 slit #5439

Merged
merged 2 commits into from
Oct 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ datamodels
extract_1d
----------

- Fixed bug invovling the determination of source RA/Dec for resampled Slit
- Fixed bug involving the determination of source RA/Dec for resampled Slit
data. [#5353]

- Updated to use an EXTRACT1D reference file for NIRCam TSGRISM exposures;
Expand All @@ -52,6 +52,9 @@ extract_1d
background computation that was preventing background subtraction from
ever happening. [#5414]

- Fixed bug involving the processing of WFSS observations when there's only
one spectrum instance for a given source. [#5439]

flatfield
---------

Expand Down
7 changes: 6 additions & 1 deletion jwst/extract_1d/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -2730,7 +2730,12 @@ def do_extract1d(
# Handle inputs that contain one or more slit models
if was_source_model or isinstance(input_model, datamodels.MultiSlitModel):
if was_source_model: # SourceContainer has a single list of SlitModels
slits = input_model
if isinstance(input_model, datamodels.SlitModel):
# If input is a single SlitModel, as opposed to a list of SlitModels,
# put it into a list so that it's iterable later on
slits = [input_model]
else:
slits = input_model

# The subsequent work on data uses the individual SlitModels, but there are many places where meta
# attributes are retreived from input_model, so set this to allow that to work.
Expand Down