Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def record_sweep(self, time, channel, sensor_id, timecode, flag):
bsd_idx = pysurvive.get_bsd_idx(self.so.contents.ctx, channel)
if bsd_idx == -1:
return
last_sweep = self.so.contents.last_sync_time[bsd_idx]
time_since_sync = (pysurvive.timecode_difference(timecode, last_sweep) / 48000000.)
hz = 48000000. / self.so.contents.last_time_between_sync[bsd_idx]
time_per_rot = 1. / hz
if time_since_sync > time_per_rot:
return
key = (sensor_id, channel)
raw_angle = time_since_sync / time_per_rot * 2. * math.pi
self.raw_angles[key].append([time, raw_angle])
# int8_t bsd_idx = survive_get_bsd_idx(ctx, channel);
# if (bsd_idx == -1) {
# SV_WARN("Invalid channel requested(%d) for %s", channel, so->codename)
# return;
# }