diff --git a/modules/util/geos_nav.py b/modules/util/geos_nav.py index a7217e8f9fdb99e6339fbce12275278f1e56ea02..58e8dfa663edc1644c89916d63c8d8bef3468d83 100644 --- a/modules/util/geos_nav.py +++ b/modules/util/geos_nav.py @@ -211,6 +211,31 @@ class GEOSNavigation: return geographic_lon, geographic_lat + def sat_to_earth(self, x, y): + if self.scan_geom == 'GOES': + x, y = goes_to_geos(x, y) + + c1 = (h * np.cos(x) * np.cos(y)) * (h * np.cos(x) * np.cos(y)) + c2 = (np.cos(y) * np.cos(y) + fp * np.sin(y) * np.sin(y)) * d + + if c1 < c2: + return np.nan, np.nan + + s_d = np.sqrt(c1 - c2) + s_n = (h * np.cos(x) * np.cos(y) - s_d) / (np.cos(y) * np.cos(y) + fp * np.sin(y) * np.sin(y)) + s_1 = h - s_n * np.cos(x) * np.cos(y) + s_2 = s_n * np.sin(x) * np.cos(y) + s_3 = s_n * np.sin(y) + s_xy = np.sqrt(s_1 * s_1 + s_2 * s_2) + + geographic_lon = np.arctan(s_2 / s_1) + self.sub_lon + geographic_lat = np.arctan(fp * (s_3 / s_xy)) + + geographic_lon *= RAD_TO_DEG + geographic_lat *= RAD_TO_DEG + + return geographic_lon, geographic_lat + # def compute_scale_offset(lon_a, lat_a, col_a, line_a, lon_b, lat_b, col_b, line_b): # lamda_a, theta_a = earth_to_sat(lon_a, lat_a) # lamda_b, theta_b = earth_to_sat(lon_b, lat_b)