Skip to content

Commit

Permalink
Merge branch 'RCAL-824_SepTVACFPS' of https://github.com/PaulHuwe/rom…
Browse files Browse the repository at this point in the history
…an_datamodels into RCAL-824_SepTVACFPS
  • Loading branch information
PaulHuwe committed May 1, 2024
2 parents 6575cf3 + 199df27 commit 2ff0241
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 18 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencies = [
"astropy >=5.3.0",
# "rad @ git+https://github.com/spacetelescope/rad.git",
# "rad >= 0.19.2",
"rad @ git+https://github.com/PaulHuwe/rad.git@RAD-165_SepTVACFPS",
"rad @ git+https://github.com/PaulHuwe/rad.git@RAD-165_SepTVACFPS",
"asdf-standard >=1.0.3",
]
dynamic = [
Expand Down
11 changes: 4 additions & 7 deletions src/roman_datamodels/maker_utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@
from ._basic_meta import * # noqa: F403
from ._common_meta import * # noqa: F403
from ._datamodels import * # noqa: F403
from ._fps import * # noqa: F403
from ._fps_basic_meta import * # noqa: F403
from ._fps_common_meta import * # noqa: F403
from ._ref_files import * # noqa: F403
from ._tagged_nodes import * # noqa: F403

from ._tvac import * # noqa: F403
from ._tvac_basic_meta import * # noqa: F403
from ._tvac_common_meta import * # noqa: F403
from ._tvac import * # noqa: F403

from ._fps_basic_meta import * # noqa: F403
from ._fps_common_meta import * # noqa: F403
from ._fps import * # noqa: F403


# These makers have special names to reflect the nature of their use in the pipeline
SPECIAL_MAKERS = {
Expand Down
2 changes: 1 addition & 1 deletion src/roman_datamodels/maker_utils/_fps.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def mk_fps_common_meta(**kwargs):
dict (defined by the ground_common-1.0.0 schema)
"""
# prevent circular import
from ._fps_common_meta import mk_fps_exposure, mk_fps_guidestar, mk_fps_cal_step, mk_fps_ref_file, mk_fps_wfi_mode
from ._fps_common_meta import mk_fps_cal_step, mk_fps_exposure, mk_fps_guidestar, mk_fps_ref_file, mk_fps_wfi_mode

meta = mk_fps_basic_meta(**kwargs)
meta["cal_step"] = mk_fps_cal_step(**kwargs.get("cal_step", {}))
Expand Down
2 changes: 0 additions & 2 deletions src/roman_datamodels/maker_utils/_fps_common_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ def mk_fps_guidestar(**kwargs):
return guide



def mk_fps_wfi_mode(**kwargs):
"""
Create a dummy WFI mode instance with valid values for attributes
Expand Down Expand Up @@ -104,7 +103,6 @@ def mk_fps_cal_step(**kwargs):
return l2calstep



def mk_fps_ref_file(**kwargs):
"""
Create a dummy RefFile instance with valid values for attributes
Expand Down
2 changes: 1 addition & 1 deletion src/roman_datamodels/maker_utils/_tvac.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def mk_tvac_common_meta(**kwargs):
dict (defined by the ground_common-1.0.0 schema)
"""
# prevent circular import
from ._tvac_common_meta import mk_tvac_exposure, mk_tvac_guidestar, mk_tvac_cal_step, mk_tvac_ref_file, mk_tvac_wfi_mode
from ._tvac_common_meta import mk_tvac_cal_step, mk_tvac_exposure, mk_tvac_guidestar, mk_tvac_ref_file, mk_tvac_wfi_mode

meta = mk_tvac_basic_meta(**kwargs)
meta["cal_step"] = mk_tvac_cal_step(**kwargs.get("cal_step", {}))
Expand Down
3 changes: 1 addition & 2 deletions src/roman_datamodels/maker_utils/_tvac_common_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from ._base import NONUM, NOSTR


def mk_tvac_exposure(**kwargs):
"""
Create a dummy BaseExposure instance with valid values for attributes
Expand Down Expand Up @@ -56,7 +57,6 @@ def mk_tvac_guidestar(**kwargs):
return guide



def mk_tvac_wfi_mode(**kwargs):
"""
Create a dummy WFI mode instance with valid values for attributes
Expand Down Expand Up @@ -103,7 +103,6 @@ def mk_tvac_cal_step(**kwargs):
return l2calstep



def mk_tvac_ref_file(**kwargs):
"""
Create a dummy RefFile instance with valid values for attributes
Expand Down
8 changes: 4 additions & 4 deletions src/roman_datamodels/stnode/_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,19 +316,19 @@ def __setitem__(self, key, value):

# Convert the value to a tagged scalar if necessary
if self._tag and "/tvac" in self._tag:
value = self._convert_to_scalar("tvac_"+key, value)
value = self._convert_to_scalar("tvac_" + key, value)
elif self._tag and "/fps" in self._tag:
value = self._convert_to_scalar("fps_"+key, value)
value = self._convert_to_scalar("fps_" + key, value)
else:
value = self._convert_to_scalar(key, value)

# If the value is a dictionary, loop over its keys and convert them to tagged scalars
if isinstance(value, dict):
for sub_key, sub_value in value.items():
if self._tag and "/tvac" in self._tag:
value[sub_key] = self._convert_to_scalar("tvac_"+sub_key, sub_value)
value[sub_key] = self._convert_to_scalar("tvac_" + sub_key, sub_value)
elif self._tag and "/fps" in self._tag:
value[sub_key] = self._convert_to_scalar("fps_"+sub_key, sub_value)
value[sub_key] = self._convert_to_scalar("fps_" + sub_key, sub_value)
else:
value[sub_key] = self._convert_to_scalar(sub_key, sub_value)

Expand Down

0 comments on commit 2ff0241

Please sign in to comment.