diff --git a/webbpsf/tests/test_nirspec.py b/webbpsf/tests/test_nirspec.py index 6575839c..c3cf866e 100644 --- a/webbpsf/tests/test_nirspec.py +++ b/webbpsf/tests/test_nirspec.py @@ -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' diff --git a/webbpsf/webbpsf_core.py b/webbpsf/webbpsf_core.py index fd72191c..94c081c7 100644 --- a/webbpsf/webbpsf_core.py +++ b/webbpsf/webbpsf_core.py @@ -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): @@ -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): @@ -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!