get_surrounding_teffs#

VSPEC.helpers.get_surrounding_teffs(Teff: astropy.units.Quantity)#

Get the effective temperatures (Teffs) of the two spectra to interpolate between in order to obtain a spectrum with the target Teff.

This function is useful for determining the Teffs of the two spectra that surround a given target Teff value, which are necessary for performing interpolation to obtain a spectrum with the desired Teff.

Parameters:

Teff (astropy.units.Quantity) – The target Teff for the interpolated spectrum.

Returns:

  • low_teff (astropy.units.Quantity) – The Teff of the spectrum below the target Teff.

  • high_teff (astropy.units.Quantity) – The Teff of the spectrum above the target Teff.

Raises:

ValueError – If the target Teff is a multiple of 100 K, which would cause problems with scipy interpolation.

Notes

  • The function checks if the target Teff is a multiple of 100 K. If it is, a ValueError is raised because this would lead to issues with scipy interpolation.

  • If the target Teff is not a multiple of 100 K, the function determines the Teff of the spectrum

    below the target Teff by rounding down to the nearest multiple of 100 K, and the Teff of the spectrum above the target Teff is obtained by adding 100 K to the low Teff.

Examples

>>> Teff = 5500 * u.K
>>> get_surrounding_teffs(Teff)
(<Quantity 5500. K>, <Quantity 5600. K>)