Skip to content

Commit

Permalink
RCAL-807: Bit Mask to Resample (#336)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
PaulHuwe and pre-commit-ci[bot] authored Apr 4, 2024
1 parent 463a1ce commit 35d11ac
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@

- Add initialization for the flux step meta. [#332]

- Create ``outlier_detection`` schema and add bit mask field to both it and ``resample``. [#336]

- Add models for Level 2 and Level 3 source catalog and segmentation map. [#331]


0.19.0 (2024-02-09)
===================

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ dependencies = [
"numpy >=1.22",
"astropy >=5.3.0",
"rad @ git+https://github.com/spacetelescope/rad.git",
# "rad >= 0.19.0",
"asdf-standard >=1.0.3",
]
dynamic = [
Expand Down
16 changes: 16 additions & 0 deletions src/roman_datamodels/maker_utils/_common_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,21 @@ def mk_observation(**kwargs):
return obs


def mk_outlier_detection(**kwargs):
"""
Create a dummy Outlier Detection instance with valid values for attributes
required by the schema. Utilized by the model maker utilities below.
Returns
-------
roman_datamodels.stnode.OutlierDetection
"""
od = stnode.OutlierDetection()
od["good_bits"] = kwargs.get("good_bits", "NA")

return od


def mk_ephemeris(**kwargs):
"""
Create a dummy Ephemeris instance with valid values for attributes
Expand Down Expand Up @@ -486,6 +501,7 @@ def mk_photometry_meta(**kwargs):

meta = mk_common_meta(**kwargs)
meta["photometry"] = mk_photometry(**kwargs.get("photometry", {}))
meta["outlier_detection"] = mk_outlier_detection(**kwargs.get("outlier_detection", {}))

return meta

Expand Down
1 change: 1 addition & 0 deletions src/roman_datamodels/maker_utils/_tagged_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def mk_resample(**kwargs):
roman_datamodels.stnode.Resample
"""
res = stnode.Resample()
res["good_bits"] = kwargs.get("good_bits", "NA")
res["members"] = kwargs.get("members", [])
res["pixel_scale_ratio"] = kwargs.get("pixel_scale_ratio", NONUM)
res["pixfrac"] = kwargs.get("pixfrac", NONUM)
Expand Down

0 comments on commit 35d11ac

Please sign in to comment.