diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2024-07-20 18:03:42 -0400 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2024-07-20 18:04:44 -0400 |
commit | 5521a2dd65d6101b3881907b359444834e3f8cba (patch) | |
tree | e78f47ad82f2f65265742e4b94aa42b651f2533c /qolab/hardware/scope/_basic.py | |
parent | bd959db874b0441e95bf7838589f6424a3561a81 (diff) | |
download | qolab-5521a2dd65d6101b3881907b359444834e3f8cba.tar.gz qolab-5521a2dd65d6101b3881907b359444834e3f8cba.zip |
refactor calcSparsingAndNumPoints to avoid use of unset availableNpnts
Diffstat (limited to 'qolab/hardware/scope/_basic.py')
-rw-r--r-- | qolab/hardware/scope/_basic.py | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/qolab/hardware/scope/_basic.py b/qolab/hardware/scope/_basic.py index c0a6f13..e67e6af 100644 --- a/qolab/hardware/scope/_basic.py +++ b/qolab/hardware/scope/_basic.py @@ -10,9 +10,24 @@ from qolab.data.trace import TraceSetSameX def calcSparsingAndNumPoints(self, availableNpnts=None, maxRequiredPoints=None): + """Calculate sparcing and number of sparced points. + + Parameters + ---------- + availableNpnts: int or None + Number of available points. If set to None exit with error + maxRequiredPoints: int or (None) + number of requested points after decimation. + If availableNpnts< maxRequiredPoints*2, + decimation is impossible and we will get up to factor of 2 more + than requested. + + Return + ------ + (sparsing, Npnts, availableNpnts, maxRequiredPoints) + """ if availableNpnts is None: - # using channel 1 to get availableNpnts - availableNpnts = self.getAvailableNumberOfPoints(1) + raise ValueError("Invalid availableNpnts value, must be int.") if maxRequiredPoints is None: maxRequiredPoints = self.maxRequiredPoints |