Plot_me.py
Go to the documentation of this file.
1 # Author: M. Reichert
2 import numpy as np
3 import matplotlib.pyplot as plt
4 # Import the WinNet python plot-routine
5 # Note that you can also just append the path to your .bashrc
6 import sys
7 sys.path.append('../../bin')
8 from class_files.winnet_class import winnet
9 
10 fig = plt.figure(figsize=(10,5))
11 ax = fig.gca()
12 
13 # Load data from the mainout
14 mrsn_example = winnet('.')
15 
16 mrsn_example.read_mainout()
17 time = mrsn_example.get_mainout_time()
18 yheavy = mrsn_example.get_mainout_yheavy()
19 yn = mrsn_example.get_mainout_yn()
20 
21 # Calculate freezeout point#
22 # Assume that the output is frequent enough
23 index_freezout = np.argmin(abs(yn/yheavy-1))
24 time_freezout = time[index_freezout]
25 
26 # Plot the path of abundances in the nuclear chart at freezeout
27 # This only works if snapshots were enabled!!
28 anim = mrsn_example.animate_nuclear_chart(figure=fig,plot_magic=True,time_title=True,min_X=1e-8,element_labels=False)
29 # To make only one snapshot at freezeout you can plot it with:
30 # mrsn_example.plot_nuclear_chart_at(time_freezout,figure=fig,plot_magic=True,time_title=True,min_X=1e-8,element_labels=False)
31 
32 
33 ax.set_xlim(40,130)
34 ax.set_ylim(25,75)
35 plt.show()