diff --git a/pygmtsar/pygmtsar/Stack_sbas.py b/pygmtsar/pygmtsar/Stack_sbas.py index 54a80a16..37b787a7 100644 --- a/pygmtsar/pygmtsar/Stack_sbas.py +++ b/pygmtsar/pygmtsar/Stack_sbas.py @@ -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):