80 lines
2.6 KiB
Python
80 lines
2.6 KiB
Python
import matplotlib.pyplot as plt
|
|
|
|
from python.ste import *
|
|
from python.helpers import *
|
|
|
|
# Simulation parameter
|
|
motion = 'IsotropicAngle'
|
|
distribution = 'Delta'
|
|
# parameter = {}
|
|
parameter = {
|
|
"angle": np.linspace(1, 180, num=180),
|
|
"eta": 0.1
|
|
# "sigma": 0.1,
|
|
# "tau": np.logspace(-1, 1, num=3)
|
|
}
|
|
|
|
parameter = prepare_rw_parameter(parameter)
|
|
|
|
# fig_tau_cc, ax_tau_cc = plt.subplots()
|
|
# ax_tau_cc.set_title('tau_cc')
|
|
#
|
|
# fig_beta_cc, ax_beta_cc = plt.subplots()
|
|
# ax_beta_cc.set_title('beta_cc')
|
|
#
|
|
# fig_finfty_cc, ax_finfty_cc = plt.subplots()
|
|
# ax_finfty_cc.set_title('f_infty_cc')
|
|
#
|
|
# fig_tau_ss, ax_tau_ss = plt.subplots()
|
|
# ax_tau_ss.set_title('tau_ss')
|
|
#
|
|
# fig_beta_ss, ax_beta_ss = plt.subplots()
|
|
# ax_beta_ss.set_title('beta_ss')
|
|
#
|
|
# fig_finfty_ss, ax_finfty_ss = plt.subplots()
|
|
# ax_finfty_ss.set_title('f_infty_ss')
|
|
|
|
tau_ss_angles = []
|
|
tau_cc_angles = []
|
|
tau_2_angles = []
|
|
angles = []
|
|
|
|
for variation in parameter:
|
|
print(f"\nRun RW for {motion}/{distribution} with arguments {variation}\n")
|
|
run_sims(motion, distribution, ste=True, spectrum=False, **variation)
|
|
|
|
conf_file = find_config_file(motion, distribution, variation)
|
|
|
|
vary_string, tau_cc, beta_cc, finfty_cc = fit_and_save_ste(conf_file, 'coscos', plot_decays=False, verbose=False)
|
|
_, tau_ss, beta_ss, finfty_ss = fit_and_save_ste(conf_file, 'sinsin', plot_decays=False, verbose=False)
|
|
_, tau_2, beta_2, finfty_2 = fit_and_save_ste(conf_file, 'f2', plot_decays=False, verbose=True)
|
|
|
|
# ax_tau_cc.semilogy(tau_cc[:, 0], tau_cc[:, 1], label=vary_string)
|
|
# ax_tau_cc.axhline(tau_2[:, 1], color='k', linestyle='--')
|
|
# ax_beta_cc.plot(*beta_cc.T, label=vary_string)
|
|
# ax_finfty_cc.plot(*finfty_cc.T, label=vary_string)
|
|
# ax_tau_ss.semilogy(tau_ss[:, 0], tau_ss[:, 1], label=vary_string)
|
|
# ax_tau_ss.axhline(tau_2[:, 1], color='k', linestyle='--')
|
|
# ax_beta_ss.plot(*beta_ss.T, label=vary_string)
|
|
# ax_finfty_ss.plot(*finfty_ss.T, label=vary_string)
|
|
|
|
angles.append(variation['angle'])
|
|
tau_ss_angles.append(tau_ss[0, 1])
|
|
tau_cc_angles.append(tau_cc[0, 1])
|
|
tau_2_angles.append(tau_2[0, 1])
|
|
|
|
|
|
fig, ax = plt.subplots()
|
|
ax.semilogy(angles, tau_ss_angles, 'o', label='SS (4.9mus)')
|
|
ax.plot(angles, tau_cc_angles, 'o', label='CC (4.9mus)')
|
|
ax.plot(angles, tau_2_angles, 'o', label='F2')
|
|
ax.legend()
|
|
|
|
np.savetxt('angle_eta.dat', np.c_[angles, tau_cc_angles, tau_ss_angles, tau_2_angles], header='#x\tcc\tss\tf2')
|
|
|
|
fig2, ax2 = plt.subplots()
|
|
ax2.plot(angles, np.array(tau_cc_angles)/np.array(tau_2_angles), 'o')
|
|
|
|
# for ax in [ax_tau_cc, ax_beta_cc, ax_finfty_cc, ax_tau_ss, ax_beta_ss, ax_finfty_ss]:
|
|
# ax.legend()
|
|
plt.show() |