Skip to content
Snippets Groups Projects
Commit 32c3b684 authored by tomrink's avatar tomrink
Browse files

add inverse transforms

parent ad842fb3
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment