From a00365657fa8c3935e2de4cd0566f3ae793645be Mon Sep 17 00:00:00 2001 From: Ricky O'Steen Date: Tue, 19 Nov 2024 12:57:05 -0500 Subject: [PATCH] Add spaxel to the list of recognized solid angle units --- jdaviz/core/validunits.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/jdaviz/core/validunits.py b/jdaviz/core/validunits.py index 75869a4942..fb9f2f9474 100644 --- a/jdaviz/core/validunits.py +++ b/jdaviz/core/validunits.py @@ -207,15 +207,11 @@ def check_if_unit_is_per_solid_angle(unit, return_unit=False): # to check type new_unit_str = ' '.join(i).translate(str.maketrans('', '', '()')) new_unit = u.Unit(new_unit_str) - if new_unit.physical_type == 'solid angle': + if new_unit.physical_type == 'solid angle' or new_unit == PIX2 or new_unit_str == 'spaxel': # noqa + # square pixel and spaxel should be considered square angle units if return_unit: # area units present and requested to be returned return new_unit return True # area units present but not requested to be returned - # square pixel should be considered a square angle unit - if new_unit == PIX2: - if return_unit: - return new_unit - return True # in the case there are no area units, but return units were requested if return_unit: