Currently, running smoothspec with sigma set to zero yields a non-fatal RuntimeWarning due to the division by zero encountered in these two lines in smoothspec.
While the division doesn't actually cause issues with the output spectrum (i.e. the input spectrum is returned if sigma is set to zero, albeit interpolated to a new wavelength grid if one is provided), this pull request adds conditional logic that sets R and Rsigma to np.infty in this situation to avoid that division from taking place, and thus avoid the RuntimeWarning from being issued.
Currently, running
smoothspec
withsigma
set to zero yields a non-fatalRuntimeWarning
due to the division by zero encountered in these two lines insmoothspec
.While the division doesn't actually cause issues with the output spectrum (i.e. the input spectrum is returned if
sigma
is set to zero, albeit interpolated to a new wavelength grid if one is provided), this pull request adds conditional logic that setsR
andRsigma
tonp.infty
in this situation to avoid that division from taking place, and thus avoid theRuntimeWarning
from being issued.