Skip to content

Commit

Permalink
Allow exposure assembler to work with masked image
Browse files Browse the repository at this point in the history
  • Loading branch information
timj committed Jan 30, 2025
1 parent cf94b44 commit a9aff7d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions python/lsst/obs/base/exposureAssembler.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

"""Support for assembling and disassembling afw Exposures."""

import contextlib
import logging
from collections.abc import Iterable, Mapping
from typing import Any
Expand Down Expand Up @@ -325,6 +326,9 @@ def selectResponsibleComponent(cls, readComponent: str, fromComponents: set[str
def add_provenance(
self, inMemoryDataset: Any, ref: DatasetRef, provenance: DatasetProvenance | None = None
) -> Any:
# Add provenance via FITS headers.
add_provenance_to_fits_header(inMemoryDataset.metadata, ref, provenance)
# Add provenance via FITS headers. This delegate is reused by
# MaskedImage as well as Exposure so no guarantee that metadata
# is present.
with contextlib.suppress(AttributeError):
add_provenance_to_fits_header(inMemoryDataset.metadata, ref, provenance)
return inMemoryDataset

0 comments on commit a9aff7d

Please sign in to comment.