Skip to content

Commit 92aa5de

Browse files
committed
Hack some standard FITS header keys into the cell-coadd rewrite script.
This needs to be fixed before we ever run this on any non-LSSTCam data.
1 parent 7c6022d commit 92aa5de

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

python/lsst/pipe/tasks/rewrite_images/_rewrite_cell_coadd.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
from lsst.images import Box, Mask, get_legacy_deep_coadd_mask_planes
3636
from lsst.images.cells import CellCoadd
3737
from lsst.images.fields import field_from_legacy_background
38+
from lsst.images.fits import ExtensionKey, FitsOpaqueMetadata
3839
from lsst.meas.algorithms import SubtractBackgroundTask
3940
from lsst.pex.config import ConfigurableField, Field
4041
from lsst.pipe.base import (
@@ -182,6 +183,15 @@ def run(
182183
tract_info=tract_info,
183184
bbox=Box.from_legacy(patch_bbox),
184185
)
186+
if getattr(future_cell_coadd, "_opaque_metadata", None) is None:
187+
future_cell_coadd._opaque_metadata = FitsOpaqueMetadata()
188+
primary_header = future_cell_coadd._opaque_metadata.headers.setdefault(
189+
ExtensionKey(), astropy.io.fits.Header()
190+
)
191+
primary_header.set("INSTRUME", "LSSTCam")
192+
primary_header.set("ORIGIN", "NSF-DOE Vera C. Rubin Observatory")
193+
primary_header.set("TELESCOP", "Rubin:Simonyi")
194+
primary_header.set("DATE", astropy.time.Time.now().fits, "UTC date this HDU was written.")
185195
if object_mask is not None:
186196
future_cell_coadd.mask.clear()
187197
future_cell_coadd.mask.update(

0 commit comments

Comments
 (0)