diff --git a/jdaviz/app.py b/jdaviz/app.py index 47f7a9646d..546a7d48ef 100644 --- a/jdaviz/app.py +++ b/jdaviz/app.py @@ -80,14 +80,13 @@ def equivalent_units(self, data, cid, units): 'erg / (s cm2 Angstrom)', 'erg / (s cm2 Angstrom)', 'erg / (s cm2 Hz)', 'erg / (Hz s cm2)', 'ph / (Angstrom s cm2)', - 'ph / (Hz s cm2)', 'ph / (Hz s cm2)', 'bol', 'AB', 'ST' + 'ph / (Hz s cm2)', 'ph / (Hz s cm2)' ] + [ 'Jy / sr', 'mJy / sr', 'uJy / sr', 'MJy / sr', 'W / (Hz sr m2)', 'eV / (Hz s sr m2)', 'erg / (s sr cm2)', - 'AB / sr' ]) else: # spectral axis # prefer Hz over Bq and um over micron diff --git a/jdaviz/core/validunits.py b/jdaviz/core/validunits.py index 8ba718bff4..413b26c3c0 100644 --- a/jdaviz/core/validunits.py +++ b/jdaviz/core/validunits.py @@ -67,6 +67,10 @@ def create_flux_equivalencies_list(flux_unit, spectral_axis_unit): except u.core.UnitConversionError: return [] + mag_units = ['bol', 'AB', 'ST'] + # remove magnitude units from list + curr_flux_unit_equivalencies = [unit for unit in curr_flux_unit_equivalencies if not any(mag in unit.name for mag in mag_units)] # noqa + # Get local flux units. locally_defined_flux_units = ['Jy', 'mJy', 'uJy', 'MJy', 'W / (Hz m2)', @@ -75,13 +79,12 @@ def create_flux_equivalencies_list(flux_unit, spectral_axis_unit): 'erg / (s cm2 Angstrom)', 'ph / (Angstrom s cm2)', 'ph / (Hz s cm2)', - 'bol', 'AB', 'ST' ] local_units = [u.Unit(unit) for unit in locally_defined_flux_units] # Remove overlap units. curr_flux_unit_equivalencies = list(set(curr_flux_unit_equivalencies) - - set(local_units)) + - set(local_units) - set(mag_units)) # Convert equivalencies into readable versions of the units and sort them alphabetically. flux_unit_equivalencies_titles = sorted(units_to_strings(curr_flux_unit_equivalencies))