def xyz_points_with_time(packet, os16=False): channels = OS_16_CHANNELS if os16 else OS_128_CHANNELS if not isinstance(packet, tuple): packet = unpack(packet) ch = [] timeStamp = [] encoderCount = [] measurementID = [] frameID = [] for b in range(AZIMUTH_BLOCK_COUNT): block = azimuth_block(b, packet) if not azimuth_valid(block): continue for c in channels: ch.append(c) timeStamp.append(azimuth_timestamp(block)) encoderCount.append(azimuth_encoder_count(block)) measurementID.append(azimuth_measurement_id(block)) frameID.append(azimuth_frame_id(block)) return ch, timeStamp, encoderCount, measurementID, frameID
def xyz_points(packet, os16=False): """ Returns a tuple of x, y, z points where each x, y, z is a list of all the x, y or z points in the packet ( [x1, x2, ...], [y1, y2, ...], [z1, z2, ...], ) """ channels = OS_16_CHANNELS if os16 else OS_64_CHANNELS if not isinstance(packet, tuple): packet = unpack(packet) x = [] y = [] z = [] for b in range(AZIMUTH_BLOCK_COUNT): block = azimuth_block(b, packet) if not azimuth_valid(block): continue for c in channels: point = xyz_point(c, block) x.append(point[0]) y.append(point[1]) z.append(point[2]) return x, y, z
def raw_points(packet, os16=False): """ Returns a list of raw data point lists for a given packet. Parameters ---------- packet : bytearray UDP raw packet data azimuth_block : list of packet data raw packet data from the azimuth block for processing Returns ------- data : list [FrameID, AzimuthID, ChannelID, Timestamp, EncoderPosition, Range, Reflectivity, Signal, Noise] """ channels = OS_16_CHANNELS if os16 else OS_64_CHANNELS if not isinstance(packet, tuple): packet = unpack(packet) raw = [] for b in range(AZIMUTH_BLOCK_COUNT): block = azimuth_block(b, packet) if azimuth_valid(block): for c in channels: raw.append(raw_point(c, block)) return raw