From 3b2327c8304e836c4287134db87016f51e9171de Mon Sep 17 00:00:00 2001 From: rink <rink@ssec.wisc.edu> Date: Fri, 11 Sep 2020 10:04:11 -0500 Subject: [PATCH] fix problems when incoming lon,lat off grid --- modules/util/geos_nav.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/util/geos_nav.py b/modules/util/geos_nav.py index ca4d2829..7f5dfbbf 100644 --- a/modules/util/geos_nav.py +++ b/modules/util/geos_nav.py @@ -117,8 +117,8 @@ class GEOSNavigation: lamda_sat = np.arcsin(-r_2/np.sqrt(r_1*r_1 + r_2*r_2 + r_3*r_3)) theta_sat = np.arctan(r_3/r_1) - np.where(r_1 > self.h, lamda_sat == np.nan, lamda_sat) - np.where(r_1 > self.h, theta_sat == np.nan, theta_sat) + lamda_sat = np.where(r_1 > self.h, np.nan, lamda_sat) + theta_sat = np.where(r_1 > self.h, np.nan, theta_sat) return lamda_sat, theta_sat @@ -149,8 +149,8 @@ class GEOSNavigation: def earth_to_lc_s(self, lons, lats): lamda, theta = self.earth_to_sat_s(lons, lats) cc, ll = self.sat_to_lc(lamda, theta) - np.where(np.isnan(cc), cc == -1, cc) - np.where(np.isnan(ll), ll == -1, ll) + cc = np.where(np.isnan(lamda), -1, cc) + ll = np.where(np.isnan(theta), -1, ll) return cc, ll def earth_to_indexs(self, lons, lats, len_x): -- GitLab