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-2173: Add wfss_contam step to calwebb_spec2 #6207

Merged
merged 3 commits into from
Jul 8, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ outlier_detection
The bug in the implimentation of the bilinear interpolator in the ``drizzle``
package is now fixed. [#6146]

pipeline
--------

- Added wfss_contam step to `calwebb_spec2` pipeline flow for WFSS modes [#6207]

wfss_contam
-----------

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def setup(app):
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('../'))
# sys.path.insert(0, os.path.abspath('../'))
sys.path.insert(0, os.path.abspath('jwst/'))
sys.path.insert(0, os.path.abspath('exts/'))

Expand Down
8 changes: 8 additions & 0 deletions jwst/pipeline/calwebb_spec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from ..srctype import srctype_step
from ..straylight import straylight_step
from ..wavecorr import wavecorr_step
from ..wfss_contam import wfss_contam_step

__all__ = ['Spec2Pipeline']

Expand Down Expand Up @@ -70,6 +71,7 @@ class Spec2Pipeline(Pipeline):
'fringe': fringe_step.FringeStep,
'pathloss': pathloss_step.PathLossStep,
'barshadow': barshadow_step.BarShadowStep,
'wfss_contam': wfss_contam_step.WfssContamStep,
'photom': photom_step.PhotomStep,
'resample_spec': resample_spec_step.ResampleSpecStep,
'cube_build': cube_build_step.CubeBuildStep,
Expand Down Expand Up @@ -367,6 +369,11 @@ def _step_verification(self, exp_type, members_by_type, multi_int):
self.log.debug('Science data does not allow master background correction. Skipping "master_background".')
self.master_background.skip = True

# Apply WFSS contamination correction only to WFSS exposures
if not self.wfss_contam.skip and exp_type not in WFSS_TYPES:
self.log.debug('Science data does not allow WFSS contamination correction. Skipping "wfss_contam".')
self.wfss_contam.skip = True

def _process_grism(self, data):
"""WFSS & Grism processing

Expand All @@ -379,6 +386,7 @@ def _process_grism(self, data):
calibrated = self.fringe(calibrated)
calibrated = self.pathloss(calibrated)
calibrated = self.barshadow(calibrated)
calibrated = self.wfss_contam(calibrated)
calibrated = self.photom(calibrated)

return calibrated
Expand Down
1 change: 1 addition & 0 deletions jwst/wfss_contam/wfss_contam_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class WfssContamStep(Step):
save_simulated_image = boolean(default=False) # Save full-frame simulated image
save_contam_images = boolean(default=False) # Save source contam estimates
maximum_cores = option('none', 'quarter', 'half', 'all', default='none')
skip = boolean(default=True)
"""

reference_file_types = ['photom', 'wavelengthrange']
Expand Down