diff --git a/gemini_instruments/f2/tests/test_f2.py b/gemini_instruments/f2/tests/test_f2.py index f49a52c220..62f2b3fc0c 100644 --- a/gemini_instruments/f2/tests/test_f2.py +++ b/gemini_instruments/f2/tests/test_f2.py @@ -6,6 +6,11 @@ import gemini_instruments from gemini_instruments.f2 import AstroDataF2 +import numpy as np + + +FLOAT_TYPES = (float, np.float32, np.float64) + test_files = [ "S20131121S0094.fits", "S20131126S1111.fits", @@ -16,9 +21,9 @@ ] F2_DESCRIPTORS_TYPES = [ - ('detector_x_offset', float), - ('detector_y_offset', float), - ('pixel_scale', float), + ('detector_x_offset', FLOAT_TYPES), + ('detector_y_offset', FLOAT_TYPES), + ('pixel_scale', FLOAT_TYPES), ] diff --git a/gemini_instruments/gmos/tests/test_gmos.py b/gemini_instruments/gmos/tests/test_gmos.py index eaf77f7334..469f7a2691 100644 --- a/gemini_instruments/gmos/tests/test_gmos.py +++ b/gemini_instruments/gmos/tests/test_gmos.py @@ -4,9 +4,14 @@ import astrodata.testing import gemini_instruments +import numpy as np + + +FLOAT_TYPES = (float, np.float32, np.float64) + GMOS_DESCRIPTORS_TYPES = [ - ('detector_x_offset', float), - ('detector_y_offset', float), + ('detector_x_offset', FLOAT_TYPES), + ('detector_y_offset', FLOAT_TYPES), ('nod_count', tuple), ('nod_offsets', tuple), ('pixel_scale', float), diff --git a/gemini_instruments/gmu.py b/gemini_instruments/gmu.py index 8c812b02c7..cbcc6f7ff9 100644 --- a/gemini_instruments/gmu.py +++ b/gemini_instruments/gmu.py @@ -135,7 +135,6 @@ def gn(instance, asMicrometers=False, asNanometers=False, asAngstroms=False, # Ensure we return a list, not an array # nm are the "standard" DRAGONS wavelength unit retval = fn(instance, **kwargs) - print("RETVAL", retval) if retval is None: return retval if isinstance(retval, list): diff --git a/gemini_instruments/gnirs/tests/test_gnirs.py b/gemini_instruments/gnirs/tests/test_gnirs.py index ae41501a6b..248e654f34 100644 --- a/gemini_instruments/gnirs/tests/test_gnirs.py +++ b/gemini_instruments/gnirs/tests/test_gnirs.py @@ -5,6 +5,11 @@ import gemini_instruments from gemini_instruments.gnirs import AstroDataGnirs +import numpy as np + + +FLOAT_TYPES = (float, np.float32, np.float64) + test_files = [ "N20190206S0279.fits", "N20190214S0058.fits", @@ -15,9 +20,9 @@ GNIRS_DESCRIPTORS_TYPES = [ - ('detector_x_offset', float), - ('detector_y_offset', float), - ('pixel_scale', float), + ('detector_x_offset', FLOAT_TYPES), + ('detector_y_offset', FLOAT_TYPES), + ('pixel_scale', FLOAT_TYPES), ] diff --git a/gemini_instruments/test/test_astrodata_descriptors.py b/gemini_instruments/test/test_astrodata_descriptors.py index 6cab226443..fbb5e23981 100644 --- a/gemini_instruments/test/test_astrodata_descriptors.py +++ b/gemini_instruments/test/test_astrodata_descriptors.py @@ -47,5 +47,11 @@ def test_descriptor(instr, filename, descriptor, value): mvalue = method() if type(value) in FLOAT_TYPES or type(mvalue) in FLOAT_TYPES: assert abs(mvalue - value) < 0.0001 - else: + elif isinstance(value, list): + assert len(value) == len(mvalue) + for v, mv in zip(value, mvalue): + if type(v) in FLOAT_TYPES or type(mv) in FLOAT_TYPES: + assert abs(mv - v) < 0.0001 + else: + assert v == mv assert value == mvalue