From 3aa49fbb82814749056bd3f0051dbcf6b4fd8c20 Mon Sep 17 00:00:00 2001 From: gibsongreen Date: Fri, 31 May 2024 17:19:45 -0400 Subject: [PATCH] test adjusts made post rebasing multiple PRs --- jdaviz/tests/test_app.py | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/jdaviz/tests/test_app.py b/jdaviz/tests/test_app.py index 500a15367c..3828bed9e4 100644 --- a/jdaviz/tests/test_app.py +++ b/jdaviz/tests/test_app.py @@ -228,33 +228,18 @@ def test_to_unit(cubeviz_helper): original_units = u.MJy / u.sr target_units = u.MJy - value = uc.to_unit(cubeviz_helper, data, cid, value, original_units, target_units) + value = uc.to_unit(cubeviz_helper, data, cid, values, original_units, target_units) # will be a uniform array since not wavelength dependent # so test first value in array assert np.allclose(value[0], 4.800000041882413e-08) - # Change from Fnu to Flam (with values shape matching spectral axis) - - values = np.ones(3001) - original_units = u.MJy - target_units = u.erg / u.cm**2 / u.s / u.AA - - new_values = uc.to_unit(cubeviz_helper, data, cid, values, original_units, target_units) - - assert np.allclose(new_values, - (values * original_units) - .to_value(target_units, - equivalencies=u.spectral_density(cube.spectral_axis))) - - # Change from Fnu to Flam (with a shape (2,) array of values indicating we - # are probably converting the limits) + # Flux to surface brightness - values = [1, 2] original_units = u.MJy - target_units = u.erg / u.cm**2 / u.s / u.AA + target_units = u.MJy / u.sr - new_values = uc.to_unit(cubeviz_helper, data, cid, values, original_units, target_units) + value = uc.to_unit(cubeviz_helper, data, cid, value, original_units, target_units) assert np.allclose(value, 1)