Skip to content

Commit

Permalink
Increase correlation stack median value output accuracy to 3 digits
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyPechnikov committed Feb 1, 2024
1 parent 35a3217 commit e6c1f91
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pygmtsar/pygmtsar/Stack_phasediff.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand All @@ -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()

0 comments on commit e6c1f91

Please sign in to comment.