You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was wondering if there are plans to include in-place versions of the main functions, specifically redden! and deredden!.
Currently, the implementation of redden creates a new array for every call:
redden(law::ExtinctionLaw, wave::Real, flux; Av = 1) = flux * 10^(-0.4 * Av * law(wave))
In scenarios where we are processing large spectra or multiple lines of sight, avoiding the allocation of a new flux array by modifying the existing one in-place would significantly improve performance and memory efficiency.
A possible implementation for the in-place version could look like this: function redden!(law::ExtinctionLaw, wave, flux; Av = 1) flux .*= 10 .^ (-0.4 .* Av .* law.(wave)) return flux end