aboutsummaryrefslogtreecommitdiff
path: root/picostream/cli.py
diff options
context:
space:
mode:
Diffstat (limited to 'picostream/cli.py')
-rw-r--r--picostream/cli.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/picostream/cli.py b/picostream/cli.py
index 87c665b..d8e7ffb 100644
--- a/picostream/cli.py
+++ b/picostream/cli.py
@@ -49,6 +49,7 @@ class Streamer:
is_gui_mode: bool = False,
y_min: Optional[float] = None,
y_max: Optional[float] = None,
+ bandwidth_limiter: str = "full",
) -> None:
# --- Configuration ---
self.output_file = output_file
@@ -155,6 +156,9 @@ class Streamer:
self.shutdown_event,
downsample_mode=downsample_mode,
)
+
+ # Store bandwidth limiter setting
+ self.bandwidth_limiter = bandwidth_limiter
self.pico_device.set_channel(
"PS5000A_CHANNEL_A", 1, "PS5000A_DC", self.pico_channel_range, offset_v
@@ -162,6 +166,12 @@ class Streamer:
self.pico_device.set_channel(
"PS5000A_CHANNEL_B", 0, "PS5000A_DC", self.pico_channel_range, 0.0
)
+
+ # Set bandwidth filter for Channel A if specified
+ if self.bandwidth_limiter == "20MHz":
+ self.pico_device.set_bandwidth_filter("PS5000A_CHANNEL_A", "PS5000A_BW_20MHZ")
+ else:
+ self.pico_device.set_bandwidth_filter("PS5000A_CHANNEL_A", "PS5000A_BW_FULL")
self.pico_device.set_data_buffer("PS5000A_CHANNEL_A", 0, pico_ratio_mode)
self.pico_device.configure_streaming_var(
self.pico_sample_interval_ns,
@@ -527,6 +537,12 @@ def generate_unique_filename(base_path: str) -> str:
help="Analog offset in Volts (only for ranges < 5V). [default: 0.0]",
)
@click.option(
+ "--bandwidth",
+ type=click.Choice(["full", "20MHz"]),
+ default="full",
+ help="Bandwidth limiter to reduce noise. [default: full]",
+)
+@click.option(
"--max-buff-sec",
type=float,
help="Maximum buffer duration in seconds for live-only mode (limits file size).",
@@ -560,6 +576,7 @@ def main(
hardware_downsample: int,
downsample_mode: str,
offset: float,
+ bandwidth: str,
max_buff_sec: Optional[float],
force: bool,
y_min: Optional[float],
@@ -633,6 +650,7 @@ def main(
max_buffer_seconds=max_buff_sec,
y_min=y_min,
y_max=y_max,
+ bandwidth_limiter=bandwidth,
)
# Update the acquisition command in metadata