def compute_doppler_angle(self) -> None: """ calculate the doppler angle """ alt_surf = self.alt_sar_sat - self.chd.mean_sat_alt surf_geodetic = np.array([ self.lat_sar_sat, self.lon_sar_sat, alt_surf ]) surf_cartesian = np.asmatrix(lla2ecef(surf_geodetic, self.cst)) # n vector - sat position normal to surface n = np.asmatrix( surf_cartesian.T - self.pos_sar_sat ) # v vector - sat velocty (cartesian) v = self.vel_sat_sar # vector perpendicular to plane nv w = np.cross(n.T, v.T) # vector perpendicular to plane nw m = np.cross(w, n.T) # angle between v and m self.doppler_angle_sar_sat = angle_between(v, m) if self.doppler_angle_sar_sat < self.cst.pi / 2: self.doppler_angle_sar_sat *= -1
def compute_doppler_angle(self) -> None: """ calculate the doppler angle """ alt_surf = self.alt_sar_sat - self.chd.mean_sat_alt surf_geodetic = np.array([ self.lat_sar_sat, self.lon_sar_sat, alt_surf ]) surf_cartesian = np.asmatrix(lla2ecef(surf_geodetic, self.cst)) # n vector - sat position normal to surface n = np.asmatrix( surf_cartesian.T - self.pos_sar_sat ) # v vector - sat velocty (cartesian) v = self.vel_sat_sar # vector perpendicular to plane nv w = np.cross(n.T, v.T) # vector perpendicular to plane nw m = np.cross(w, n.T) # angle between v and m self.doppler_angle_sar_sat = angle_between(v, m)
def focus_surface(self, surface_to_move: SurfaceData, previous_surface: SurfaceData) -> None: """ move the location of a surface to the closest approach to the target position given by the user in the configuration file :param surface_to_move: the surface that will be moved :param previous_surface: the surface previous to the surface being moved :return: """ self.focus_found = True # flag surface as being focused surface_to_move.target_focused = True # surface_to_move.surface_type = 4 # get position of target lla_target = np.asarray([ self.cnf.surface_focusing_lat, self.cnf.surface_focusing_lon, self.cnf.surface_focusing_alt ]) pos_target = lla2ecef(lla_target, self.cst) # get current position of focus surface & previous pos_focus = np.asmatrix(surface_to_move.ecef_surf) pos_prior = np.asmatrix(previous_surface.ecef_surf) # calculate along-track direction vector along_track = pos_focus - pos_prior along_track /= np.linalg.norm(along_track) # calculate vector from previous surface to target position rel_target = pos_target - pos_prior # project relative target vector onto along-track direction cos_a = (along_track * rel_target.T) / np.linalg.norm(rel_target) rel_focus = (np.linalg.norm(rel_target) * cos_a) * along_track # get position to move surface to x_move, y_move, z_move = np.ravel(rel_focus) focus_x = previous_surface.x_surf + x_move focus_y = previous_surface.y_surf + y_move focus_z = previous_surface.z_surf + z_move focus_ecef = np.asarray([focus_x, focus_y, focus_z]) # set new position of focus surface surface_to_move.x_surf = focus_x surface_to_move.y_surf = focus_y surface_to_move.z_surf = focus_z focus_lla = ecef2lla(focus_ecef, self.cst) focus_lat, focus_lon, focus_alt = np.ravel(focus_lla) surface_to_move.lat_surf = focus_lat surface_to_move.lon_surf = focus_lon surface_to_move.alt_surf = focus_alt surface_to_move.win_delay_surf =\ (surface_to_move.alt_sat - surface_to_move.alt_surf) * 2. / self.cst.c
def compute_location_sar_surf(self) -> None: lla = (self.lat_sar_sat, self.lon_sar_sat, self.alt_sar_sat) x, y, z = lla2ecef(lla, self.cst) self.x_sar_sat = x self.y_sar_sat = y self.z_sar_sat = z lat_sar_surf = self.lat_sar_sat lon_sar_surf = self.lon_sar_sat alt_sar_surf = self.alt_sar_sat - self.win_delay_sar_ku * self.cst.c / 2 lla = (lat_sar_surf, lon_sar_surf, alt_sar_surf) x, y, z = lla2ecef(lla, self.cst) self.x_sar_surf = x self.y_sar_surf = y self.z_sar_surf = z
def focus_target_distance(self, pos_surface: np.ndarray) -> float: """ calculate distance from surface to focus target :param pos_surface: the position of the surface :return: """ lla_target = np.asarray([ self.cnf.surface_focusing_lat, self.cnf.surface_focusing_lon, self.cnf.surface_focusing_alt ]) pos_target = lla2ecef(lla_target, self.cst) return np.linalg.norm(pos_target - pos_surface)
def compute_location_sar_surf(self) -> None: lla = ( self.lat_sar_sat, self.lon_sar_sat, self.alt_sar_sat ) x, y, z = lla2ecef(lla, self.cst) self.x_sar_sat = x self.y_sar_sat = y self.z_sar_sat = z lat_sar_surf = self.lat_sar_sat lon_sar_surf = self.lon_sar_sat alt_sar_surf = self.alt_sar_sat - self.win_delay_sar_ku * self.cst.c / 2 lla = (lat_sar_surf, lon_sar_surf, alt_sar_surf) x, y, z = lla2ecef(lla, self.cst) self.x_sar_surf = x self.y_sar_surf = y self.z_sar_surf = z
def store_first_location(self, isps: Sequence[L1AProcessingData]) -> None: """ define values for first surface (directly beneath the ISP) :param isps: list of input bursts """ isp_record = isps[-1] self.time_surf = isp_record.time_sar_ku self.lat_surf = normalize(isp_record.lat_sar_sat, self.cst) self.lon_surf = normalize(isp_record.lon_sar_sat, self.cst) self.alt_surf = isp_record.alt_sar_sat -\ isp_record.win_delay_sar_ku * self.cst.c / 2. surf = lla2ecef( [self.lat_surf, self.lon_surf, self.alt_surf], self.cst ) self.x_surf = surf[0] self.y_surf = surf[1] self.z_surf = surf[2] self.x_sat = isp_record.x_sar_sat self.y_sat = isp_record.y_sar_sat self.z_sat = isp_record.z_sar_sat self.lat_sat = isp_record.lat_sar_sat self.lon_sat = isp_record.lon_sar_sat self.alt_sat = isp_record.alt_sar_sat self.x_vel_sat = isp_record.x_vel_sat_sar self.y_vel_sat = isp_record.y_vel_sat_sar self.z_vel_sat = isp_record.z_vel_sat_sar self.alt_rate_sat = isp_record.alt_rate_sat_sar self.roll_sat = isp_record.roll_sar self.pitch_sat = isp_record.pitch_sar self.yaw_sat = isp_record.yaw_sar self.win_delay_surf = isp_record.win_delay_sar_ku