Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plot beam on Infraview Beamforming table instead of selected waveform #7

Open
fkdannemann opened this issue Jul 15, 2020 · 2 comments
Assignees

Comments

@fkdannemann
Copy link
Collaborator

@jwebster-LANL it would help with picking to plot the beamed signal in the beamforming tab instead of just a selected trace. The bottom section of /examples/test_beamforming highlights how to pull out the beam and residual, and plot.

    back_az = beam_results[np.argmax(beam_results[:, 2]), 0]
    tr_vel = beam_results[np.argmax(beam_results[:, 2]), 1]

    X, S, f = beamforming_new.fft_array_data(x, t, window=[sig_start, sig_end], fft_window="boxcar")
    sig_est, residual = beamforming_new.extract_signal(X, f, np.array([back_az, tr_vel]), geom)

    plt.figure(3)
    plt.loglog(f, abs(sig_est), '-b', linewidth=1.0)
    plt.loglog(f, np.mean(abs(residual), axis=0), '-k', linewidth=0.5)

    signal_wvfrm = np.fft.irfft(sig_est) / (t[1] - t[0])
    resid_wvfrms = np.fft.irfft(residual, axis=1) / (t[1] - t[0])
    t_mask = np.logical_and(sig_start < t, t < sig_end)

    plt.figure(4)
    for m in range(M):
        plt.subplot(M + 1, 1, m + 1)
        plt.xlim([t[t_mask][0], t[t_mask][-1]])
        plt.plot(t[t_mask], x[m, t_mask], '0.5')
        plt.plot(t[t_mask], resid_wvfrms[m, :len(t[t_mask])], 'k-')
        plt.setp(plt.subplot(M + 1, 1, m + 1).get_xticklabels(), visible=False)
    plt.subplot(M + 1, 1, M + 1)
    plt.xlim([t[t_mask][0], t[t_mask][-1]])
    plt.plot(t[t_mask], signal_wvfrm[:len(t[t_mask])], 'b-')
@jwebster-LANL
Copy link
Collaborator

so after the beamformer runs, replace the trace with the beamed signal? Would it be useful to plot both the trace and the beamed signal? maybe be able to toggle back and forth?

in the code above, is it signal_wvfrm you want? Or resid_wvfrms?

@fkdannemann
Copy link
Collaborator Author

Yeah I was just thinking about this, and maybe a toggle between the trace and beam would be best. Or an option 'plot beam' or 'plot trace'? Some people may not need the additional beam step.

signal_wvfrm is what should be plotted. But actually it may be helpful to also have an option to plot both signal_wvfrm and resid_wvfrm (in different colors)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants