Skip to content

Commit

Permalink
Add 'legend_alpha' option for plot_baseline_displacement() function
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Pechnikov committed Apr 11, 2024
1 parent 9dedde9 commit 1d69265
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pygmtsar/pygmtsar/Stack_sbas.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,8 @@ def plot_baseline_deviation(self, baseline_pairs, pairs_best=None, column='stdde
def plot_baseline_displacement(self, phase, corr=None, caption=None, cmap='turbo',
displacement=True, unwrap=True,
stl=False, stl_freq='W', stl_periods=52, stl_robust=True,
los=False, tolerance=np.pi/2, xlabel_rotation=45):
los=False, tolerance=np.pi/2, xlabel_rotation=45,
legend=True, legend_alpha=None):
"""
Performs 1D unwrapping, linear regression, and STL on a given set of phase values.
Expand Down Expand Up @@ -898,17 +899,19 @@ def plot_baseline_displacement(self, phase, corr=None, caption=None, cmap='turbo
+ (f' RMSE={rmse:0.3f} [{unit}]' if displacement or stl else '') \
+ (f'\n{caption}' if caption is not None else ''))
plt.xlim([dates[0], dates[-1]])
if displacement or stl:
plt.legend()
if (displacement or stl) and legend:
plt.legend(framealpha=legend_alpha)

def plot_baseline_displacement_los_mm(self, phase, corr=None, caption=None, cmap='turbo',
displacement=True, unwrap=True,
stl=False, stl_freq='W', stl_periods=52, stl_robust=True,
tolerance=np.pi/2, xlabel_rotation=45):
tolerance=np.pi/2, xlabel_rotation=45,
legend=True, legend_alpha=None):
self.plot_baseline_displacement(phase=phase, corr=corr, caption=caption, cmap=cmap,
displacement=displacement, unwrap=unwrap,
stl=stl, stl_freq=stl_freq, stl_periods=stl_periods, stl_robust=stl_robust,
los=True, tolerance=tolerance, xlabel_rotation=xlabel_rotation)
los=True, tolerance=tolerance, xlabel_rotation=xlabel_rotation,
legend=legend, legend_alpha=legend_alpha)

def rmse(self, data, solution, weight=None):
"""
Expand Down

0 comments on commit 1d69265

Please sign in to comment.