diff options
Diffstat (limited to 'qolab/hardware/scope/_basic.py')
-rw-r--r-- | qolab/hardware/scope/_basic.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/qolab/hardware/scope/_basic.py b/qolab/hardware/scope/_basic.py index 1ceecbc..c0a6f13 100644 --- a/qolab/hardware/scope/_basic.py +++ b/qolab/hardware/scope/_basic.py @@ -9,6 +9,22 @@ from qolab.hardware.basic import BasicInstrument from qolab.data.trace import TraceSetSameX +def calcSparsingAndNumPoints(self, availableNpnts=None, maxRequiredPoints=None): + if availableNpnts is None: + # using channel 1 to get availableNpnts + availableNpnts = self.getAvailableNumberOfPoints(1) + if maxRequiredPoints is None: + maxRequiredPoints = self.maxRequiredPoints + + if availableNpnts <= maxRequiredPoints * 2: + Npnts = availableNpnts + sparsing = 1 + else: + sparsing = int(np.floor(availableNpnts / maxRequiredPoints)) + Npnts = int(np.floor(availableNpnts / sparsing)) + return (sparsing, Npnts, availableNpnts, maxRequiredPoints) + + class Scope(BasicInstrument): """Minimal class to implement a scope. |