Skip to content

Commit c34ac90

Browse files
committed
Update tests for changes to CoaddInput
1 parent a8bd203 commit c34ac90

3 files changed

Lines changed: 24 additions & 7 deletions

File tree

python/lsst/cell_coadds/_fits.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
from ._uniform_grid import UniformGrid
115115
from .typing_helpers import SingleCellCoaddApCorrMap
116116

117-
FILE_FORMAT_VERSION = "0.8"
117+
FILE_FORMAT_VERSION = "0.9"
118118
"""Version number for the file format as persisted, presented as a string of
119119
the form M.m, where M is the major version, m is the minor version.
120120
"""
@@ -301,6 +301,7 @@ def readAsMultipleCellCoadd(self) -> MultipleCellCoadd:
301301
coadd_input = CoaddInputs( # default version for written_version <= 0.5.
302302
overlaps_center=True,
303303
overlap_fraction=1.0,
304+
unmasked_overlap_fraction=1.0,
304305
weight=0.0,
305306
psf_shape=afwGeom.Quadrupole(),
306307
psf_shape_flag=True,
@@ -373,6 +374,11 @@ def readAsMultipleCellCoadd(self) -> MultipleCellCoadd:
373374
coadd_input = CoaddInputs(
374375
overlaps_center=link_row["overlaps_center"],
375376
overlap_fraction=link_row["overlap_fraction"],
377+
unmasked_overlap_fraction=(
378+
link_row["unmasked_overlap_fraction"]
379+
if written_version >= version.parse("0.9")
380+
else link_row["overlap_fraction"]
381+
),
376382
weight=link_row["weight"],
377383
psf_shape=afwGeom.Quadrupole(
378384
ixx=link_row["psf_shape_ixx"],
@@ -674,6 +680,7 @@ def writeMultipleCellCoaddAsFits(
674680
observation_id.detector,
675681
coadd_input.overlaps_center,
676682
coadd_input.overlap_fraction,
683+
coadd_input.unmasked_overlap_fraction,
677684
coadd_input.weight,
678685
coadd_input.psf_shape.getIxx(),
679686
coadd_input.psf_shape.getIyy(),
@@ -769,6 +776,7 @@ def writeMultipleCellCoaddAsFits(
769776
"detector",
770777
"overlaps_center",
771778
"overlap_fraction",
779+
"unmasked_overlap_fraction",
772780
"weight",
773781
"psf_shape_ixx",
774782
"psf_shape_iyy",

python/lsst/cell_coadds/_single_cell_coadd.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,15 @@ def __init__(
123123
self._inputs: Mapping[ObservationIdentifiers, CoaddInputs]
124124
if inputs:
125125
self._inputs = dict.fromkeys(
126-
sorted(set(inputs)), CoaddInputs(False, 0.0, 0.0, Quadrupole(), True)
126+
sorted(set(inputs)),
127+
CoaddInputs(
128+
overlaps_center=False,
129+
overlap_fraction=0.0,
130+
unmasked_overlap_fraction=0.0,
131+
weight=0.0,
132+
psf_shape=Quadrupole(),
133+
psf_shape_flag=True,
134+
),
127135
)
128136
self._inputs.update(inputs)
129137
else:

tests/test_coadds.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -263,14 +263,15 @@ def setUpClass(cls) -> None:
263263
detector=67,
264264
day_obs=20000101,
265265
): CoaddInputs(
266-
True,
267-
1.0,
268-
1.0,
269-
Quadrupole(
266+
overlaps_center=True,
267+
overlap_fraction=1.0,
268+
unmasked_overlap_fraction=1.0,
269+
weight=1.0,
270+
psf_shape=Quadrupole(
270271
cls.psf_sigmas[Index2D(x=x, y=y)] ** 2,
271272
cls.psf_sigmas[Index2D(x=x, y=y)] ** 2,
272273
),
273-
False,
274+
psf_shape_flag=False,
274275
)
275276
},
276277
common=common,

0 commit comments

Comments
 (0)