From 6ef79e361d16a7ce5fc45a632b75379cc173834d Mon Sep 17 00:00:00 2001 From: Alexey Pechnikov Date: Sat, 9 Mar 2024 20:41:31 +0700 Subject: [PATCH] Enhance aligment filtering out NaN evelation values. It should not affect processing but simplifies debug. --- pygmtsar/pygmtsar/Stack_align.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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):