Skip to content

Commit

Permalink
Add assert for Stack.sbas_pairs() when there are no baseline pairs ex…
Browse files Browse the repository at this point in the history
…isting for the specified parameters
  • Loading branch information
Alexey Pechnikov committed Apr 30, 2024
1 parent 1c2d559 commit 99c2d41
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pygmtsar/pygmtsar/Stack_sbas.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ def baseline_table(dates):
'ref_baseline': np.round(line2.BPR, 2),
'rep_baseline': np.round(line1.BPR, 2)})

assert len(data) > 0, 'ERROR: No baseline pairs exist for the specified parameters'
df = pd.DataFrame(data).sort_values(['ref', 'rep'])
return df.assign(pair=[f'{ref} {rep}' for ref, rep in zip(df['ref'].dt.date, df['rep'].dt.date)],
baseline=df.rep_baseline - df.ref_baseline,
Expand Down

0 comments on commit 99c2d41

Please sign in to comment.