Skip to content

Commit

Permalink
Test if borders are filled when stitched
Browse files Browse the repository at this point in the history
  • Loading branch information
arunkannawadi committed Jan 29, 2025
1 parent 964ccfd commit 50f2714
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_coadds.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,20 @@ def test_asExposure(self):
self.assertImagesEqual(exposure.variance[bbox], self.exposures[index].variance[bbox])
self.assertImagesEqual(exposure.mask[bbox], self.exposures[index].mask[bbox])

def test_borders(self):
"""Test that the borders are populated correctly on stitching."""
mi = self.stitched_coadd.asMaskedImage()

# Check that the borders are not all zero.
with self.assertRaises(AssertionError):
np.testing.assert_array_equal(mi.image.array[:self.border_size, :], 0)
with self.assertRaises(AssertionError):
np.testing.assert_array_equal(mi.image.array[-self.border_size:, :], 0)
with self.assertRaises(AssertionError):
np.testing.assert_array_equal(mi.image.array[:, :self.border_size], 0)
with self.assertRaises(AssertionError):
np.testing.assert_array_equal(mi.image.array[:, -self.border_size:], 0)

def test_fits(self):
"""Test that we can write an Exposure with StitchedPsf to a FITS file
and read it.
Expand Down

0 comments on commit 50f2714

Please sign in to comment.