Skip to content

Commit

Permalink
Merge pull request #1014 from bnavigator/ease-mask-test
Browse files Browse the repository at this point in the history
aperture mask test: assert almost equal
  • Loading branch information
bsipocz committed Jan 24, 2020
2 parents bab2227 + b3bd82e commit d35b476
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions photutils/aperture/tests/test_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import astropy.units as u
import numpy as np
from numpy.testing import assert_allclose
from numpy.testing import assert_allclose, assert_almost_equal
import pytest

from ..bounding_box import BoundingBox
Expand Down Expand Up @@ -110,7 +110,7 @@ def test_mask_multiply():
aper = CircularAperture((25, 25), r=radius)
mask = aper.to_mask()
data_weighted = mask.multiply(data)
assert np.sum(data_weighted) == radius**2 * np.pi
assert_almost_equal(np.sum(data_weighted), radius**2 * np.pi)

# test that multiply() returns a copy
data[25, 25] = 100.
Expand All @@ -125,7 +125,7 @@ def test_mask_multiply_quantity():

data_weighted = mask.multiply(data)
assert data_weighted.unit == u.adu
assert np.sum(data_weighted.value) == radius**2 * np.pi
assert_almost_equal(np.sum(data_weighted.value), radius**2 * np.pi)

# test that multiply() returns a copy
data[25, 25] = 100. * u.adu
Expand Down

0 comments on commit d35b476

Please sign in to comment.