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

Populate sky metadata with zero if matching is not possible. #1360

Merged
merged 6 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ tweakreg

- Update default absolute separation for tweakreg. [#1352]

skymatch
--------
- Populate valid metadata even when then are no overlapping images to
match [#1360]


0.15.1 (2024-05-15)
===================
Expand Down
13 changes: 7 additions & 6 deletions romancal/skymatch/skymatch_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,14 @@ def _imodel2skyim(self, image_model):
def _set_sky_background(self, sky_image, step_status):
image = sky_image.meta["image_model"]
sky = sky_image.sky
if sky == 0 or sky is None:
sky = 0 * image.data.unit

if step_status == "COMPLETE":
image.meta.background.method = str(self.skymethod)
image.meta.background.level = sky
image.meta.background.subtracted = self.subtract
image.meta.background.method = str(self.skymethod)
image.meta.background.subtracted = self.subtract
image.meta.background.level = sky

if self.subtract:
image.data[...] = sky_image.image[...]
if step_status == "COMPLETE" and self.subtract:
image.data[...] = sky_image.image[...]

image.meta.cal_step.skymatch = step_status