pyraliddemo.example.classes
CLASSES MODULE.
This module provides examples of how write classes according to the standards proposed by this template.
The D107 error
is supressed througout the package to avoid havving to document
__init__ methods, which is permitted by numpydoc standards.
-
class
StefBoltz(radius: float, eff_temp: float)[source] -
Bases:
objectThe Stefan–Boltzmann Law.
A basic class implementation of the Stefan-Boltzmann law.
-
sigma -
Stefan-Boltzmann constant (\(5.6704\times 10^{-8} \mathrm{W} \mathrm{m}^{-2}\mathrm{K}^{-4}\))
- Type
-
luminosity() → float[source] -
Luminosity.
Calculate the luminosity of a star.
- Returns
Stellar luminosity in Watts
- Return type
Examples
Calculate the luminosity of the Sun
python>>> from pyraliddemo.example.classes import StefBoltz >>> r_sun = 7e8 >>> t_sun = 5800 >>> StefBoltz(r_sun, t_sun).luminosity() 3.951223664081994e+26Notes
This method implements the following equation
\[L = 4\pi R^2\sigma T_e^4\]where:
\(L\) is the luminosity,
\(R\) is the stellar radius,
\(\sigma\) is Stefan-Boltzmann constant,
and \(T_e\) is the effective temperature.
-