diff --git a/pygmtsar/pygmtsar/Stack_align.py b/pygmtsar/pygmtsar/Stack_align.py index dbbc7699..2d14b494 100644 --- a/pygmtsar/pygmtsar/Stack_align.py +++ b/pygmtsar/pygmtsar/Stack_align.py @@ -82,7 +82,8 @@ def _get_topo_llt(self, subswath, degrees, debug=False): lats, lons, z = xr.broadcast(dem_area.lat, dem_area.lon, dem_area) topo_llt = np.column_stack([lons.values.ravel(), lats.values.ravel(), z.values.ravel()]) - return topo_llt + # filter out records where the third column (index 2) is NaN + return topo_llt[~np.isnan(topo_llt[:, 2])] # aligning for reference image def _align_ref_subswath(self, subswath, debug=False):