Пример #1
0
 def get_position():
     # type: () -> PositionType
     px, py, pz = fit_position_xvalidation(state_time,
                                           state_position,
                                           state_velocity,
                                           max_degree=6)
     return PositionType(ARPPoly=XYZPolyType(X=px, Y=py, Z=pz))
Пример #2
0
 def get_position():  # type: () -> PositionType
     T = h5_dict['State Vectors Times']  # in seconds relative to ref time
     T += ref_time_offset
     Pos = h5_dict['ECEF Satellite Position']
     Vel = h5_dict['ECEF Satellite Velocity']
     P_x, P_y, P_z = fit_position_xvalidation(T, Pos, Vel, max_degree=8)
     return PositionType(ARPPoly=XYZPolyType(X=P_x, Y=P_y, Z=P_z))
Пример #3
0
 def get_position() -> PositionType:
     gp = hf['/science/LSAR/SLC/metadata/orbit']
     ref_time = _get_ref_time(gp['time'].attrs['units'])
     T = gp['time'][:] + get_seconds(ref_time, collect_start, precision='ns')
     Pos = gp['position'][:]
     Vel = gp['velocity'][:]
     P_x, P_y, P_z = fit_position_xvalidation(T, Pos, Vel, max_degree=8)
     return PositionType(ARPPoly=XYZPolyType(X=P_x, Y=P_y, Z=P_z))
Пример #4
0
    def _get_position(self):
        """
        Gets the Position.

        Returns
        -------
        PositionType
        """

        start_time = self._get_start_time()
        # get radar position state information
        state_vectors = self._findall('./sourceAttributes'
                                      '/orbitAndAttitude'
                                      '/orbitInformation'
                                      '/stateVector')
        # convert to relevant numpy arrays for polynomial fitting
        T = numpy.array([
            get_seconds(parse_timestring(state_vec.find('timeStamp').text),
                        start_time,
                        precision='us') for state_vec in state_vectors
        ],
                        dtype=numpy.float64)
        Pos = numpy.hstack((numpy.array([
            float(state_vec.find('xPosition').text)
            for state_vec in state_vectors
        ],
                                        dtype=numpy.float64)[:, numpy.newaxis],
                            numpy.array([
                                float(state_vec.find('yPosition').text)
                                for state_vec in state_vectors
                            ],
                                        dtype=numpy.float64)[:, numpy.newaxis],
                            numpy.array([
                                float(state_vec.find('zPosition').text)
                                for state_vec in state_vectors
                            ],
                                        dtype=numpy.float64)[:,
                                                             numpy.newaxis]))
        Vel = numpy.hstack((numpy.array([
            float(state_vec.find('xVelocity').text)
            for state_vec in state_vectors
        ],
                                        dtype=numpy.float64)[:, numpy.newaxis],
                            numpy.array([
                                float(state_vec.find('yVelocity').text)
                                for state_vec in state_vectors
                            ],
                                        dtype=numpy.float64)[:, numpy.newaxis],
                            numpy.array([
                                float(state_vec.find('zVelocity').text)
                                for state_vec in state_vectors
                            ],
                                        dtype=numpy.float64)[:,
                                                             numpy.newaxis]))
        P_x, P_y, P_z = fit_position_xvalidation(T, Pos, Vel, max_degree=8)

        return PositionType(ARPPoly=XYZPolyType(X=P_x, Y=P_y, Z=P_z))
Пример #5
0
 def get_position():
     # type: () -> PositionType
     # fetch the state information
     times_str = hf['state_vector_time_utc'][:, 0]
     times = numpy.zeros((times_str.shape[0], ), dtype='float64')
     positions = numpy.zeros((times.size, 3), dtype='float64')
     velocities = numpy.zeros((times.size, 3), dtype='float64')
     for i, entry in enumerate(times_str):
         times[i] = get_seconds(_parse_time(entry), start_time, precision='us')
     positions[:, 0], positions[:, 1], positions[:, 2] = hf['posX'][:], hf['posY'][:], hf['posZ'][:]
     velocities[:, 0], velocities[:, 1], velocities[:, 2] = hf['velX'][:], hf['velY'][:], hf['velZ'][:]
     # fir the the position polynomial using cross validation
     P_x, P_y, P_z = fit_position_xvalidation(times, positions, velocities, max_degree=8)
     return PositionType(ARPPoly=XYZPolyType(X=P_x, Y=P_y, Z=P_z))