Skip to content

Commit

Permalink
JP-2603: Catch None return from SOSS F277W in Level3 (#6863)
Browse files Browse the repository at this point in the history
* Catch None return from SOSS F277W in Level3

* changelog

* [skip ci] forgot whitespace in changelog

Co-authored-by: Howard Bushouse <[email protected]>
  • Loading branch information
tapastro and hbushouse authored May 31, 2022
1 parent 527fc14 commit 3548187
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
1.5.3 (unreleased)
==================

pipeline
--------

- Add check to ensure SOSS `extract_1d` return is not None, to
avoid photom errors in Spec3Pipeline and Tso3Pipeline [#6863]

resample
--------

Expand Down
9 changes: 6 additions & 3 deletions jwst/pipeline/calwebb_spec3.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,13 @@ def process(self, input):
# instead run photom on the extract_1d results and save
# those instead.
self.extract_1d.save_results = False
self.photom.save_results = self.save_results
self.photom.suffix = 'x1d'
result = self.extract_1d(result)
result = self.photom(result)

# SOSS F277W may return None - don't bother with that.
if result is not None:
self.photom.save_results = self.save_results
self.photom.suffix = 'x1d'
result = self.photom(result)
else:
result = self.extract_1d(result)

Expand Down
22 changes: 12 additions & 10 deletions jwst/pipeline/calwebb_tso3.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,18 @@ def process(self, input):
self.log.info("Extracting 1-D spectra ...")
result = self.extract_1d(cube)

if input_exptype == 'NIS_SOSS':
# SOSS data have yet to be photometrically calibrated
# Calibrate 1D spectra here.
result = self.photom(result)

x1d_result.spec.extend(result.spec)

# perform white-light photometry on 1d extracted data
self.log.info("Performing white-light photometry ...")
phot_result_list.append(self.white_light(result))
# SOSS F277W may return None - don't bother with that
if result is not None:
if input_exptype == 'NIS_SOSS':
# SOSS data have yet to be photometrically calibrated
# Calibrate 1D spectra here.
result = self.photom(result)

x1d_result.spec.extend(result.spec)

# perform white-light photometry on 1d extracted data
self.log.info("Performing white-light photometry ...")
phot_result_list.append(self.white_light(result))

# Update some metadata from the association
x1d_result.meta.asn.pool_name = input_models.meta.asn_table.asn_pool
Expand Down

0 comments on commit 3548187

Please sign in to comment.