Page MenuHomec4science

pycool_plot_cooling_from_hdf5_bis
No OneTemporary

File Metadata

Created
Fri, Sep 27, 21:07

pycool_plot_cooling_from_hdf5_bis

#!/usr/bin/env python
from numpy import *
import PyCool.compute_lambda_interface as cl
import sys
import Ptools as pt
# read tables
cl.updateCoolingTable();
nHe = 0.16
rho_H = 0.2
#z = 8. # redshift ???? not used !!!
metalicity = 0.01; #
Z_s = arange(0,20,0.1)
Lambda_n_s = zeros(len(Z_s),float32)
T = 1e5
for i,Z in enumerate(Z_s):
cl.SetRedshift(Z)
cl.checkRedshiftForUpdate();
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([0,20,-30,-20])
pt.xlabel('Z')
pt.ylabel('log Lambda/nH2')
pt.plot(Z_s,log10(Lambda_n_s))
#pt.legend(loc=4)
pt.show()
cl.freeMemory();

Event Timeline