Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds downsample_factor to packet drop function #385

Merged
merged 1 commit into from
Sep 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading