trident.absorption_spectrum.absorption_spectrum.AbsorptionSpectrum.error_func

AbsorptionSpectrum.error_func(flux)[source]

Approximate the flux error for a spectrum. Many observational analysis programs require a flux error channel in addition to a flux channel. So we create a zeroth order approximation of the flux error, simply by taking the square root of the flux. Unfortunately, with flux normalized to be < 1, this would result in errors larger than the flux values themselves, so we normalize by an arbitrary signal-to-noise ratio, which by default is set to 100. This yields a typical error for a normalized spectrum of sqrt(1.0*100)/100 = 0.1. This assures our flux errors are smaller than our fluxes for most flux reasonable flux values. Note that when a signal to noise ratio is specified for adding gaussian noise, it uses this updated value for estimating the errors. SNR is set as an attribute of AbsorptionSpectrum directly (e.g., as.snr = N).

Parameters

Flux

array of floats

The array of flux values