Skip to content

Commit

Permalink
Merge pull request #851 from mperrin/ifu_modeswitch_fix
Browse files Browse the repository at this point in the history
minor bug fix to IFU mode after #770
  • Loading branch information
obi-wan76 authored May 19, 2024
2 parents 91f8f9c + 92dda9d commit 4581dec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions webbpsf/tests/test_nirspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def test_mode_switch():
nrs.mode = 'IFU'
assert 'IFU' in nrs.aperturename
assert nrs.band == 'PRISM/CLEAR'
assert nrs.image_mask is None

# check switch of which IFU band
nrs.disperser = 'G395H'
Expand Down
7 changes: 3 additions & 4 deletions webbpsf/webbpsf_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2105,8 +2105,6 @@ def filter(self, value):

def _validate_config(self, **kwargs):
"""Validate instrument config for MIRI"""
if self.filter.startswith('MRS-IFU'):
raise NotImplementedError('The MIRI MRS is not yet implemented.')
return super(MIRI, self)._validate_config(**kwargs)

def _addAdditionalOptics(self, optsys, oversample=2):
Expand Down Expand Up @@ -3142,8 +3140,6 @@ def __init__(self):
self._si_wfe_class = optics.NIRSpecFieldDependentAberration # note we end up adding 2 instances of this.

def _validate_config(self, **kwargs):
if self.filter.startswith('IFU'):
raise NotImplementedError('The NIRSpec IFU is not yet implemented.')
return super(NIRSpec, self)._validate_config(**kwargs)

def _addAdditionalOptics(self, optsys, oversample=2):
Expand Down Expand Up @@ -3259,6 +3255,9 @@ def aperturename(self, value):
if self._disperser is None:
self.disperser = 'PRISM' # Set some default spectral mode
self.filter = 'CLEAR'
if self.image_mask not in ['IFU', None]:
_log.info("The currently-selected image mask (slit) is not compatible with IFU mode. Setting image_mask=None")
self.image_mask = None
else:
self._mode = 'imaging' # More to implement here later!

Expand Down

0 comments on commit 4581dec

Please sign in to comment.