From 468c0b07d69bbf5d5700e6e188fcdb348aaaca70 Mon Sep 17 00:00:00 2001 From: Alexey Pechnikov Date: Sat, 3 Aug 2024 23:01:46 +0700 Subject: [PATCH] Decrease bursts transparency in plot_scenes() --- pygmtsar/pygmtsar/Stack.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pygmtsar/pygmtsar/Stack.py b/pygmtsar/pygmtsar/Stack.py index 821c187..3c57fc3 100644 --- a/pygmtsar/pygmtsar/Stack.py +++ b/pygmtsar/pygmtsar/Stack.py @@ -136,10 +136,8 @@ def plot_scenes(self, dem='auto', image=None, alpha=None, caption='Estimated Sce # Calculate overlaps including self-overlap overlap_count = [sum(1 for geom2 in gdf.geometry if geom1.intersects(geom2)) for geom1 in gdf.geometry] - # define transparency for the calculated overlaps - gdf_alpha = 1/max(overlap_count) - # apply minimum transparency threshold - gdf.reset_index().plot(color=[colors[k] for k in gdf.index], alpha=max(gdf_alpha, 0.002), edgecolor='black', ax=plt.gca()) + # define transparency for the calculated overlaps and apply minimum transparency threshold + gdf.reset_index().plot(color=[colors[k] for k in gdf.index], alpha=max(2/max(overlap_count), 0.002), edgecolor='black', ax=plt.gca()) self.plot_AOI(**kwargs) self.plot_POI(**kwargs) if aspect is not None: