From 77fe6db704d50bc805ea8354ab6e348054cc02ec Mon Sep 17 00:00:00 2001 From: gibsongreen Date: Fri, 31 May 2024 14:26:45 -0400 Subject: [PATCH] change variable name to match PR, speclim->specvalues, value->values --- jdaviz/app.py | 3 +-- jdaviz/tests/test_app.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/jdaviz/app.py b/jdaviz/app.py index 8b1923a374..73f44c87a7 100644 --- a/jdaviz/app.py +++ b/jdaviz/app.py @@ -147,8 +147,7 @@ def to_unit(self, data, cid, values, original_units, target_units): elif len(values) == 2: # Need this for setting the y-limits - spec_limits = [spec.spectral_axis[0].value, spec.spectral_axis[-1].value] - eqv = u.spectral_density(spec_limits * spec.spectral_axis.unit) + eqv = u.spectral_density(spectral_values) if '_pixel_scale_factor' in spec.meta: # get min and max scale factors, to use with min and max of spec for diff --git a/jdaviz/tests/test_app.py b/jdaviz/tests/test_app.py index 45afe990fb..414dc4ad34 100644 --- a/jdaviz/tests/test_app.py +++ b/jdaviz/tests/test_app.py @@ -228,7 +228,7 @@ 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) # so test first value in array assert np.allclose(value[0], 4.800000041882413e-08)