In [ ]:
import os
import sys

path_root = os.path.expanduser('~/Sn/Release/python/pystella')
sys.path.append(path_root)

% matplotlib inline
from matplotlib import pyplot as plt
import numpy as np

from pystella.model.popov import Popov
from pystella.rf.rad_func import Lum2MagBol

In [ ]:
p = Popov('test', R=500, M=15, Mni=0.07, E=7e50)

In [ ]:
n = 100
start, end = 0.1, 200.  # days
# time = np.linspace(start, end, n)
time = np.exp(np.linspace(np.log(start), np.log(end), n))

mags = p.MagBol(time)
mags_ni = Lum2MagBol(p.e_rate_ni(time))

In [ ]:
# plot
plt.plot(time, mags, color='blue', label='L bol')
plt.plot(time, mags_ni, color='red', label='Eni rate')
plt.gca().invert_yaxis()
plt.xlabel('Time [day]')
plt.ylabel('Absolute Magnitude')
plt.legend()
plt.show()

In [ ]: