Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions sodetlib/det_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ def odict_rep(dumper, data):
'downsample_mode': 'internal',
'enable_compression': True,

# Downsample filter parameters
# cutoff freq in Hz reverse engineered to produce pysmurf default filter
"downsample_filter": {"order": 4, "cutoff_freq": 63.0},

# Dict of device-specific default params to use for take_iv
'iv_defaults': {},

Expand Down
14 changes: 12 additions & 2 deletions sodetlib/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ def take_g3_data(S, dur, **stream_kw):
def stream_g3_on(S, make_freq_mask=False, emulator=False, tag=None,
channel_mask=None, filter_wait_time=2, make_datfile=False,
downsample_factor=None, downsample_mode=None,
filter_disable=False, stream_type=None, subtype='stream',
enable_compression=None):
filter_disable=False, filter_order=None, filter_cutoff=None,
stream_type=None, subtype='stream', enable_compression=None):
"""
Starts the G3 data-stream. Returns the session-id corresponding with the
data stream.
Expand Down Expand Up @@ -162,6 +162,11 @@ def stream_g3_on(S, make_freq_mask=False, emulator=False, tag=None,
this will be pulled from the device cfg.
filter_disable : bool
If true, will disable the downsample filter before streaming.
filter_order : int
Order of the downsample filter. Read from device config by default.
filter_cutoff : float
The cutoff frequency in Hz for the downsample filter.
Read from device config by default.
stream_type : optional(string)
Type of stream. This should either be "obs" or "oper". If None,
it will be determined based off of the subtype. ('stream', 'cmb', and
Expand Down Expand Up @@ -202,9 +207,14 @@ def stream_g3_on(S, make_freq_mask=False, emulator=False, tag=None,
downsample_mode = cfg.dev.exp['downsample_mode']
if downsample_factor is None:
downsample_factor = cfg.dev.exp['downsample_factor']
if filter_order is None:
filter_order = cfg.dev.exp["downsample_filter"]["order"]
if filter_cutoff is None:
filter_cutoff = cfg.dev.exp["downsample_filter"]["cutoff_freq"]

S.set_downsample_mode(downsample_mode)
S.set_downsample_factor(downsample_factor)
S.set_downsample_filter(filter_order, filter_cutoff)
S.set_filter_disable(int(filter_disable))

S.stream_data_on(make_freq_mask=make_freq_mask, channel_mask=channel_mask,
Expand Down
Loading