From 3ed89f45e59499e1e78bf2594bdc461004ea8b54 Mon Sep 17 00:00:00 2001 From: William Jamieson Date: Tue, 5 Nov 2024 16:23:43 -0500 Subject: [PATCH] Remove units from guidewindow (#415) --- changes/415.removal.rst | 1 + src/roman_datamodels/maker_utils/_datamodels.py | 11 +++-------- tests/test_models.py | 3 --- 3 files changed, 4 insertions(+), 11 deletions(-) create mode 100644 changes/415.removal.rst diff --git a/changes/415.removal.rst b/changes/415.removal.rst new file mode 100644 index 00000000..6c3fe64d --- /dev/null +++ b/changes/415.removal.rst @@ -0,0 +1 @@ +Remove units from Guidewindow related data models. diff --git a/src/roman_datamodels/maker_utils/_datamodels.py b/src/roman_datamodels/maker_utils/_datamodels.py index bf5c11fd..1170f39f 100644 --- a/src/roman_datamodels/maker_utils/_datamodels.py +++ b/src/roman_datamodels/maker_utils/_datamodels.py @@ -1,7 +1,6 @@ import warnings import numpy as np -from astropy import units as u from astropy.table import Table from roman_datamodels import stnode @@ -399,13 +398,9 @@ def mk_guidewindow(*, shape=(2, 8, 16, 32, 32), filepath=None, **kwargs): guidewindow = stnode.Guidewindow() guidewindow["meta"] = mk_guidewindow_meta(**kwargs.get("meta", {})) - guidewindow["pedestal_frames"] = kwargs.get( - "pedestal_frames", u.Quantity(np.zeros(shape, dtype=np.uint16), u.DN, dtype=np.uint16) - ) - guidewindow["signal_frames"] = kwargs.get( - "signal_frames", u.Quantity(np.zeros(shape, dtype=np.uint16), u.DN, dtype=np.uint16) - ) - guidewindow["amp33"] = kwargs.get("amp33", u.Quantity(np.zeros(shape, dtype=np.uint16), u.DN, dtype=np.uint16)) + guidewindow["pedestal_frames"] = kwargs.get("pedestal_frames", np.zeros(shape, dtype=np.uint16)) + guidewindow["signal_frames"] = kwargs.get("signal_frames", np.zeros(shape, dtype=np.uint16)) + guidewindow["amp33"] = kwargs.get("amp33", np.zeros(shape, dtype=np.uint16)) return save_node(guidewindow, filepath=filepath) diff --git a/tests/test_models.py b/tests/test_models.py index c3fc1f27..f8243f6a 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -311,11 +311,8 @@ def test_make_guidewindow(): assert guidewindow.meta.exposure.type == "WFI_IMAGE" assert guidewindow.pedestal_frames.dtype == np.uint16 - assert guidewindow.pedestal_frames.unit == u.DN assert guidewindow.signal_frames.dtype == np.uint16 - assert guidewindow.signal_frames.unit == u.DN assert guidewindow.amp33.dtype == np.uint16 - assert guidewindow.amp33.unit == u.DN assert guidewindow.pedestal_frames.shape == (2, 2, 2, 2, 2) assert guidewindow.signal_frames.shape == (2, 2, 2, 2, 2) assert guidewindow.amp33.shape == (2, 2, 2, 2, 2)