Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/697.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add a trace model image to slit datamodels.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ allOf:
title: Trace model
fits_hdu: TRACEMODEL
datatype: float32
ndim: 2
- $ref: variance.schema
- type: object
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ allOf:
fits_hdu: CON
default: 0
datatype: int32
trace_model:
title: Trace model
fits_hdu: TRACEMODEL
datatype: float32
ndim: 2
- $ref: variance.schema
- $ref: flatcorr.schema
- $ref: pathlosscorr.schema
Expand Down
4 changes: 4 additions & 0 deletions src/stdatamodels/jwst/datamodels/slit.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ class SlitDataModel(JwstDataModel):
photom array for uniform source
area : numpy float32 array
Pixel area map array
trace_model : numpy float32 array
Trace model array
"""

schema_url = "http://stsci.edu/schemas/jwst_datamodel/slitdata.schema"
Expand Down Expand Up @@ -91,6 +93,8 @@ class SlitModel(JwstDataModel):
Photom array for uniform source
area : numpy float32 array
Pixel area map array
trace_model : numpy float32 array
Trace model array
int_times : numpy table
Table of times for each integration
"""
Expand Down
9 changes: 8 additions & 1 deletion tests/jwst/datamodels/test_multislit.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,19 @@ def test_multislit():
slit.data = rng.random((5, 5))
slit.dm = rng.random((5, 5))
slit.err = rng.random((5, 5))
for attr in ["wavelength", "pathloss_point", "pathloss_uniform", "barshadow"]:
for attr in [
"wavelength",
"pathloss_point",
"pathloss_uniform",
"barshadow",
"trace_model",
]:
setattr(dm.slits[-1], attr, dm.slits[-1].get_default(attr))
assert slit.wavelength.shape == (0, 0)
assert slit.pathloss_point.shape == (0, 0)
assert slit.pathloss_uniform.shape == (0, 0)
assert slit.barshadow.shape == (0, 0)
assert slit.trace_model.shape == (0, 0)


def test_multislit_from_image():
Expand Down
Loading