From 5466965d062d5bd63851d48628fe7dbe972cb136 Mon Sep 17 00:00:00 2001 From: Maria Pena-Guerrero Date: Wed, 20 Mar 2024 10:07:34 -0400 Subject: [PATCH 01/13] populating wave arr in s2d file --- jwst/resample/resample_spec_step.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/jwst/resample/resample_spec_step.py b/jwst/resample/resample_spec_step.py index 921edaee1c..b9ae4f207b 100755 --- a/jwst/resample/resample_spec_step.py +++ b/jwst/resample/resample_spec_step.py @@ -109,6 +109,14 @@ def process(self, input): result.meta.asn.table_name = input_models[0].meta.asn.table_name result.meta.asn.pool_name = input_models[0].meta.asn.pool_name + # carry over the result wavelength attribute + if model_is_msm: + for slit_idx, slit in enumerate(input_new.slits): + wl_array = slit.wavelength + result.slits[slit_idx].wavelength = wl_array + else: + result.wavelength = input.wavelength + return result def _process_multislit(self, input_models): From 561ab476996fea89e4ff1c401e599cba69b854a9 Mon Sep 17 00:00:00 2001 From: Maria Pena-Guerrero Date: Wed, 20 Mar 2024 15:37:09 -0400 Subject: [PATCH 02/13] bug fixes --- jwst/resample/resample_spec_step.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/jwst/resample/resample_spec_step.py b/jwst/resample/resample_spec_step.py index b9ae4f207b..9b4bc7bd84 100755 --- a/jwst/resample/resample_spec_step.py +++ b/jwst/resample/resample_spec_step.py @@ -7,6 +7,9 @@ from . import resample_spec, ResampleStep from ..exp_to_source import multislit_to_container from ..assign_wcs.util import update_s_region_spectral +from jwst.lib.wcs_utils import get_wavelengths + +import numpy as np # Force use of all DQ flagged data except for DO_NOT_USE and NON_SCIENCE GOOD_BITS = '~DO_NOT_USE+NON_SCIENCE' @@ -109,13 +112,13 @@ def process(self, input): result.meta.asn.table_name = input_models[0].meta.asn.table_name result.meta.asn.pool_name = input_models[0].meta.asn.pool_name - # carry over the result wavelength attribute - if model_is_msm: - for slit_idx, slit in enumerate(input_new.slits): - wl_array = slit.wavelength - result.slits[slit_idx].wavelength = wl_array - else: - result.wavelength = input.wavelength + # populate the result wavelength attribute + if isinstance(result, MultiSlitModel): + for slit_idx, slit in enumerate(result.slits): + result_wl = result.slits[slit_idx].wavelength + if len(result_wl) == 0 or np.all(result_wl == 0.0): + wl_array = get_wavelengths(result.slits[slit_idx]) + result.slits[slit_idx].wavelength = wl_array return result From e85b91f42d887b2eb8e8012dfb5c0d05038068df Mon Sep 17 00:00:00 2001 From: Maria Pena-Guerrero Date: Wed, 20 Mar 2024 15:41:09 -0400 Subject: [PATCH 03/13] added PR number --- CHANGES.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index b912f10ceb..0b11b86dc9 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -69,6 +69,8 @@ resample - Remove sleep in median combination added in 8305 as it did not address the issue in operation [#8419] +- Populated the wavelength attribute in the result model. [#8374] + residual_fringe --------------- From b942047f75806948bbbc1307415ee6840647f2a8 Mon Sep 17 00:00:00 2001 From: Maria Pena-Guerrero Date: Wed, 3 Apr 2024 11:26:58 -0400 Subject: [PATCH 04/13] adding the SlitModel case --- jwst/resample/resample_spec_step.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/jwst/resample/resample_spec_step.py b/jwst/resample/resample_spec_step.py index 9b4bc7bd84..7ece1acc12 100755 --- a/jwst/resample/resample_spec_step.py +++ b/jwst/resample/resample_spec_step.py @@ -112,13 +112,19 @@ def process(self, input): result.meta.asn.table_name = input_models[0].meta.asn.table_name result.meta.asn.pool_name = input_models[0].meta.asn.pool_name - # populate the result wavelength attribute + # populate the result wavelength attribute for MultiSlitModel if isinstance(result, MultiSlitModel): for slit_idx, slit in enumerate(result.slits): result_wl = result.slits[slit_idx].wavelength if len(result_wl) == 0 or np.all(result_wl == 0.0): wl_array = get_wavelengths(result.slits[slit_idx]) result.slits[slit_idx].wavelength = wl_array + else: + # populate the result wavelength attribute for SlitModel + result_wl = result.wavelength + if len(result_wl) == 0 or np.all(result_wl == 0.0): + wl_array = get_wavelengths(result) + result.wavelength = wl_array return result From e01c1d964c10f1a967efdf729b2a7fca88acadc9 Mon Sep 17 00:00:00 2001 From: Maria Pena-Guerrero Date: Wed, 3 Apr 2024 11:29:21 -0400 Subject: [PATCH 05/13] removing the condition and force to calculate wavs always --- jwst/resample/resample_spec_step.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/jwst/resample/resample_spec_step.py b/jwst/resample/resample_spec_step.py index 7ece1acc12..75007f5d4e 100755 --- a/jwst/resample/resample_spec_step.py +++ b/jwst/resample/resample_spec_step.py @@ -116,15 +116,13 @@ def process(self, input): if isinstance(result, MultiSlitModel): for slit_idx, slit in enumerate(result.slits): result_wl = result.slits[slit_idx].wavelength - if len(result_wl) == 0 or np.all(result_wl == 0.0): - wl_array = get_wavelengths(result.slits[slit_idx]) - result.slits[slit_idx].wavelength = wl_array + wl_array = get_wavelengths(result.slits[slit_idx]) + result.slits[slit_idx].wavelength = wl_array else: # populate the result wavelength attribute for SlitModel result_wl = result.wavelength - if len(result_wl) == 0 or np.all(result_wl == 0.0): - wl_array = get_wavelengths(result) - result.wavelength = wl_array + wl_array = get_wavelengths(result) + result.wavelength = wl_array return result From 7f2f33eec36e8aff6fff08d543ac509aefc932b7 Mon Sep 17 00:00:00 2001 From: Maria Pena-Guerrero Date: Wed, 3 Apr 2024 11:34:41 -0400 Subject: [PATCH 06/13] removed unnecessary lines --- jwst/resample/resample_spec_step.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/jwst/resample/resample_spec_step.py b/jwst/resample/resample_spec_step.py index 75007f5d4e..689c5b0453 100755 --- a/jwst/resample/resample_spec_step.py +++ b/jwst/resample/resample_spec_step.py @@ -115,12 +115,10 @@ def process(self, input): # populate the result wavelength attribute for MultiSlitModel if isinstance(result, MultiSlitModel): for slit_idx, slit in enumerate(result.slits): - result_wl = result.slits[slit_idx].wavelength wl_array = get_wavelengths(result.slits[slit_idx]) result.slits[slit_idx].wavelength = wl_array else: # populate the result wavelength attribute for SlitModel - result_wl = result.wavelength wl_array = get_wavelengths(result) result.wavelength = wl_array From 4cefa5b4fb0f28d7f4166dec0b81d828225fb36f Mon Sep 17 00:00:00 2001 From: Maria Pena-Guerrero Date: Wed, 3 Apr 2024 11:42:35 -0400 Subject: [PATCH 07/13] removed unnecessary lines --- jwst/resample/resample_spec_step.py | 1 - 1 file changed, 1 deletion(-) diff --git a/jwst/resample/resample_spec_step.py b/jwst/resample/resample_spec_step.py index 689c5b0453..cf00b31692 100755 --- a/jwst/resample/resample_spec_step.py +++ b/jwst/resample/resample_spec_step.py @@ -9,7 +9,6 @@ from ..assign_wcs.util import update_s_region_spectral from jwst.lib.wcs_utils import get_wavelengths -import numpy as np # Force use of all DQ flagged data except for DO_NOT_USE and NON_SCIENCE GOOD_BITS = '~DO_NOT_USE+NON_SCIENCE' From 1e3a6ddd6ba88073ec2f820258f3296be4b75175 Mon Sep 17 00:00:00 2001 From: Maria Pena-Guerrero Date: Thu, 18 Apr 2024 11:08:56 -0400 Subject: [PATCH 08/13] added reg tests --- jwst/regtest/test_miri_lrs_slit_spec3.py | 22 ++++++++++++++++++++++ jwst/regtest/test_nirspec_fs_spec3.py | 19 +++++++++++++++++++ jwst/regtest/test_nirspec_mos_spec3.py | 12 ++++++++++++ 3 files changed, 53 insertions(+) diff --git a/jwst/regtest/test_miri_lrs_slit_spec3.py b/jwst/regtest/test_miri_lrs_slit_spec3.py index 9ea82fb64a..d485c9b073 100644 --- a/jwst/regtest/test_miri_lrs_slit_spec3.py +++ b/jwst/regtest/test_miri_lrs_slit_spec3.py @@ -1,6 +1,8 @@ """ Test of the spec3 pipeline using MIRI LRS fixed-slit exposures. This takes an association and generates the level 3 products.""" import pytest +import numpy as np +from gwcs import wcstools import asdf from astropy.io.fits.diff import FITSDiff @@ -76,3 +78,23 @@ def test_miri_lrs_slit_spec3(run_pipeline, rtdata_module, fitsdiff_default_kwarg # Compare the results diff = FITSDiff(rtdata.output, rtdata.truth, **fitsdiff_default_kwargs) assert diff.identical, diff.report() + + if "s2d" in output: + # Compare the calculated wavelengths + tolerance = 1e-03 + dmt = datamodels.open(rtdata.truth) + dmr = datamodels.open(rtdata.output) + if isinstance(dmt, datamodels.MultiSlitModel): + for slit_idx, slit in enumerate(dmt.slits): + w = slit.meta.wcs + x, y = wcstools.grid_from_bounding_box(w.bounding_box, step=(1, 1), center=True) + _, _, wave = w(x, y) + wlr = dmr.slits[slit_idx].wavelength + assert np.all(np.isclose(wave, wlr, atol=tolerance)) + else: + w = dmt.meta.wcs + x, y = wcstools.grid_from_bounding_box(w.bounding_box, step=(1, 1), center=True) + _, _, wave = w(x, y) + wlr = dmr.wavelength + assert np.all(np.isclose(wave, wlr, atol=tolerance)) + diff --git a/jwst/regtest/test_nirspec_fs_spec3.py b/jwst/regtest/test_nirspec_fs_spec3.py index 10e205e870..54c101ad06 100644 --- a/jwst/regtest/test_nirspec_fs_spec3.py +++ b/jwst/regtest/test_nirspec_fs_spec3.py @@ -2,6 +2,7 @@ import pytest from jwst.stpipe import Step +from stdatamodels.jwst import datamodels @pytest.fixture(scope="module") @@ -42,3 +43,21 @@ def test_nirspec_fs_spec3(run_pipeline, rtdata_module, fitsdiff_default_kwargs, # Compare the results diff = FITSDiff(rtdata.output, rtdata.truth, **fitsdiff_default_kwargs) assert diff.identical, diff.report() + + if "s2d" in output: + # Compare the calculated wavelengths + tolerance = 1e-03 + dmt = datamodels.open(rtdata.truth) + dmr = datamodels.open(rtdata.output) + if isinstance(dmt, datamodels.MultiSlitModel): + w = slit.meta.wcs + x, y = wcstools.grid_from_bounding_box(w.bounding_box, step=(1, 1), center=True) + _, _, wave = w(x, y) + wlr = dmr.slits[slit_idx].wavelength + assert np.all(np.isclose(wave, wlr, atol=tolerance)) + else: + w = dmt.meta.wcs + x, y = wcstools.grid_from_bounding_box(w.bounding_box, step=(1, 1), center=True) + _, _, wave = w(x, y) + wlr = dmr.wavelength + assert np.all(np.isclose(wave, wlr, atol=tolerance)) diff --git a/jwst/regtest/test_nirspec_mos_spec3.py b/jwst/regtest/test_nirspec_mos_spec3.py index 59d9049837..0ac2e37897 100644 --- a/jwst/regtest/test_nirspec_mos_spec3.py +++ b/jwst/regtest/test_nirspec_mos_spec3.py @@ -2,6 +2,7 @@ from astropy.io.fits.diff import FITSDiff from jwst.stpipe import Step +from stdatamodels.jwst import datamodels @pytest.fixture(scope="module") @@ -36,3 +37,14 @@ def test_nirspec_mos_spec3(run_pipeline, suffix, source_id, fitsdiff_default_kwa diff = FITSDiff(rtdata.output, rtdata.truth, **fitsdiff_default_kwargs) assert diff.identical, diff.report() + + if "s2d" in output: + # Compare the calculated wavelengths + dmt = datamodels.open(rtdata.truth) + dmr = datamodels.open(rtdata.output) + for slit_idx, slit in enumerate(dmt.slits): + w = slit.meta.wcs + x, y = wcstools.grid_from_bounding_box(w.bounding_box, step=(1, 1), center=True) + _, _, wave = w(x, y) + wlr = dmr.slits[slit_idx].wavelength + assert np.all(np.isclose(wave, wlr, atol=1e-03)) From cce3baa89ffe174ded6ab2993e10f035e3dbec89 Mon Sep 17 00:00:00 2001 From: Maria Pena-Guerrero Date: Thu, 18 Apr 2024 12:54:50 -0400 Subject: [PATCH 09/13] added missing imports --- jwst/regtest/test_nirspec_fs_spec3.py | 2 ++ jwst/regtest/test_nirspec_mos_spec3.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/jwst/regtest/test_nirspec_fs_spec3.py b/jwst/regtest/test_nirspec_fs_spec3.py index 54c101ad06..5e4d789d1d 100644 --- a/jwst/regtest/test_nirspec_fs_spec3.py +++ b/jwst/regtest/test_nirspec_fs_spec3.py @@ -1,5 +1,7 @@ from astropy.io.fits.diff import FITSDiff import pytest +import numpy as np +from gwcs import wcstools from jwst.stpipe import Step from stdatamodels.jwst import datamodels diff --git a/jwst/regtest/test_nirspec_mos_spec3.py b/jwst/regtest/test_nirspec_mos_spec3.py index 0ac2e37897..b36e240390 100644 --- a/jwst/regtest/test_nirspec_mos_spec3.py +++ b/jwst/regtest/test_nirspec_mos_spec3.py @@ -1,5 +1,7 @@ import pytest from astropy.io.fits.diff import FITSDiff +import numpy as np +from gwcs import wcstools from jwst.stpipe import Step from stdatamodels.jwst import datamodels From 0fa6d7b71955634a87d5294fc5e19d33813fe1ea Mon Sep 17 00:00:00 2001 From: Maria Pena-Guerrero Date: Thu, 18 Apr 2024 13:23:24 -0400 Subject: [PATCH 10/13] fixed silly mistake --- jwst/regtest/test_nirspec_fs_spec3.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/jwst/regtest/test_nirspec_fs_spec3.py b/jwst/regtest/test_nirspec_fs_spec3.py index 5e4d789d1d..70f8fca19d 100644 --- a/jwst/regtest/test_nirspec_fs_spec3.py +++ b/jwst/regtest/test_nirspec_fs_spec3.py @@ -52,11 +52,12 @@ def test_nirspec_fs_spec3(run_pipeline, rtdata_module, fitsdiff_default_kwargs, dmt = datamodels.open(rtdata.truth) dmr = datamodels.open(rtdata.output) if isinstance(dmt, datamodels.MultiSlitModel): - w = slit.meta.wcs - x, y = wcstools.grid_from_bounding_box(w.bounding_box, step=(1, 1), center=True) - _, _, wave = w(x, y) - wlr = dmr.slits[slit_idx].wavelength - assert np.all(np.isclose(wave, wlr, atol=tolerance)) + for slit_idx, slit in enumerate(dmt.slits): + w = slit.meta.wcs + x, y = wcstools.grid_from_bounding_box(w.bounding_box, step=(1, 1), center=True) + _, _, wave = w(x, y) + wlr = dmr.slits[slit_idx].wavelength + assert np.all(np.isclose(wave, wlr, atol=tolerance)) else: w = dmt.meta.wcs x, y = wcstools.grid_from_bounding_box(w.bounding_box, step=(1, 1), center=True) From 9778eb02e493af69865d95e3242924a3ce834b12 Mon Sep 17 00:00:00 2001 From: Maria Pena-Guerrero Date: Mon, 29 Apr 2024 12:07:21 -0400 Subject: [PATCH 11/13] changed to look for names rather than assume slits are in the same order --- jwst/regtest/test_miri_lrs_slit_spec3.py | 4 +++- jwst/regtest/test_nirspec_fs_spec3.py | 4 +++- jwst/regtest/test_nirspec_mos_spec3.py | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/jwst/regtest/test_miri_lrs_slit_spec3.py b/jwst/regtest/test_miri_lrs_slit_spec3.py index d485c9b073..1c774d7c26 100644 --- a/jwst/regtest/test_miri_lrs_slit_spec3.py +++ b/jwst/regtest/test_miri_lrs_slit_spec3.py @@ -85,10 +85,12 @@ def test_miri_lrs_slit_spec3(run_pipeline, rtdata_module, fitsdiff_default_kwarg dmt = datamodels.open(rtdata.truth) dmr = datamodels.open(rtdata.output) if isinstance(dmt, datamodels.MultiSlitModel): - for slit_idx, slit in enumerate(dmt.slits): + names = [s.name for s in dmt.slits] + for name in names: w = slit.meta.wcs x, y = wcstools.grid_from_bounding_box(w.bounding_box, step=(1, 1), center=True) _, _, wave = w(x, y) + slit_idx = [(s.wcs, s.wavelength) for s in dmt.slits if s.name==name] wlr = dmr.slits[slit_idx].wavelength assert np.all(np.isclose(wave, wlr, atol=tolerance)) else: diff --git a/jwst/regtest/test_nirspec_fs_spec3.py b/jwst/regtest/test_nirspec_fs_spec3.py index 70f8fca19d..94323ae852 100644 --- a/jwst/regtest/test_nirspec_fs_spec3.py +++ b/jwst/regtest/test_nirspec_fs_spec3.py @@ -52,10 +52,12 @@ def test_nirspec_fs_spec3(run_pipeline, rtdata_module, fitsdiff_default_kwargs, dmt = datamodels.open(rtdata.truth) dmr = datamodels.open(rtdata.output) if isinstance(dmt, datamodels.MultiSlitModel): - for slit_idx, slit in enumerate(dmt.slits): + names = [s.name for s in dmt.slits] + for name in names: w = slit.meta.wcs x, y = wcstools.grid_from_bounding_box(w.bounding_box, step=(1, 1), center=True) _, _, wave = w(x, y) + slit_idx = [(s.wcs, s.wavelength) for s in dmt.slits if s.name==name] wlr = dmr.slits[slit_idx].wavelength assert np.all(np.isclose(wave, wlr, atol=tolerance)) else: diff --git a/jwst/regtest/test_nirspec_mos_spec3.py b/jwst/regtest/test_nirspec_mos_spec3.py index b36e240390..74f866ac42 100644 --- a/jwst/regtest/test_nirspec_mos_spec3.py +++ b/jwst/regtest/test_nirspec_mos_spec3.py @@ -44,9 +44,11 @@ def test_nirspec_mos_spec3(run_pipeline, suffix, source_id, fitsdiff_default_kwa # Compare the calculated wavelengths dmt = datamodels.open(rtdata.truth) dmr = datamodels.open(rtdata.output) - for slit_idx, slit in enumerate(dmt.slits): + names = [s.name for s in dmt.slits] + for name in names: w = slit.meta.wcs x, y = wcstools.grid_from_bounding_box(w.bounding_box, step=(1, 1), center=True) _, _, wave = w(x, y) + slit_idx = [(s.wcs, s.wavelength) for s in dmt.slits if s.name==name] wlr = dmr.slits[slit_idx].wavelength assert np.all(np.isclose(wave, wlr, atol=1e-03)) From 17a97724a2f9f329e4f4e17534e03972a4815755 Mon Sep 17 00:00:00 2001 From: Maria Pena-Guerrero Date: Tue, 30 Apr 2024 16:08:53 -0400 Subject: [PATCH 12/13] fixed silly bug --- jwst/regtest/test_miri_lrs_slit_spec3.py | 7 ++++--- jwst/regtest/test_nirspec_fs_spec3.py | 7 ++++--- jwst/regtest/test_nirspec_mos_spec3.py | 7 ++++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/jwst/regtest/test_miri_lrs_slit_spec3.py b/jwst/regtest/test_miri_lrs_slit_spec3.py index 1c774d7c26..513cc5740b 100644 --- a/jwst/regtest/test_miri_lrs_slit_spec3.py +++ b/jwst/regtest/test_miri_lrs_slit_spec3.py @@ -87,11 +87,12 @@ def test_miri_lrs_slit_spec3(run_pipeline, rtdata_module, fitsdiff_default_kwarg if isinstance(dmt, datamodels.MultiSlitModel): names = [s.name for s in dmt.slits] for name in names: - w = slit.meta.wcs + st_idx = [(s.wcs, s.wavelength) for s in dmt.slits if s.name==name] + w = dmt.slits[st_idx].meta.wcs x, y = wcstools.grid_from_bounding_box(w.bounding_box, step=(1, 1), center=True) _, _, wave = w(x, y) - slit_idx = [(s.wcs, s.wavelength) for s in dmt.slits if s.name==name] - wlr = dmr.slits[slit_idx].wavelength + sr_idx = [(s.wcs, s.wavelength) for s in dmr.slits if s.name==name] + wlr = dmr.slits[sr_idx].wavelength assert np.all(np.isclose(wave, wlr, atol=tolerance)) else: w = dmt.meta.wcs diff --git a/jwst/regtest/test_nirspec_fs_spec3.py b/jwst/regtest/test_nirspec_fs_spec3.py index 94323ae852..ac15e6a1fd 100644 --- a/jwst/regtest/test_nirspec_fs_spec3.py +++ b/jwst/regtest/test_nirspec_fs_spec3.py @@ -54,11 +54,12 @@ def test_nirspec_fs_spec3(run_pipeline, rtdata_module, fitsdiff_default_kwargs, if isinstance(dmt, datamodels.MultiSlitModel): names = [s.name for s in dmt.slits] for name in names: - w = slit.meta.wcs + st_idx = [(s.wcs, s.wavelength) for s in dmt.slits if s.name==name] + w = dmt.slits[st_idx].meta.wcs x, y = wcstools.grid_from_bounding_box(w.bounding_box, step=(1, 1), center=True) _, _, wave = w(x, y) - slit_idx = [(s.wcs, s.wavelength) for s in dmt.slits if s.name==name] - wlr = dmr.slits[slit_idx].wavelength + sr_idx = [(s.wcs, s.wavelength) for s in dmr.slits if s.name==name] + wlr = dmr.slits[sr_idx].wavelength assert np.all(np.isclose(wave, wlr, atol=tolerance)) else: w = dmt.meta.wcs diff --git a/jwst/regtest/test_nirspec_mos_spec3.py b/jwst/regtest/test_nirspec_mos_spec3.py index 74f866ac42..abe6384f1c 100644 --- a/jwst/regtest/test_nirspec_mos_spec3.py +++ b/jwst/regtest/test_nirspec_mos_spec3.py @@ -46,9 +46,10 @@ def test_nirspec_mos_spec3(run_pipeline, suffix, source_id, fitsdiff_default_kwa dmr = datamodels.open(rtdata.output) names = [s.name for s in dmt.slits] for name in names: - w = slit.meta.wcs + st_idx = [(s.wcs, s.wavelength) for s in dmt.slits if s.name==name] + w = dmt.slits[st_idx].meta.wcs x, y = wcstools.grid_from_bounding_box(w.bounding_box, step=(1, 1), center=True) _, _, wave = w(x, y) - slit_idx = [(s.wcs, s.wavelength) for s in dmt.slits if s.name==name] - wlr = dmr.slits[slit_idx].wavelength + sr_idx = [(s.wcs, s.wavelength) for s in dmr.slits if s.name==name] + wlr = dmr.slits[sr_idx].wavelength assert np.all(np.isclose(wave, wlr, atol=1e-03)) From 438a9d34ad1fc3f132e833b825470677d8417908 Mon Sep 17 00:00:00 2001 From: Howard Bushouse Date: Mon, 6 May 2024 11:54:05 -0400 Subject: [PATCH 13/13] Update CHANGES.rst --- CHANGES.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 064e576cda..7c45d080d1 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -92,7 +92,10 @@ resample - Remove sleep in median combination added in 8305 as it did not address the issue in operation [#8419] -- Populated the wavelength attribute in the result model. [#8374] +resample_spec +------------- + +- Populate the wavelength array in resampled `Slit` and `MultiSlit` models. [#8374] residual_fringe ---------------