def direct_geocoding_bistatic(sensor_position_rx: np.ndarray, sensor_velocity_rx: np.ndarray, sensor_positions_tx: np.ndarray, sensor_velocities_tx: np.ndarray, range_times: np.ndarray, look_direction: str, geodetic_altitude: float, frequency_doppler_centroid: np.ndarray, wavelength: float, initial_guess: np.ndarray = None) -> np.ndarray: """Perform bistatic direct geocoding :param sensor_position_rx: position of the sensor rx :param sensor_velocity_rx: velocity of the sensor rx :param sensor_positions_tx: positions of the sensor tx (one for each range time (3, N)) :param sensor_velocities_tx: velocities of the sensor tx (one for each range time (3, N)) :param range_times: range axis (N, 1) vector :param look_direction: either RIGHT or LEFT :param geodetic_altitude: the altitude over wgs84 :param frequency_doppler_centroid: array with frequency doppler centroid values (N,1) vector :param wavelength: the wavelength :param initial_guess: initial guess for newton iterations. If not provided a guess will be computed [optional] :return: a matrix 3xN with the xyz coordinate of the points """ # input validation _utils.check_type(wavelength, float) _utils.check_type(geodetic_altitude, float) sensor_position_rx = _utils.input_data_to_numpy_array_with_checks( sensor_position_rx, dtype=float, shape=(3, )) sensor_velocity_rx = _utils.input_data_to_numpy_array_with_checks( sensor_velocity_rx, dtype=float, shape=(3, )) sensor_positions_tx = _utils.input_data_to_numpy_array_with_checks( sensor_positions_tx, dtype=float, first_axis_size=3) sensor_velocities_tx = _utils.input_data_to_numpy_array_with_checks( sensor_velocities_tx, dtype=float, first_axis_size=3) # Optional initial guess if initial_guess is None: initial_guess = _direct_geocoding_monostatic_init( sensor_position_rx, sensor_velocity_rx, _mid_range_distance(range_times), _LOOK_SIGN[look_direction]) output = np.zeros((3, range_times.size)) for i_rg, (rg_time, pos_tx, vel_tx, f_dc) in enumerate( zip(range_times, sensor_positions_tx.T, sensor_velocities_tx.T, frequency_doppler_centroid)): output[:, i_rg] = _direct_geocoding_bistatic_core( initial_guess, sensor_position_rx, sensor_velocity_rx, pos_tx, vel_tx, rg_time, wavelength, f_dc, geodetic_altitude) initial_guess = output[:, i_rg].copy() return output
def _check_init_input(gso, azimuth_axis, ypr_matrix, rotation_order, reference_frame): _utils.check_type(gso, GeneralSarOrbit, 'gso') _utils.check_type(azimuth_axis, are_ax.Axis, 'axis') _utils.check_type(ypr_matrix, np.ndarray, 'ypr_matrix') _utils.check_ndim_of_numpy_array(ypr_matrix, 2, 'ypr_matrix') _utils.check_first_axis_size_of_numpy_array(ypr_matrix, 3, 'ypr_matrix') if ypr_matrix.shape[ 1] < GeneralSarAttitude.get_minimum_number_of_data_points(): raise RuntimeError( "Not enough attitude records provided: {} < {}".format( ypr_matrix.shape[1], GeneralSarAttitude.get_minimum_number_of_data_points())) if ypr_matrix.shape[1] != azimuth_axis.size: raise RuntimeError( "Time and attitude records matrix shall have same number of elements: {} != {}" .format(ypr_matrix.shape[1], azimuth_axis.size)) _utils.check_dtype_of_numpy_array(ypr_matrix, float, 'ypr_matrix') _utils.check_type(rotation_order, str, 'rotation_order') _utils.check_type(reference_frame, str, 'reference_frame')
def _check_init_input(axis, state_vectors: np.ndarray): if not isinstance(axis, are_ax.Axis): raise RuntimeError("Axis should be of type {} != {}".format( are_ax.Axis, type(axis))) if not isinstance(axis.start, PreciseDateTime): raise RuntimeError("Wrong axis start: {} != {}".format( type(axis.start), PreciseDateTime)) _utils.check_type(state_vectors, np.ndarray, "state_vectors") if axis.size != state_vectors.size / 3: raise RuntimeError( "Size of state vectors not compatible with size of time axis: {} != {}" .format(axis.size, state_vectors.size / 3)) if axis.size < GeneralSarOrbit.get_minimum_number_of_data_points(): raise RuntimeError("Not enough state vectors provided. {} < {}".format( axis.size, GeneralSarOrbit.get_minimum_number_of_data_points())) _utils.check_dtype_of_numpy_array(state_vectors, float, name='state_vectors') _utils.check_shape_of_numpy_array(state_vectors, (state_vectors.size, ), name='state_vectors')
def _check_inverse_geocoding_input(point, frequency_doppler_centroid, wavelength): """Checks that the input parameters for the inverse geocoding have proper types and sizes :param point: should be any 3-sized np.ndarray :param frequency_doppler_centroid: should be a float :param wavelength: should be a float """ # checking types _utils.check_type(point, np.ndarray, "point") _utils.check_type(frequency_doppler_centroid, float, "frequency_doppler_centroid") _utils.check_type(wavelength, float, "wavelength") # size check if point.size != 3: RuntimeError("Point should be a np.ndarray of size 3")
def _check_numpy_array_of_mjd(vec): _utils.check_type(vec, np.ndarray) _utils.check_ndim_of_numpy_array(vec, 1) _utils.check_dtype_of_numpy_array(vec, PreciseDateTime)
def _check_earth2sat_input(point): _utils.check_type(point, np.ndarray) _utils.check_dtype_of_numpy_array(point, float) _utils.check_shape_of_numpy_array(point, shape=(3, ))