From 92dda9dc679939e2399ececbf22101ad73dfacd0 Mon Sep 17 00:00:00 2001 From: Marshall Perrin Date: Fri, 17 May 2024 11:52:15 -0400 Subject: [PATCH] minor fix to IFU mode; for NRS IFU, don't leave image_mask at 'MSA all open' --- webbpsf/tests/test_nirspec.py | 1 + webbpsf/webbpsf_core.py | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/webbpsf/tests/test_nirspec.py b/webbpsf/tests/test_nirspec.py index d79d948e..03684b64 100644 --- a/webbpsf/tests/test_nirspec.py +++ b/webbpsf/tests/test_nirspec.py @@ -55,6 +55,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 cfde6f17..e373a537 100644 --- a/webbpsf/webbpsf_core.py +++ b/webbpsf/webbpsf_core.py @@ -2115,8 +2115,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): @@ -3152,8 +3150,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): @@ -3269,6 +3265,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!