def hmf_halofit(): #https://github.com/steven-murray/hmf/blob/master/development/halofit_testing.ipynb from hmf.transfer import Transfer teh_nl_tk = Transfer(transfer_model="EH", takahashi=True, z=0.0) teh_nl_ntk = Transfer(transfer_model="EH", takahashi=False, z=0.0) teh_nl_tk.update(z=0) #plt.plot(teh_nl_tk.k, np.abs(teh_nl_ntk.nonlinear_power/teh_nl_tk.nonlinear_power -1)) ax0.loglog(teh_nl_ntk.k, teh_nl_ntk.nonlinear_power, 'k--') ax0.loglog(teh_nl_ntk.k, teh_nl_ntk.power, 'k-.')
plt.legend(loc = "lower left") plt.show() #plt.savefig('plots/hmf_OmegaM', bbox_inches='tight') # Check if log scale is working properly plt.figure(10) plt.plot(Mass) plt.plot(Mass[::10], 'o') plt.yscale('log') plt.show() from hmf.transfer import Transfer teh_nl_tk = Transfer(transfer_model="EH", takahashi=True, z= 8.0) teh_nl_ntk = Transfer(transfer_model="EH", takahashi=False, z=8.0) teh_nl_tk.update(z=0) plt.plot(teh_nl_tk.k, np.abs(teh_nl_ntk.nonlinear_power/teh_nl_tk.nonlinear_power -1)) #plt.plot(teh_nl_ntk.k, teh_nl_ntk.nonlinear_power) #plt.plot(teh_nl_ntk.k, teh_nl_ntk.power) plt.xscale('log') #plt.yscale('log') plt.grid(True)