def compute_view_angles(lon0, lat0, h0, lon1, lat1, h1, obs_azi, obs_ele): mlat = ((lat0 + lat1) / 2.) lon0 *= np.cos(np.deg2rad(mlat)) lon1 *= np.cos(np.deg2rad(mlat)) dlon = lon1 - lon0 dlat = lat1 - lat0 obs_azi_p = fix_angle(obs_azi + np.rad2deg(np.arctan2(dlon, dlat))) return obs_azi_p, obs_ele
def test_normalize_angle(self): assert utils.fix_angle(0) == 0 assert utils.fix_angle(180) == 180 assert utils.fix_angle(270) == 270 assert utils.fix_angle(-90) == 270 assert utils.fix_angle(-180) == 180 assert utils.fix_angle(-181) == 179 assert utils.fix_angle(420) == 60