breidablik.analysis.tools

Functions

cut_wavelength(wavelength[, center, upper, lower])

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.

cut(wavelength, line_profile[, errors, center, upper, ...])

Cuts the wavelength and line profile and returns the values between center - lower and center + upper.

rew(wavelength, line_profile[, center, upper, lower, num])

Calculates the reduced equivlanet width (REW) of the line profile between center - lower and center + upper.

Module Contents

breidablik.analysis.tools.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.

Parameters:
  • wavelength (List[Real] or 1darray) – Input wavelengths. Needs to be monotonically increasing.

  • center (Real, optional) – 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.

  • upper (Positive Real, optional) – The amount to go above the center when taking the cut, in the same units as the wavelength.

  • lower (Positive Real, optional) – The amount to go below the center when taking the cut, in the same units as the wavelength.

Returns:

wl_cut – Cut wavelengths.

Return type:

2darray

breidablik.analysis.tools.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.

Parameters:
  • wavelength (List[Real] or 1darray) – Input wavelengths. Needs to be monotonically increasing.

  • line_profile (List[Real] or 1darray) – Input line profile.

  • errors (List[Real] or 1darray, optional) – Errors associated with input line profile. If using synthetic spectra, then no errors, leave as default value.

  • center (Real, optional) – 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.

  • upper (Positive Real, optional) – The amount to go above the center when taking the cut, in the same units as the wavelength.

  • lower (Positive Real, optional) – The amount to go below the center when taking the cut, in the same units as the wavelength.

Returns:

cut_data – Cut wavelengths and line profiles, errors if provided.

Return type:

ndarray

breidablik.analysis.tools.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.

Parameters:
  • wavelength (List[Real] or 1darray) – Input wavelengths. Needs to be monotonically increasing.

  • line_profile (List[Real] or 1darray) – Input line profile.

  • center (Real, optional) – 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.

  • upper (Positive Real, optional) – The amount to go above the center when taking calculating the REW, in the same units as the wavelength.

  • lower (Positive Real, optional) – The amount to go below the center when calculating the REW, in the same units as the wavelength.

  • num (Int, optional) – The number of points in the interpolation. Before calculating the REW, the line profile is interpolated to finer wavelength points.

Returns:

rew – The REW.

Return type:

float