thusser / spexxy

spexxy spectrum fitting framework
Other
4 stars 1 forks source link

Resampling spectra with NANs #23

Open skamann opened 1 year ago

skamann commented 1 year ago

When resampling a spectrum that contains NANs using Spectrum.resample() and changing the number of pixels, the output will contain NANs in wavelength regions that were valid before. A possible fix would be to replace the following statement in Spectra.resample().

output.flux[start_index:start_index+len(ip)] = ip[start_index:start_index+len(ip)]

with

i_min, i_max = output.indices_of_wave_range(part.wave.min(), part.wave.max())
output.flux[i_min:i_max] = ip[i_min:i_max]
thusser commented 1 month ago

This solution makes the tests fail...