Skip to content

Commit

Permalink
Adds downsample_factor to packet drop function
Browse files Browse the repository at this point in the history
  • Loading branch information
jlashner authored and tanaybhandarkar committed Sep 2, 2023
1 parent d48f9cc commit 5dfeefa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sodetlib/quality_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from pysmurf.client.base.smurf_control import SmurfControl
import matplotlib.pyplot as plt

def check_packet_loss(Ss, cfgs, dur=10, fr_khz=4, nchans=2000, slots=None):
def check_packet_loss(Ss, cfgs, dur=10, fr_khz=4, nchans=2000, slots=None, downsample_factor=1):
"""
Takes a short G3 Stream on multiple slots simultaneously and checks for
dropped samples. This function is strange since it requires simultaneous
Expand All @@ -28,6 +28,8 @@ def check_packet_loss(Ss, cfgs, dur=10, fr_khz=4, nchans=2000, slots=None):
slots : list
Which slots to stream data on. If None, will stream on all slots in the
Ss object.
downsample_factor : int
Downsample factor to use
Returns
--------
Expand All @@ -44,7 +46,7 @@ def check_packet_loss(Ss, cfgs, dur=10, fr_khz=4, nchans=2000, slots=None):
S = Ss[s]
S.flux_ramp_setup(fr_khz, 0.4, band=0)
sdl.stream_g3_on(
S, channel_mask=np.arange(nchans), downsample_factor=1,
S, channel_mask=np.arange(nchans), downsample_factor=downsample_factor,
subtype='check_packet_loss'
)

Expand Down

0 comments on commit 5dfeefa

Please sign in to comment.