Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resampling spectra with NANs #23

Open
skamann opened this issue Mar 1, 2023 · 1 comment
Open

Resampling spectra with NANs #23

skamann opened this issue Mar 1, 2023 · 1 comment

Comments

@skamann
Copy link

skamann commented Mar 1, 2023

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 thusser closed this as completed in de4f40a Jul 9, 2024
@thusser thusser reopened this Jul 9, 2024
@thusser
Copy link
Owner

thusser commented Jul 9, 2024

This solution makes the tests fail...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants