Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Point tweakreg to new files. Move the asn file into artifactory. #1012

Merged
merged 1 commit into from
Nov 20, 2023
Merged
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
50 changes: 8 additions & 42 deletions romancal/regtest/test_tweakreg.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from io import StringIO

import pytest
from metrics_logger.decorators import metrics_logger
from roman_datamodels import datamodels as rdm
Expand All @@ -10,41 +8,6 @@
from .regtestdata import compare_asdf


def create_asn_file():
asn_content = """
{
"asn_type": "None",
"asn_rule": "DMS_ELPP_Base",
"version_id": null,
"code_version": "0.9.1.dev28+ge987cc9.d20230106",
"degraded_status": "No known degraded exposures in association.",
"program": "noprogram",
"constraints": "No constraints",
"asn_id": "a3001",
"target": "none",
"asn_pool": "test_pool_name",
"products": [
{
"name": "files.asdf",
"members": [
{
"expname": "r0000501001001001001_01101_0001_WFI01_cal_tweakreg.asdf",
"exptype": "science"
}
]
}
]
}
""" # noqa: E501
asn_file_path = "sample_asn.json"
asn_file = StringIO()
asn_file.write(asn_content)
with open(asn_file_path, mode="w") as f:
print(asn_file.getvalue(), file=f)

return asn_file_path


@metrics_logger("DMS280")
@pytest.mark.bigdata
def test_tweakreg(rtdata, ignore_asdf_paths, tmp_path):
Expand All @@ -53,14 +16,17 @@ def test_tweakreg(rtdata, ignore_asdf_paths, tmp_path):
# - assign_wcs;
# - photom;
# - source_detection.
input_data = "r0000501001001001001_01101_0001_WFI01_cal_tweakreg.asdf"
output_data = "r0000501001001001001_01101_0001_WFI01_output.asdf"
truth_data = "r0000501001001001001_01101_0001_WFI01_tweakreg.asdf"
input_data = "r0000101001001001001_01101_0001_WFI01_cal.asdf"
output_data = "r0000101001001001001_01101_0001_WFI01_tweakregstep.asdf"
truth_data = "r0000101001001001001_01101_0001_WFI01_tweakregstep.asdf"

asn_fn = "tweakreg_asn.json"

rtdata.get_data(f"WFI/image/{input_data}")
rtdata.get_data(f"WFI/image/{asn_fn}")
rtdata.get_truth(f"truth/WFI/image/{truth_data}")

rtdata.input = create_asn_file()
rtdata.input = asn_fn
rtdata.output = output_data

# instantiate TweakRegStep (for running and log access)
Expand All @@ -70,7 +36,7 @@ def test_tweakreg(rtdata, ignore_asdf_paths, tmp_path):
"romancal.step.TweakRegStep",
rtdata.input,
f"--output_file='{rtdata.output}'",
"--suffix='output'",
"--suffix='tweakregstep'",
]
RomanStep.from_cmdline(args)
tweakreg_out = rdm.open(rtdata.output)
Expand Down
Loading