From e6c1f9117bb14e117b12b1a46146136d5ee681d6 Mon Sep 17 00:00:00 2001 From: Alexey Pechnikov Date: Thu, 1 Feb 2024 23:10:05 +0700 Subject: [PATCH] Increase correlation stack median value output accuracy to 3 digits --- pygmtsar/pygmtsar/Stack_phasediff.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pygmtsar/pygmtsar/Stack_phasediff.py b/pygmtsar/pygmtsar/Stack_phasediff.py index 92d18e75..fd0f9a27 100644 --- a/pygmtsar/pygmtsar/Stack_phasediff.py +++ b/pygmtsar/pygmtsar/Stack_phasediff.py @@ -876,7 +876,7 @@ def plot_correlation_stack(self, corr_stack, threshold='auto', caption='Correlat name='custom_gray', colors=['black', 'whitesmoke'] ) - + data = corr_stack.values.flatten() median_value = np.nanmedian(data) if isinstance(threshold, str) and threshold == 'auto': @@ -891,13 +891,13 @@ def plot_correlation_stack(self, corr_stack, threshold='auto', caption='Correlat axs[0].axvline(median_value, color='red', linestyle='dashed') axs[0].set_xlim([0, 1]) axs[0].grid() - axs[0].set_title(f'Histogram Median={median_value:.2f}') + axs[0].set_title(f'Histogram Median={median_value:.3f}') axs[0].set_xlabel('Correlation') axs[0].set_ylabel('Count') ax2.set_ylabel('Cumulative Count', color='orange') corr_stack.where(corr_stack >= threshold).plot.imshow(cmap=cmap, vmin=0, vmax=1, ax=axs[1]) - axs[1].set_title(f'Threshold >= {threshold:0.2f}') + axs[1].set_title(f'Threshold >= {threshold:0.3f}') plt.suptitle(caption) plt.tight_layout()