diff --git a/pygmtsar/pygmtsar/Stack_base.py b/pygmtsar/pygmtsar/Stack_base.py index 0eada88..d917c61 100644 --- a/pygmtsar/pygmtsar/Stack_base.py +++ b/pygmtsar/pygmtsar/Stack_base.py @@ -231,9 +231,15 @@ def get_pairs(self, pairs, dates=False): # workaround for baseline_pairs() output pairs = pairs.rename(columns={'ref_date': 'ref', 'rep_date': 'rep'}) elif isinstance(pairs, (xr.DataArray, xr.Dataset)): + # pairs = pd.DataFrame({ +# 'ref': pairs.coords['ref'].values, +# 'rep': pairs.coords['rep'].values +# }) + refs = pairs.coords['ref'].values + reps = pairs.coords['rep'].values pairs = pd.DataFrame({ - 'ref': pairs.coords['ref'].values, - 'rep': pairs.coords['rep'].values + 'ref': refs if isinstance(refs, np.ndarray) else [refs], + 'rep': reps if isinstance(reps, np.ndarray) else [reps] }) else: # Convert numpy array to DataFrame