Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 12, 2024
1 parent 141061d commit 20adc8d
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions romancal/regtest/test_multiband_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import asdf
import pytest

from romancal.stpipe import RomanStep
from romancal.multiband_catalog.multiband_catalog_step import MultibandCatalogStep
from romancal.stpipe import RomanStep

# mark all tests in this module
pytestmark = [pytest.mark.bigdata, pytest.mark.soctests]
Expand Down Expand Up @@ -34,27 +34,30 @@ def test_multiband_catalog(rtdata_module):
rtdata.input = inputasnfn
rtdata.get_truth(f"truth/WFI/image/{outputfn}")
aftruth = asdf.open(f"truth/{outputfn}")
args = ['romancal.step.MultibandCatalogStep', inputasnfn,
'--deblend', 'True', # use deblending, DMS 393
]
args = [
"romancal.step.MultibandCatalogStep",
inputasnfn,
"--deblend",
"True", # use deblending, DMS 393
]
RomanStep.from_cmdline(args)
afcat = asdf.open(outputfn)
for field in fieldlist:
assert field in afcat['roman']['source_catalog'].dtype.names
assert field in afcat["roman"]["source_catalog"].dtype.names

# DMS 393: multiband catalog uses both PSF-like and extend-source-like
# kernels
assert (
set(aftruth['roman']['source_catalog'].dtype.names) ==
set(afcat['roman']['source_catalog'].dtype.names))
assert set(aftruth["roman"]["source_catalog"].dtype.names) == set(
afcat["roman"]["source_catalog"].dtype.names
)
# weak assertion that our truth file must at least have the same
# catalog fields as the file produced here. Exactly matching rows
# would require a lot of okifying things that aren't obviously
# the same, but we can easily check that the columns match up
# by name.

step = MultibandCatalogStep()
step.log.info('DMS391: successfully used multiple kernels to detect '
'sources.')
step.log.info('DMS393: successfully used deblending to separate blended '
'sources.')
step.log.info("DMS391: successfully used multiple kernels to detect " "sources.")
step.log.info(
"DMS393: successfully used deblending to separate blended " "sources."
)

0 comments on commit 20adc8d

Please sign in to comment.