Fix test_psf_map.py
@@ -168,18 +168,18 @@ def test_psfmap_stacking():
psfmap2 = make_test_psfmap(0.1 * u.deg, shape="flat")
psfmap2.exposure_map.quantity *= 2
- psf_data = np.copy(psfmap1.psf_map.data)
- exposure_data = np.copy(psfmap1.exposure_map.data)
-
- psfmap1.stack(psfmap2)
- assert_allclose(psfmap1.psf_map.data, psf_data)
- assert_allclose(psfmap1.exposure_map.data, exposure_data * 3)
+ psfmap_stack = psfmap1.copy()
+ psfmap_stack.stack(psfmap2)
+ assert_allclose(psfmap_stack.psf_map.data, psfmap1.psf_map.data)
+ assert_allclose(psfmap_stack.exposure_map.data, psfmap1.exposure_map.data * 3)
psfmap3 = make_test_psfmap(0.3 * u.deg, shape="flat")
- psfmap1.stack(psfmap3)
- assert_allclose(psfmap1.psf_map.data[0, 40, 20, 20], 0.0)
- assert_allclose(psfmap1.psf_map.data[0, 20, 20, 20], 5805.28955078125)
- assert_allclose(psfmap1.psf_map.data[0, 0, 20, 20], 58052.78955078125)
+ psfmap_stack = psfmap1.copy()
+ psfmap_stack.stack(psfmap3)
+
+ assert_allclose(psfmap_stack.psf_map.data[0, 40, 20, 20], 0.0)
+ assert_allclose(psfmap_stack.psf_map.data[0, 20, 20, 20], 5805.28955078125)
+ assert_allclose(psfmap_stack.psf_map.data[0, 0, 20, 20], 58052.78955078125)
# TODO: add a test comparing make_mean_psf and PSFMap.stack for a set of observations in an Observations
