LineDetect.detect_elements
Module Contents
Functions
|
Calculates the equivalent width and associated uncertainties of Mg-II doublet absorption features in a given spectrum. |
|
Calculates the value of a double Gaussian function at a given x coordinate. |
|
Fits a line using a double Gaussian model and returns the equivalent width and errors. |
- LineDetect.detect_elements.MgII(Lambda: numpy.array, flux: numpy.array, yC: numpy.array, sigFlux: numpy.array, sig_yC: numpy.array, R: numpy.ndarray, N_sig_line1: float = 5, N_sig_line2: float = 3, N_sig_limits: float = 0.5, resolution_element: int = 3, rest_wavelength_1: float = 2796.35, rest_wavelength_2: float = 2803.53) Tuple[int, int][source]
Calculates the equivalent width and associated uncertainties of Mg-II doublet absorption features in a given spectrum.
- Parameters:
Lambda (np.ndarray) – Wavelength array of the spectrum
flux (np.ndarray) – Flux array of the spectrum
yC (np.ndarray) – Continuum flux array of the spectrum
sigFlux (np.ndarray) – Array of flux uncertainties
sig_yC (np.ndarray) – Array of continuum flux uncertainties
R (np.ndarray) – Resolution array of the spectrum
N_sig_line1 (float) – Threshold of flux recovery for determining feature limits.
N_sig_2 (float) – Defaults to 3.
resolution_element (int) – The size of the resolution element in pixels. Defaults to 3.
rest_wavelength_1 (float) –
rest_wavelength_2 (float) –
- Returns:
Array of lower limit wavelength values for the Mg-II Mg2803 (np.ndarray): Array of upper limit wavelength values for each Mg-II feature detected EW2796 (np.ndarray): Array of equivalent widths for each Mg-II 2796 feature detected EW2803 (np.ndarray): Array of equivalent widths for each Mg-II 2803 feature detected deltaEW2796 (np.ndarray): Array of uncertainties in equivalent widths for each Mg-II 2796 feature detected deltaEW2803 (np.ndarray): Array of uncertainties in equivalent widths for each Mg-II 2803 feature detected
- Return type:
Mg2796 (np.ndarray)
- LineDetect.detect_elements.doubleGaussian(x, amplitude_1, amplitude_2, sigma_1, sigma_2, x0_1, x0_2)[source]
Calculates the value of a double Gaussian function at a given x coordinate.
- Parameters:
x (float) – The x coordinate.
amplitude_1 (float) – Amplitude of the first Gaussian component.
amplitude_2 (float) – Amplitude of the second Gaussian component.
sigma_1 (float) – Standard deviation of the first Gaussian component.
sigma_2 (float) – Standard deviation of the second Gaussian component.
x0_1 (float) – Mean of the first Gaussian component.
x0_2 (float) – Mean of the second Gaussian component.
- Returns:
The value of the double Gaussian function at the given x coordinate.
- Return type:
- LineDetect.detect_elements.lineFit(index1, index2, Lambda, flux, rest_wavelength_1, rest_wavelength_2)[source]
Fits a line using a double Gaussian model and returns the equivalent width and errors.
- Parameters:
- Returns:
- A tuple containing the equivalent widths and errors of the two Gaussian components:
EW1 (float): Equivalent width of the first Gaussian component.
deltaEW1 (float): Error in the equivalent width of the first Gaussian component.
EW2 (float): Equivalent width of the second Gaussian component.
deltaEW2 (float): Error in the equivalent width of the second Gaussian component.
- Return type: