|
35 | 35 | from lsst.images import Box, Mask, get_legacy_deep_coadd_mask_planes |
36 | 36 | from lsst.images.cells import CellCoadd |
37 | 37 | from lsst.images.fields import field_from_legacy_background |
| 38 | +from lsst.images.fits import ExtensionKey, FitsOpaqueMetadata |
38 | 39 | from lsst.meas.algorithms import SubtractBackgroundTask |
39 | 40 | from lsst.pex.config import ConfigurableField, Field |
40 | 41 | from lsst.pipe.base import ( |
@@ -182,6 +183,15 @@ def run( |
182 | 183 | tract_info=tract_info, |
183 | 184 | bbox=Box.from_legacy(patch_bbox), |
184 | 185 | ) |
| 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.") |
185 | 195 | if object_mask is not None: |
186 | 196 | future_cell_coadd.mask.clear() |
187 | 197 | future_cell_coadd.mask.update( |
|
0 commit comments