Skip to content

Commit

Permalink
Remove units from guidewindow (#415)
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamJamieson authored Nov 5, 2024
1 parent 609a22e commit 3ed89f4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
1 change: 1 addition & 0 deletions changes/415.removal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove units from Guidewindow related data models.
11 changes: 3 additions & 8 deletions src/roman_datamodels/maker_utils/_datamodels.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)

Expand Down
3 changes: 0 additions & 3 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3ed89f4

Please sign in to comment.