diff --git a/modules/util/geos_nav.py b/modules/util/geos_nav.py index bab4d343b5dc7b52ab2080459bc05dcf54da0847..587ffab80ea40142b85926bfb2309586b9181d4e 100644 --- a/modules/util/geos_nav.py +++ b/modules/util/geos_nav.py @@ -162,8 +162,18 @@ 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) + cc = np.where(np.isnan(lamda), -1, cc) + cc = np.where(cc < 0, -1, cc) + cc = np.where(cc >= self.num_elems, -1, cc) + ll = np.where(np.isnan(theta), -1, ll) + ll = np.where(ll < 0, -1, ll) + ll = np.where(ll >= self.num_lines, -1, ll) + + cc[ll == -1] = -1 + ll[cc == -1] = -1 + return cc, ll def lc_to_earth(self, cc, ll):