Kippenhahn Diagram


In [6]:
%pylab nbagg
from ppmpy import ppm
from nugridpy import mesa as ms
import numpy as np
import matplotlib.pyplot as plt
from nugridpy.utils import colourblind as cb

data_dir='/data/ppm_rpod2/'


Populating the interactive namespace from numpy and matplotlib

In [7]:
model_dir = data_dir+'/Stellar_models/AGBTP_M2.0Z1.e-5/M2.00Z1.e-5/LOGS/'
hd = ms.history_data(model_dir)


Using old star.logsa file ...
 reading ...100% 


In [8]:
modstart = 15000
modstop = 32000
#modstart = 29400
#modstop = 29900
xres = 2000
yres = 2000
ylims = [0.605, 0.64]
#figsize=(6, 4)
#dpi = 125
figsize = None
dpi = None

ppm_mod_num = 24150
mod_num = hd.get('model_number')
age = hd.get('star_age')
idx = np.argmin(np.abs(mod_num - ppm_mod_num))
ppm_age = age[idx]

idx0 = np.argmin(np.abs(mod_num - modstart))
age0 = age[idx0]

ifig = 1; plt.close(ifig); fig = plt.figure(ifig, figsize=figsize, dpi=dpi)
hd.kip_cont(ifig=ifig, modstart=modstart, modstop=modstop, \
            t0_model=modstart, ixaxis='age', xres=xres, yres=yres, ylims=ylims)
plt.gca().ticklabel_format(style='sci', scilimits=(0,0), axis='both')
plt.axvline(ppm_age - age0, ls=':', color=cb(8))
plt.xlabel('t / yr')
fig.tight_layout()


 creating color map burn ...100% 

 creating color map mix ...100% 

engenstyle was  full
mixstyle was  full

 finished preparing color map
Closing star.log  tool ...
plot versus age
plotting contours
/usr/local/lib/python3.5/dist-packages/matplotlib/contour.py:1518: UserWarning: Log scale: values of z <= 0 have been masked
  warnings.warn('Log scale: values of z <= 0 have been masked')
plotting patches
plotting abund boundaries

In [9]:
modstart = 29400
modstop = 29850
xres = 2000
yres = 2000
ylims = [0.605, 0.64]
#figsize=(6, 4)
#dpi = 125
figsize = None
dpi = None

ifig = 2; plt.close(ifig); fig = plt.figure(ifig, figsize=figsize, dpi=dpi)
hd.kip_cont(ifig=ifig, modstart=modstart, modstop=modstop, \
            t0_model=modstart, ixaxis='age', xres=xres, yres=yres, ylims=ylims)
plt.gca().ticklabel_format(style='sci', scilimits=(0,0), axis='both')
plt.xlabel('t / yr')
fig.tight_layout()


 creating color map burn ...100% 

 creating color map mix ...100% 

engenstyle was  full
mixstyle was  full

 finished preparing color map
plot versus age
plotting contours
/usr/local/lib/python3.5/dist-packages/matplotlib/contour.py:1518: UserWarning: Log scale: values of z <= 0 have been masked
  warnings.warn('Log scale: values of z <= 0 have been masked')
plotting patches
plotting abund boundaries

In [ ]: