Skip to content

Commit

Permalink
Add unwrapping tolerance to plot_baseline_displacement() function arg…
Browse files Browse the repository at this point in the history
…uments
  • Loading branch information
AlexeyPechnikov committed Mar 10, 2024
1 parent 7bc6f18 commit 1fa2c49
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pygmtsar/pygmtsar/Stack_sbas.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# ----------------------------------------------------------------------------
from .Stack_detrend import Stack_detrend
from .PRM import PRM
import numpy as np

class Stack_sbas(Stack_detrend):

Expand Down Expand Up @@ -747,7 +748,7 @@ 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):
stl=False, stl_freq='W', stl_periods=52, stl_robust=True, tolerance=np.pi/2):
"""
Performs 1D unwrapping, linear regression, and STL on a given set of phase values.
Expand Down Expand Up @@ -787,7 +788,7 @@ def plot_baseline_displacement(self, phase, corr=None, caption=None, cmap='turbo
matrix = self.lstsq_matrix(pairs)

if unwrap:
df['phase'] = self.unwrap_pairs(phase.values, df['corr'].values, matrix)
df['phase'] = self.unwrap_pairs(phase.values, df['corr'].values, matrix, tolerance)

if displacement or stl:
solution = self.lstsq1d(df['phase'].values, 0.999*df['corr'].values if corr is not None else None, matrix)
Expand Down

0 comments on commit 1fa2c49

Please sign in to comment.