From 79ad5794b7d72b2c350deb3c4c2db5a0727d739b Mon Sep 17 00:00:00 2001 From: Dominik Demuth Date: Mon, 11 Nov 2024 11:04:00 +0100 Subject: [PATCH] move files --- config.txt | 16 +++++++++++----- test.py | 13 +++++++++---- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/config.txt b/config.txt index 3f4fa1e..8b1bb4f 100644 --- a/config.txt +++ b/config.txt @@ -1,11 +1,14 @@ # Simulation part num_walker=20000 # Motion model part -delta=161e3 -eta=0.2 +delta=126e3 +eta=0.0 # Distribution part # this tau value is overwritten if sim is run with test.py tau=1e-1 +angle1=2 +angle2=30 +probability1=0.98 # Spectrum part dwell_time=1e-6 num_acq=4096 @@ -14,8 +17,11 @@ techo_stop=40e-6 techo_steps=5 # STE part tevo_start=1e-6 -tevo_stop=60e-6 -tevo_steps=121 +tevo_stop=120e-6 +tevo_steps=8 tmix_start=1e-5 tmix_stop=1e1 -tmix_steps=61 \ No newline at end of file +tmix_steps=31 +tau=0.01 +tau=0.01 +tau=0.01 diff --git a/test.py b/test.py index 5f0cdcb..8264084 100644 --- a/test.py +++ b/test.py @@ -17,6 +17,8 @@ def run_sims(taus, ste: bool = True, spectrum: bool = False, exec_file: str = '. arguments += ['BimodalAngle'] + # arguments += ['-TAU', '1'] + with pathlib.Path(config_file).open('a') as f: f.write(f'tau={tau}\n') @@ -69,7 +71,7 @@ def post_process_spectrum(taus, apod, tpulse): def post_process_ste(taus): - tevo = np.linspace(1e-6, 120e-6, num=121) + tevo = np.linspace(1e-6, 120e-6, num=8) for i, tau in enumerate(taus): try: @@ -83,7 +85,7 @@ def post_process_ste(taus): fig_cc_raw, ax_cc_raw = plt.subplots() fig_ss_raw, ax_ss_raw = plt.subplots() - ax_cc_raw.semilogx(t_mix, raw_data_cc[:, 1:], '.') + # ax_cc_raw.semilogx(t_mix, raw_data_cc[:, 1:], '.') ax_ss_raw.semilogx(t_mix, raw_data_ss[:, 1:], '.') scaled_cc = (raw_data_cc[:, 1:]-raw_data_cc[-1, 1:])/(raw_data_cc[0, 1:]-raw_data_cc[-1, 1:]) @@ -113,9 +115,11 @@ def post_process_ste(taus): 0.1 ] - res = curve_fit(ste, t_mix, raw_data_cc[:, j+1], p0, bounds=[(0, 0, 0, 0), (np.inf, np.inf, 1, 1)]) + res = curve_fit(ste, t_mix, raw_data_cc[:, j+1], p0, bounds=[(0, 0, 0., 0), (np.inf, np.inf, 1, 1)]) m0, tauc, beta, finfty = res[0] # print(f'Cos-Cos-Fit for {tevo[j]}: tau_c = {tauc:.6e}, beta={beta:.4e}, amplitude = {m0: .4e}, f_infty={finfty:.4e}') + l = ax_cc_raw.semilogx(t_mix, raw_data_cc[:, j+1], 'x', label=f'{tevo[j]}') + ax_cc_raw.semilogx(t_mix, ste(t_mix, *res[0]), linestyle='--', color = l[0].get_color()) tau_cc_fit.append(res[0][1]) beta_cc_fit.append(res[0][2]) @@ -139,7 +143,7 @@ def post_process_ste(taus): p0 = [ raw_data_cc[0, 1], t_mix[np.argmin(np.abs(scaled_ss[:, j]-np.exp(-1)))], - 1, + 0.5, 0.1 ] @@ -165,6 +169,7 @@ def post_process_ste(taus): ax_beta.plot(tevo[1:], beta_plus_fit, 'C2-') ax_finfty.plot(tevo[1:], finfty_plus_fit, 'C2-') + ax_cc_raw.legend() plt.show() # np.savetxt('cc_tauc.dat', list(zip(tevo[1:], tau_cc_fit)))