Closed arashgmn closed 1 year ago
Thanks for the suggestion! Have you encountered a situation where this was a problem? Because continuum_flux comes from the modeled continuum, and this was thought for parts of the spectra where the continuum cannot be modeled and the model returns zero flux (so a == 0
works fine to detect that).
I opened this issue long ago when I was analysing some spectra that I don't have access to anymore. Unfortunately, I cannot recall if such a condition was problematic. Nonetheless, given that the flux is often of type float
, I believe a condition such as np.isclose(continuum_flux,0)
is more robust than the current condition.
I think it's better to have an expression like
zeros = np.abs(continuum_flux <= 1e-4)
would be more robust to round-off errors. Just as a suggestion.https://github.com/marblestation/iSpec/blob/1d6482857705db12131ed6b5dec486dcccd5cac1/ispec/spectrum.py#L406