From 591fa98761620fc17557a34a0277533d8a15c1ba Mon Sep 17 00:00:00 2001 From: Alfredo Mejia-Narvaez Date: Mon, 9 Dec 2024 11:41:26 -0300 Subject: [PATCH] fixing wavelength dtype in RSS object --- python/lvmdrp/core/rss.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/lvmdrp/core/rss.py b/python/lvmdrp/core/rss.py index 2f2d2634..7d984664 100644 --- a/python/lvmdrp/core/rss.py +++ b/python/lvmdrp/core/rss.py @@ -363,7 +363,7 @@ def from_channels(cls, rss_b, rss_r, rss_z, use_weights=True): # optionally interpolate if the merged wavelengths are not monotonic fluxes, errors, masks, lsfs, skies, sky_errors = [], [], [], [], [], [] skies_e, skies_w, sky_e_errors, sky_w_errors = [], [], [], [] - if numpy.all(numpy.isclose(sampling, sampling[0], atol=1e-6)): + if numpy.all(numpy.isclose(sampling, sampling[0], atol=1e-2)): log.info(f"current wavelength sampling: min = {sampling.min():.2f}, max = {sampling.max():.2f}") # extend rss._data to new_wave filling with NaNs for rss in rsss: @@ -1100,7 +1100,7 @@ def get_wave_from_header(self): if wcs.spectral.array_shape: res_elements = wcs.spectral.array_shape[0] wl = wcs.spectral.all_pix2world(numpy.arange(res_elements), 0)[0] - wave = (wl * u.m).to(u.AA).value + wave = (wl * u.m).to(u.AA).value.astype("float32") wave_disp = wave[1] - wave[0] wave_start = wave[0]