Skip to content

Commit

Permalink
RCAL-934: Update Datamodels for L1/L2 Roman Doc (#404)
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>
Co-authored-by: mairan <[email protected]>
  • Loading branch information
3 people authored Oct 29, 2024
1 parent 6c066a5 commit 99446a3
Show file tree
Hide file tree
Showing 7 changed files with 305 additions and 204 deletions.
1 change: 1 addition & 0 deletions changes/404.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update datamodels and tests for L1/L2 Roman Doc
38 changes: 31 additions & 7 deletions src/roman_datamodels/maker_utils/_basic_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@
from ._base import NOFN, NOSTR


def mk_calibration_software_name(**kwargs):
"""
Create a dummy CalibrationSoftwareName object with valid values
Returns
-------
roman_datamodels.stnode.CalibrationSoftwareName
"""
return stnode.CalibrationSoftwareName(kwargs.get("calibration_software_name", "RomanCAL"))


def mk_calibration_software_version(**kwargs):
"""
Create a dummy CalibrationSoftwareVersion object with valid values
Expand Down Expand Up @@ -71,18 +82,29 @@ def mk_origin(**kwargs):
roman_datamodels.stnode.Origin
"""

return stnode.Origin(kwargs.get("origin", "STSCI"))
return stnode.Origin(kwargs.get("origin", "STSCI/SOC"))


def mk_prd_version(**kwargs):
"""
Create a dummy PrdVersion object with valid values
Returns
-------
roman_datamodels.stnode.PrdVersion
"""
return stnode.PrdVersion(kwargs.get("prd_version", "8.8.8"))


def mk_prd_software_version(**kwargs):
def mk_product_type(**kwargs):
"""
Create a dummy PrdSoftwareVersion object with valid values
Create a dummy ProductType object with valid values
Returns
-------
roman_datamodels.stnode.PrdSoftwareVersion
roman_datamodels.stnode.ProductType
"""
return stnode.PrdSoftwareVersion(kwargs.get("prd_software_version", "8.8.8"))
return stnode.ProductType(kwargs.get("product_type", "l2"))


def mk_telescope(**kwargs):
Expand All @@ -105,13 +127,15 @@ def mk_basic_meta(**kwargs):
dict (defined by the basic-1.0.0 schema)
"""
meta = {}
meta["calibration_software_name"] = mk_calibration_software_name(**kwargs)
meta["calibration_software_version"] = mk_calibration_software_version(**kwargs)
meta["sdf_software_version"] = mk_sdf_software_version(**kwargs)
meta["product_type"] = mk_product_type(**kwargs)
meta["filename"] = mk_filename(**kwargs)
meta["file_date"] = mk_file_date(**kwargs)
meta["model_type"] = mk_model_type(**kwargs)
meta["origin"] = mk_origin(**kwargs)
meta["prd_software_version"] = mk_prd_software_version(**kwargs)
meta["prd_version"] = mk_prd_version(**kwargs)
meta["sdf_software_version"] = mk_sdf_software_version(**kwargs)
meta["telescope"] = mk_telescope(**kwargs)

return meta
Loading

0 comments on commit 99446a3

Please sign in to comment.