Page MenuHomec4science

pycool_plot_cooling_from_hdf5
No OneTemporary

File Metadata

Created
Mon, Jun 9, 02:57

pycool_plot_cooling_from_hdf5

#!/usr/bin/env python
from numpy import *
import PyCool.compute_lambda_interface as cl
import sys
import Ptools as pt
nHe = 0.16
rho_H = 1e-4
metalicity = 0.01; #
z = 8
T_s = 10**arange(1,8,0.01)
Lambda_n_s = zeros(len(T_s),float32)
# read tables
cl.updateCoolingTable();
cl.SetRedshift(z)
cl.checkRedshiftForUpdate();
for i,T in enumerate(T_s):
Lambda_n_s[i] = fabs(cl.computeLambda(rho_H, T, nHe, metalicity))
print " ",i,T,Lambda_n_s[i]
########################################################################
# plot
########################################################################
import Ptools as pt
pt.axis([1,8,-30,-20])
pt.xlabel('log T')
pt.ylabel('log Lambda/nH2')
pt.plot(log10(T_s),log10(Lambda_n_s))
#pt.legend(loc=4)
pt.show()
cl.freeMemory();

Event Timeline