mirror of
https://gitlab.science.ru.nl/mthesis-edeboone/m-thesis-introduction.git
synced 2024-11-13 18:13:31 +01:00
ZH: improve temporary correlation figures
This commit is contained in:
parent
6eba992a3a
commit
0d8bce9953
1 changed files with 9 additions and 4 deletions
|
@ -93,18 +93,23 @@ def find_best_sample_shifts_summing_at_location(test_loc, antennas, allowed_samp
|
|||
shift_maxima[j] = np.max(augmented_a + a_sum)
|
||||
|
||||
if i in plot_iteration_with_shifted_trace:
|
||||
ax.plot(t_sum, augmented_a, alpha=0.8, label=f'{shift}')
|
||||
ax.plot(t_sum, augmented_a, alpha=0.7, ls='dashed', label=f'{shift}')
|
||||
|
||||
# transform maximum into best_sample_shift
|
||||
best_idx = np.argmax(shift_maxima)
|
||||
|
||||
best_sample_shifts[i] = allowed_sample_shifts[best_idx]
|
||||
a_sum += np.roll(a_int, best_sample_shifts[i])
|
||||
best_augmented_a = np.roll(a_int, best_sample_shifts[i])
|
||||
a_sum += best_augmented_a
|
||||
|
||||
# cleanup figure
|
||||
if i in plot_iteration_with_shifted_trace:
|
||||
ax.legend( ncol=5)
|
||||
if True: # plot best k again
|
||||
ax.plot(t_sum, augmented_a, alpha=0.8, label=f'best k={best_sample_shifts[i]}', lw=2)
|
||||
|
||||
ax.legend( ncol=5 )
|
||||
if fig_dir:
|
||||
fig.tight_layout()
|
||||
fname = path.join(fig_dir, __file__ + f'.{fig_distinguish}i{i}' + '.loc{:.1f}-{:.1f}-{:.1f}'.format(*test_loc))
|
||||
if True:
|
||||
old_xlim = ax.get_xlim()
|
||||
|
@ -117,7 +122,7 @@ def find_best_sample_shifts_summing_at_location(test_loc, antennas, allowed_samp
|
|||
|
||||
if True: # zoomed on peak of this trace
|
||||
x = t_r[np.argmax(E_)]
|
||||
wx = 10 + max(best_sample_shifts) - min(best_sample_shifts)
|
||||
wx = 50 + (max(best_sample_shifts) - min(best_sample_shifts))*dt
|
||||
ax.set_xlim(x-wx, x+wx)
|
||||
fig.savefig(fname + ".zoomed.peak.pdf")
|
||||
|
||||
|
|
Loading…
Reference in a new issue