Skip to content

Commit

Permalink
Bump specutils requirement to v1.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ojustino committed Nov 22, 2022
1 parent 53fd1a4 commit 14f48c6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ python_requires = >=3.8
setup_requires = setuptools_scm
install_requires =
astropy
specutils>=1.7
specutils>=1.9.1
synphot
matplotlib
photutils
Expand Down
2 changes: 0 additions & 2 deletions specreduce/background.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,4 @@ def __rsub__(self, image):
"""
Subtract the background from an image.
"""
# NOTE: will not be called until specutils PR #988 is merged, released,
# and pinned here
return self.sub_image(image)
13 changes: 5 additions & 8 deletions specreduce/tests/test_background.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,17 @@ def test_background():
bg = Background(image, trace, width=bkg_width)

# test that image subtraction works
# NOTE: uncomment sub1 test once Spectrum1D and Background subtraction works
# (meaning specutils PR #988 is merged, released, and pinned here)
# sub1 = image - bg1
sub1 = image - bg1
sub2 = bg1.sub_image(image)
sub3 = bg1.sub_image()
# assert np.allclose(sub1.flux, sub2.flux)
assert np.allclose(sub1.flux, sub2.flux)
assert np.allclose(sub2.flux, sub3.flux)

# NOTE: uncomment sub4 test once Spectrum1D and Background subtraction works
# sub4 = image_um - bg4
sub4 = image_um - bg4
sub5 = bg4.sub_image(image_um)
sub6 = bg4.sub_image()
assert np.allclose(sub2.flux, sub5.flux)
# assert np.allclose(sub4.flux, sub5.flux)
assert np.allclose(sub1.flux, sub4.flux)
assert np.allclose(sub4.flux, sub5.flux)
assert np.allclose(sub5.flux, sub6.flux)

bkg_spec = bg1.bkg_spectrum()
Expand Down

0 comments on commit 14f48c6

Please sign in to comment.