# save data = np.c_[np.log10(E / eV), rate_save] # prepend log10(E/eV) as first column row0 = np.r_[0, np.log10(skin_save / eV**2)][np.newaxis] data = np.r_[row0, data] # prepend log10(s_kin/eV^2) as first row fname = folder + '/cdf_%s.txt' % field.name fmt = '%.2f' + '\t%.6g' * np.shape(rate_save)[1] header = '%s cumulative differential rate\nphoton field: %s\nlog10(E/eV), d(1/lambda)/ds_kin [1/Mpc/eV^2] for log10(s_kin/eV^2) as given in first row' % ( name, field.info) np.savetxt(fname, data, fmt=fmt, header=header) fields = [ photonField.CMB(), photonField.EBL_Kneiske04(), photonField.EBL_Stecker05(), photonField.EBL_Franceschini08(), photonField.EBL_Finke10(), photonField.EBL_Dominguez11(), photonField.EBL_Gilmore12(), photonField.EBL_Stecker16('lower'), photonField.EBL_Stecker16('upper'), photonField.URB_Protheroe96() ] for field in fields: print(field.name) process(sigmaPP, field, 'EMPairProduction') process(sigmaDPP, field, 'EMDoublePairProduction')
('xs', '%if8' % len(eps))]) d3exc = np.genfromtxt(ddir2 + 'xs_photon_thin.txt', dtype=[('Z', int), ('N', int), ('Zd', int), ('Nd', int), ('Ephoton', float), ('xs', '%if8' % len(eps))]) # Pad cross sections to next larger 2^n + 1 tabulation points for Romberg integration and convert to SI units eps3 = eps2 xs3sum = np.array([interactionRate.romb_pad_zero(x, 513) for x in d3sum['xs']]) * 1e-31 xs3exc = np.array([interactionRate.romb_pad_zero(x, 513) for x in d3exc['xs']]) * 1e-31 # ---------------------------------------------------- # Calculate interaction rates and branching ratios # ---------------------------------------------------- fields = [ photonField.CMB(), photonField.EBL_Kneiske04(), photonField.EBL_Stecker05(), photonField.EBL_Franceschini08(), photonField.EBL_Finke10(), photonField.EBL_Dominguez11(), photonField.EBL_Gilmore12(), photonField.EBL_Stecker16('upper'), photonField.EBL_Stecker16('lower') ] for field in fields: print(field.name) # output folder folder = 'data/Photodisintegration'