breidablik.analysis.tools ========================= .. py:module:: breidablik.analysis.tools Functions --------- .. autoapisummary:: breidablik.analysis.tools.cut_wavelength breidablik.analysis.tools.cut breidablik.analysis.tools.rew Module Contents --------------- .. py:function:: cut_wavelength(wavelength, center=670.9659, upper=10, lower=10) Cuts the wavelength returns the values between center - lower and center + upper. Useful for plotting mostly because many functions return a cut line profile but not cut wavelength. :param wavelength: Input wavelengths. Needs to be monotonically increasing. :type wavelength: List[Real] or 1darray :param center: The center of the wavelengths where the cut should be taken, in the same units as the wavelength. The 3 lithium lines are centered at 610.5298, 670.9659, and 812.8606 nm in the Balder results. :type center: Real, optional :param upper: The amount to go above the center when taking the cut, in the same units as the wavelength. :type upper: Positive Real, optional :param lower: The amount to go below the center when taking the cut, in the same units as the wavelength. :type lower: Positive Real, optional :returns: **wl_cut** -- Cut wavelengths. :rtype: 2darray .. py:function:: cut(wavelength, line_profile, errors=None, center=670.9659, upper=10, lower=10) Cuts the wavelength and line profile and returns the values between center - lower and center + upper. :param wavelength: Input wavelengths. Needs to be monotonically increasing. :type wavelength: List[Real] or 1darray :param line_profile: Input line profile. :type line_profile: List[Real] or 1darray :param errors: Errors associated with input line profile. If using synthetic spectra, then no errors, leave as default value. :type errors: List[Real] or 1darray, optional :param center: The center of the wavelengths where the cut should be taken, in the same units as the wavelength. The 3 lithium lines are centered at 610.5298, 670.9659, and 812.8606 nm in the Balder results. :type center: Real, optional :param upper: The amount to go above the center when taking the cut, in the same units as the wavelength. :type upper: Positive Real, optional :param lower: The amount to go below the center when taking the cut, in the same units as the wavelength. :type lower: Positive Real, optional :returns: **cut_data** -- Cut wavelengths and line profiles, errors if provided. :rtype: ndarray .. py:function:: rew(wavelength, line_profile, center=670.9659, upper=10, lower=10, num=10000) Calculates the reduced equivlanet width (REW) of the line profile between center - lower and center + upper. :param wavelength: Input wavelengths. Needs to be monotonically increasing. :type wavelength: List[Real] or 1darray :param line_profile: Input line profile. :type line_profile: List[Real] or 1darray :param center: The center of the wavelengths where the REW should be calculated from, in the same units as the wavelength. The 3 lithium lines are centered at 610.5298, 670.9659, and 812.8606 nm in the Balder results. :type center: Real, optional :param upper: The amount to go above the center when taking calculating the REW, in the same units as the wavelength. :type upper: Positive Real, optional :param lower: The amount to go below the center when calculating the REW, in the same units as the wavelength. :type lower: Positive Real, optional :param num: The number of points in the interpolation. Before calculating the REW, the line profile is interpolated to finer wavelength points. :type num: Int, optional :returns: **rew** -- The REW. :rtype: float