diff --git a/sodetlib/det_config.py b/sodetlib/det_config.py index 16e13167..a766ba69 100644 --- a/sodetlib/det_config.py +++ b/sodetlib/det_config.py @@ -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': {}, diff --git a/sodetlib/stream.py b/sodetlib/stream.py index 8f531362..6323839d 100644 --- a/sodetlib/stream.py +++ b/sodetlib/stream.py @@ -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. @@ -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 @@ -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,