Skip to content

Commit

Permalink
Merge branch 'master' into jp3593
Browse files Browse the repository at this point in the history
  • Loading branch information
penaguerrero authored Jun 24, 2024
2 parents 1207d58 + aea285f commit 8f90a84
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 5 deletions.
12 changes: 12 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ associations
- Exclude NIRISS SOSS data taken with uncalibrated filter F277W from spec2 and
tso3 associations. [#8549]

background_subtraction
----------------------

- Clarified MIRI MRS default/optional background subtraction steps in the
documentation pages. [#8582]

badpix_selfcal
--------------

Expand Down Expand Up @@ -246,6 +252,9 @@ photom
all slits containing point sources are now handled consistently,
whether they are marked primary or not. [#8467]

- Added a hook to bypass the ``photom`` step when the ``extract_1d`` step
was bypassed for non-TSO NIRISS SOSS exposures. [#8575]

pipeline
--------

Expand All @@ -269,6 +278,9 @@ pipeline
FS slits. Final output products (``cal``, ``s2d``, ``x1d``) contain the
combined products. [#8467]

- Added a hook to skip ``photom`` step when the ``extract_1d`` step was skipped
for NIRISS SOSS data [#8575].

pixel_replace
-------------

Expand Down
4 changes: 2 additions & 2 deletions docs/jwst/background_subtraction/main.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ when the available data support multiple methods.
+--------------------------+---------------+-------------------+-----------------------------+
| **MIRI MRS:** | | | |
+--------------------------+---------------+-------------------+-----------------------------+
| Dedicated background | Default | Optional | |
| Dedicated background | Optional | Default | |
+--------------------------+---------------+-------------------+-----------------------------+
| Nodded point source | Default | Optional | |
| Nodded point source | Optional | Optional | |
+--------------------------+---------------+-------------------+-----------------------------+
| User supplied | | Default | |
+--------------------------+---------------+-------------------+-----------------------------+
Expand Down
3 changes: 3 additions & 0 deletions jwst/photom/photom.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,9 @@ def calc_niriss(self, ftab):
raise DataModelTypeError(f"Unexpected input data model type for NIRISS: {self.input.__class__.__name__}")

elif self.exptype in ['NIS_SOSS']:
if isinstance(self.input, datamodels.ImageModel):
raise DataModelTypeError(f"Unexpected input data model type for NIRISS: {self.input.__class__.__name__}")

for spec in self.input.spec:
self.specnum += 1
self.order = spec.spectral_order
Expand Down
15 changes: 15 additions & 0 deletions jwst/photom/tests/test_photom.py
Original file line number Diff line number Diff line change
Expand Up @@ -1357,6 +1357,21 @@ def test_expected_failure_niriss_cubemodel():
ds.calc_niriss(None)


def test_expected_failure_soss_imagemodel():
"""
Test that passing a CubeModel to calc_niriss raises an exception
This occurs when extract_1d step is skipped, e.g. for NIRISS SOSS data
in FULL subarray.
"""

input_model = create_input('NIRISS', 'NIS', 'NIS_SOSS',
filter='CLEAR', pupil='GR700XD')
ds = photom.DataSet(input_model)
ds.input = datamodels.ImageModel()
with pytest.raises(photom.DataModelTypeError):
ds.calc_niriss(None)


def test_miri_mrs():
"""Test calc_miri, MRS data"""

Expand Down
6 changes: 3 additions & 3 deletions jwst/pipeline/calwebb_spec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,11 +362,11 @@ def process_exposure_product(
x1d = self.extract_1d(x1d)

# Possible that no fit was possible - if so, skip photom
if x1d is not None:
if (x1d is None) or (x1d.meta.cal_step.extract_1d == "SKIPPED"):
self.log.warning("Extract_1d did not return a DataModel - skipping photom.")
else:
self.photom.save_results = self.save_results
x1d = self.photom(x1d)
else:
self.log.warning("Extract_1d did not return a DataModel - skipping photom.")
elif exp_type == 'NRS_MSASPEC':
# Special handling for MSA spectra, to handle mixed-in
# fixed slits separately
Expand Down

0 comments on commit 8f90a84

Please sign in to comment.