In [1]:
%matplotlib inline
from galaxy_analysis.plot.plot_styles import *
import numpy as np
import matplotlib.pyplot as plt
import deepdish as dd

In [2]:
from galaxy_analysis.analysis import PDF

In [15]:
filename = "/home/aemerick/work/stellar_env/elements/gas_abundances_5Myr.h5"
dsnum    = np.arange(50, 550, 5)
dsarray  = ['DD%0004i'%(x) for x in dsnum]
time     = dsnum*1.0

In [16]:
CNM = PDF.gather_time_series(filename, dsarray, 'CNM', 'O_Fraction')
WNM = PDF.gather_time_series(filename, dsarray, 'WNM', 'O_Fraction')
HIM = PDF.gather_time_series(filename, dsarray, 'HIM', 'O_Fraction')

In [17]:
fig,ax = plt.subplots(1,1)
fig.set_size_inches(6,6)

def d9d1(d9, d1):
    return np.log10(d9) - np.log10(d1)

ax.plot(time, d9d1(CNM['decile_9'],CNM['decile_1']), lw = 3, color = 'C0', label = 'CNM')
ax.plot(time, d9d1(WNM['decile_9'],WNM['decile_1']), lw = 3, color = 'C1', label = 'WNM')
ax.plot(time, d9d1(HIM['decile_9'],HIM['decile_1']), lw = 3, color = 'C2', label = 'HIM')

ax.set_xlabel('Time')
ax.set_ylabel('D9 - D1 range (dex)')

plt.tight_layout()
ax.legend(loc='best')


Out[17]:
<matplotlib.legend.Legend at 0x7f49bc07b350>

In [18]:
CNM = PDF.gather_time_series(filename, dsarray, 'CNM', 'N_Fraction')
WNM = PDF.gather_time_series(filename, dsarray, 'WNM', 'N_Fraction')
HIM = PDF.gather_time_series(filename, dsarray, 'HIM', 'N_Fraction')

fig,ax = plt.subplots(1,1)
fig.set_size_inches(6,6)

def d9d1(d9, d1):
    return np.log10(d9) - np.log10(d1)

ax.plot(time, d9d1(CNM['decile_9'],CNM['decile_1']), lw = 3, color = 'C0', label = 'CNM')
ax.plot(time, d9d1(WNM['decile_9'],WNM['decile_1']), lw = 3, color = 'C1', label = 'WNM')
ax.plot(time, d9d1(HIM['decile_9'],HIM['decile_1']), lw = 3, color = 'C2', label = 'HIM')

ax.set_xlabel('Time')
ax.set_ylabel('D9 - D1 range (dex)')

plt.tight_layout()
ax.legend(loc='best')


Out[18]:
<matplotlib.legend.Legend at 0x7f49bc00ca50>

In [ ]: