Skip to content

Commit

Permalink
Enhance functions plot_baseline_correlation() and plot_baseline_devia…
Browse files Browse the repository at this point in the history
…tion(). Add helper functions sbas_pairs_covering_deviation() and sbas_pairs_covering_correlation().
  • Loading branch information
Alexey Pechnikov committed Feb 7, 2024
1 parent dc8f44d commit a321652
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions pygmtsar/pygmtsar/Stack_sbas.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,12 @@ def sbas_pairs_covering(pairs, column, count, func='min'):

return df

def sbas_pairs_covering_deviation(self, pairs, count, column='stddev'):
return self.sbas_pairs_covering(pairs, column, count, 'min')

def sbas_pairs_covering_correlation(self, pairs, count, column='corr'):
return self.sbas_pairs_covering(pairs, column, count, 'max')

def sbas_pairs_extend(self, baseline_pairs):
import pandas as pd
import numpy as np
Expand Down Expand Up @@ -697,12 +703,14 @@ def plot_baseline_duration(self, baseline_pairs, interval_days=6, caption='Durat
label.set_horizontalalignment('center')
ax.grid(True, color='lightgrey', zorder=0)

def plot_baseline_attribute(self, baseline_pairs, pairs_best=None, column='corr', caption='Baseline Attribute'):
def plot_baseline_attribute(self, baseline_pairs, pairs_best=None, column=None, caption='Baseline Attribute'):
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt

assert column is not None, 'ERROR: specify the column argument'

plt.figure()

# plot dates/baselines marks
Expand All @@ -729,13 +737,13 @@ def plot_baseline_attribute(self, baseline_pairs, pairs_best=None, column='corr'
plt.title(caption, y=1.2)
plt.grid()

def plot_baseline_correlation(self, baseline_pairs, pairs_best=None):
def plot_baseline_correlation(self, baseline_pairs, pairs_best=None, column='corr'):
#print ('NOTE: this function is deprecated, use instead Stack.plot_baseline_attribute()')
self.plot_baseline_attribute(baseline_pairs, pairs_best, column='corr', caption='Baseline Correlation')
self.plot_baseline_attribute(baseline_pairs, pairs_best, column=column, caption='Baseline Correlation')

def plot_baseline_deviation(self, baseline_pairs, pairs_best=None):
def plot_baseline_deviation(self, baseline_pairs, pairs_best=None, column='stddev'):
#print ('NOTE: this function is deprecated, use instead Stack.plot_baseline_attribute()')
self.plot_baseline_attribute(baseline_pairs, pairs_best, column='stddev', caption='Baseline Deviation')
self.plot_baseline_attribute(baseline_pairs, pairs_best, column=column, caption='Baseline Deviation')

def plot_baseline_displacement(self, phase, corr=None, caption=None, cmap='turbo',
displacement=True, unwrap=True,
Expand Down

0 comments on commit a321652

Please sign in to comment.