Generalize plotting script for sigma tau.#11
Generalize plotting script for sigma tau.#11jwbishop wants to merge 7 commits intouafgeotools:masterfrom jwbishop:master
Conversation
|
Concerning mcthresh, it looks like the indices of array_thresh would be helpful? |
array_processing/tools/plotting.py
Outdated
| vplot = 1 | ||
| bplot = 2 | ||
| splot = bplot | ||
| if ccmplot is not False: |
There was a problem hiding this comment.
| if ccmplot is not False: | |
| if ccmplot: |
array_processing/tools/plotting.py
Outdated
|
|
||
| # Start Plotting | ||
| # Plot Trace | ||
| fig1, axarr1 = plt.subplots(num_subplots, 1, sharex='col') |
There was a problem hiding this comment.
| fig1, axarr1 = plt.subplots(num_subplots, 1, sharex='col') | |
| fig1, axs1 = plt.subplots(num_subplots, 1, sharex='col') |
array_processing/tools/plotting.py
Outdated
| # Plot Trace | ||
| fig1, axarr1 = plt.subplots(num_subplots, 1, sharex='col') | ||
| fig1.set_size_inches(10, 9) | ||
| axs1 = axarr1.ravel() |
There was a problem hiding this comment.
| axs1 = axarr1.ravel() |
array_processing/tools/plotting.py
Outdated
| # Colormap | ||
| cm = 'RdYlBu_r' | ||
| # Colorbar/y-axis for MdCCM | ||
| cax = 0.2, 1 |
There was a problem hiding this comment.
| cax = 0.2, 1 | |
| cax = (0.2, 1) |
There was a problem hiding this comment.
This just makes things a little more clear
array_processing/tools/plotting.py
Outdated
| axs1[2].set_ylim(.25,.45) | ||
| axs1[2].set_xlim(t[0],t[-1]) | ||
| # Plot MdCCM on its own plot | ||
| if ccmplot is not False: |
There was a problem hiding this comment.
| if ccmplot is not False: | |
| if ccmplot: |
array_processing/tools/plotting.py
Outdated
| baz: Array of back-azimuth estimates | ||
| ccmplot: Flag to plot the Mean/Median cross-correlation | ||
| maxima values on the y-axis in addition to the color scale. | ||
| sigma_tau: Array of sigma_tau values |
There was a problem hiding this comment.
Is sigma_tau just a boolean? This docstring entry is confusing. If boolean, it should be default False. If it can be an array, it should be default None.
array_processing/tools/plotting.py
Outdated
| t: Array processing time vector | ||
| mdccm: Median cross-correlation maxima | ||
| vel: Array of trace velocity estimates | ||
| baz: Array of back-azimuth estimates |
There was a problem hiding this comment.
We have baz here, but az in the function definition and elsewhere...
array_processing/tools/plotting.py
Outdated
| axs1[bplot].set_ylabel('Back-azimuth\n [deg]') | ||
|
|
||
| # Plot sigma_tau | ||
| if sigma_tau is not False: |
There was a problem hiding this comment.
| if sigma_tau is not False: | |
| if sigma_tau: |
| @@ -1,4 +1,4 @@ | |||
| #%% User-defined parameters | |||
| # %% User-defined parameters | |||
There was a problem hiding this comment.
Does this break the iPython cell?
|
Note that this addresses #8 |
|
This looks good to me and I can review it a bit more. Question though: should we try to generalize to accept LTS-flagged elements as well? Perhaps that can wait until the LTS code revisions are approved for public release. |
array_processing/tools/plotting.py
Outdated
| example: array_plot(stf,tvec,t,mdccm,vel,az,mcthresh): | ||
| Generalized plotting script for velocity - back-azimuth array processing. | ||
|
|
||
| @ Author: David Fee |
There was a problem hiding this comment.
Remove all author names in functions.
There was a problem hiding this comment.
I was wondering about this, ok!
davidfee5
left a comment
There was a problem hiding this comment.
Overall looks good to me. Thanks!
| fig1, axarr1 = plt.subplots(num_subplots, 1, sharex='col') | ||
| fig1.set_size_inches(10, 9) | ||
| axs1 = axarr1.ravel() | ||
| axs1[0].plot(tvec, st[0].data, 'k') |
There was a problem hiding this comment.
We could also add an option to plot the beam for a specified vel and baz, but perhaps that is best left for a future change
array_processing/tools/plotting.py
Outdated
| if ccmplot is not False: | ||
| sc = axs1[1].scatter(t, mdccm, c=mdccm, | ||
| edgecolors='k', lw=0.3, cmap=cm) | ||
| # axs1[1].plot([t[0], t[-1]], [mcthresh[0], mcthresh[1]], 'r--') |
array_processing/tools/plotting.py
Outdated
| mdccm: Median cross-correlation maxima | ||
| vel: Array of trace velocity estimates | ||
| baz: Array of back-azimuth estimates | ||
| ccmplot: Flag to plot the Mean/Median cross-correlation |
There was a problem hiding this comment.
Should it only be median xcorr? The rest of the code assumes it is mdccm. Is there a time we would want mccm? Probably not. Future option to think of: semblance instead of mdccm.
There was a problem hiding this comment.
Should it only be median xcorr? The rest of the code assumes it is mdccm. Is there a time we would want mccm? Probably not. Future option to think of: semblance instead of mdccm.
I'm actually a bit fan of the fisher statistics as well. We could modify to something like detection_metric. The code is agnostic to the actual meaning of that array. It's currently just used for the colorbar.
I thought about adding that as well, but it I think it's best to initially make the simple generalization. Adding LTS plotting functionality adds two more import statements and a minimum 20 code lines. |
… to full sentences.
Note changes to the arguments!
Flag for sigma_tau added. Additionally, optional flag for plotting the M(d)CCM on it's own subplot also added. Tested and consistent with wlsqva_proc.
Note: This update isn't 100% complete. I'm note sure yet what the (currently silent) argument of mcthresh does.