Utility functions

sed_analysis_tools.sed_analysis_tools.L_T_to_R(L: Unit('solLum'), T: Unit('K')) Quantity

Calculate the radius of a star based on its luminosity and temperature.

Parameters:
  • L (u.Quantity) – Luminosity of the star in solar luminosities (Lsun).

  • T (u.Quantity) – Temperature of the star in Kelvins.

Returns:

The radius of the star in solar radii (Rsun).

Return type:

u.Quantity

Examples

>>> L = 1 * u.solLum
>>> T = 5800 * u.K
>>> L_T_to_R(L, T)
<Quantity 0.990... solRad>
sed_analysis_tools.sed_analysis_tools.R_distance_to_sf(radius: Unit('m'), distance: Unit('m')) Quantity

Calculate the scaling factor for a given radius and distance.

Parameters:
  • radius (u.Quantity) – The radius of the star in meters.

  • distance (u.Quantity) – The distance to the star in meters.

Returns:

The scaling factor (dimensionless).

Return type:

float

Examples

>>> radius = 1 * u.Rsun
>>> distance = 10 * u.pc
>>> R_distance_to_sf(radius, distance)
5.083...e-18
sed_analysis_tools.sed_analysis_tools.R_T_to_L(radius: Unit('m'), T: Unit('K')) Quantity

Calculate the luminosity of a star based on its radius and temperature.

Uses the Stefan-Boltzmann law to determine the luminosity.

Parameters:
  • radius (u.Quantity) – The radius of the star in meters.

  • T (u.Quantity) – The temperature of the star in Kelvins.

Returns:

The luminosity of the star in solar luminosities (Lsun).

Return type:

u.Quantity

Examples

>>> radius = 1 * u.Rsun
>>> T = 5800 * u.K
>>> R_T_to_L(radius, T)
<Quantity 1.019... solLum>
sed_analysis_tools.sed_analysis_tools.sf_distance_to_R(sf: float, distance: Unit('m')) Quantity

Calculate the radius of a star based on the scaling factor and distance.

Parameters:
  • sf (float) – Scaling factor (dimensionless).

  • distance (u.Quantity) – Distance to the star in meters.

Returns:

The radius of the star in solar radii (Rsun).

Return type:

u.Quantity

Examples

>>> sf = 1e-17
>>> distance = 10 * u.pc
>>> sf_distance_to_R(sf, distance)
<Quantity 1.4025... solRad>
sed_analysis_tools.sed_analysis_tools.T_sf_distance_to_L(T: Unit('K'), sf: float, distance: Unit('pc')) Quantity

Calculate luminosity based on temperature, scaling factor, and distance.

Parameters:
  • T (u.Quantity) – Temperature in Kelvins.

  • sf (float) – Scaling factor (dimensionless).

  • distance (u.Quantity) – Distance to the star in parsecs.

Returns:

Luminosity in solar luminosities (Lsun).

Return type:

u.Quantity

Examples

>>> T = 5800 * u.K
>>> sf = 1e-17
>>> distance = 10 * u.pc
>>> T_sf_distance_to_L(T, sf, distance)
<Quantity 2.0056... solLum>