Binder badge
GitHub badge

Example Notebook

This notebook demonstrates how to use the package API.

Hello World Example

The following cell calls the hello_world function and prints the output.

none
[1]:
ipython3
from pyraliddemo.example.hello import hello_world

print(hello_world())
Hello World!

Stefan-Boltzmann Example

The following cell calls the StefBoltz class and prints the luminosity corresponding to the radius and effective temperature provided.

none
[2]:
ipython3
from pyraliddemo.example.classes import StefBoltz

r_sun = 7e8  # m
t_sun = 5800  # K

luminosity = StefBoltz(r_sun, t_sun).luminosity()

print('The luminosity is {0:.2e}w.'.format(luminosity))
The luminosity is 3.95e+26w.