Skip to content

Commit

Permalink
Enhance RMSE calculation function
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Pechnikov committed Jun 13, 2024
1 parent e86a7b7 commit 944ff95
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pygmtsar/pygmtsar/Stack_sbas.py
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,9 @@ def rmse(self, data, solution, weight=None):
error_pairs.append(error_pair**2)
# form 3D stack
error = xr.concat(error_pairs, dim='pair').assign_coords({'pair': pairs.pair})
return np.sqrt((weight * error).sum('pair') / weight.sum('pair') / len(pairs))
if weight is not None:
return np.sqrt((weight * error).sum('pair') / weight.sum('pair') / len(pairs)).rename('rmse')
return np.sqrt((error).sum('pair') / len(pairs)).rename('rmse')

def plot_displacement(self, data, caption='Cumulative LOS Displacement, [rad]',
quantile=None, vmin=None, vmax=None, symmetrical=False, aspect=None, **kwargs):
Expand Down

0 comments on commit 944ff95

Please sign in to comment.