summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-11-07 20:21:26 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-11-07 20:21:26 +0100
commitd233eb9dcc44a6ffe08b3d5f6e2031433edaaa99 (patch)
treea3623017c270d62b936b29103c5d9d17cb502a9e /bin
parent3b9c08c0b767d8510c8dc36a094ef3a9d1b3c911 (diff)
add --voltage-only, --current-only. Up to 24 Hz sample rate now!
Diffstat (limited to 'bin')
-rwxr-xr-xbin/korad-logger26
1 files changed, 23 insertions, 3 deletions
diff --git a/bin/korad-logger b/bin/korad-logger
index 2b540a0..93a4005 100755
--- a/bin/korad-logger
+++ b/bin/korad-logger
@@ -253,6 +253,8 @@ def measure_data(
voltage_range=(None, None, None),
current_range=(None, None, None),
on_off=False,
+ log_voltage=True,
+ log_current=True,
):
global terminate_measurement
@@ -311,12 +313,18 @@ def measure_data(
print("# Timestamp Voltage Current", file=output_handle)
while not terminate_measurement:
ts = time.time()
- current = korad.get_current()
- voltage = korad.get_voltage()
+ if log_current:
+ current = korad.get_current()
+ else:
+ current = None
+ if log_voltage:
+ voltage = korad.get_voltage()
+ else:
+ voltage = None
if voltage is not None and current is not None:
print(f"{ts:.3f} {voltage:5.2f} {current:5.3f}", file=output_handle)
elif voltage is not None:
- print(f"{ts:.3f} {voltage:5.2f} NaN", file=output_handle)
+ print(f"{ts:.3f} {voltage:5.2f} NaN", file=output_handle)
elif current is not None:
print(f"{ts:.3f} NaN {current:5.3f}", file=output_handle)
else:
@@ -528,6 +536,11 @@ def main():
help="Vary voltage limit from START to STOP over the course of the measurement. Adjust by STEP V per second.",
)
parser.add_argument(
+ "--voltage-only",
+ action="store_true",
+ help="Log voltage only (ignore current readings). Useful to increase sample rate for CC measurements.",
+ )
+ parser.add_argument(
"--current-limit",
type=float,
help="Set current limit",
@@ -539,6 +552,11 @@ def main():
help="Vary current limit from START to STOP over the course of the measurement. Adjust by STEP A per second.",
)
parser.add_argument(
+ "--current-only",
+ action="store_true",
+ help="Log current only (ignore current readings). Useful to increase sample rate for CV measurements.",
+ )
+ parser.add_argument(
"--on-off",
action="store_true",
help="Enable output after starting the measurement; disable it after stopping it",
@@ -600,6 +618,8 @@ def main():
voltage_range=voltage_range,
current_range=current_range,
on_off=args.on_off,
+ log_voltage=not args.current_only,
+ log_current=not args.voltage_only,
)
data = parse_data(log_data, skip=args.skip, limit=args.limit)