diff options
Diffstat (limited to 'qolab')
-rw-r--r-- | qolab/hardware/scope/rigolds1054z.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/qolab/hardware/scope/rigolds1054z.py b/qolab/hardware/scope/rigolds1054z.py index 8917021..979c126 100644 --- a/qolab/hardware/scope/rigolds1054z.py +++ b/qolab/hardware/scope/rigolds1054z.py @@ -139,8 +139,12 @@ class RigolDS1054z(ScopeSCPI): # if RAW is used the scope should be in STOP state self.write(f":WAVeform:SOURce CHAN{chNum}") - self.write(":WAVeform:MODE RAW") # {NORMal|MAXimum|RAW} RAW gives maximum number of points - self.write(":WAVeform:FORMat BYTE") # {WORD|BYTE|ASCii}, scope is 8 bit, BYTE is enough + self.write( + ":WAVeform:MODE RAW" + ) # {NORMal|MAXimum|RAW} RAW gives maximum number of points + self.write( + ":WAVeform:FORMat BYTE" + ) # {WORD|BYTE|ASCii}, scope is 8 bit, BYTE is enough preamble = self.query(":WAVeform:PREamble?").split(",") """ Format is @@ -170,7 +174,7 @@ class RigolDS1054z(ScopeSCPI): stp = min(maxreadable, Npnts) errorFreeChunkSize = [] errorProneChunkSize = [] - while (strt <= Npnts): + while strt <= Npnts: stp = strt - 1 + chunk_size stp = min(stp, Npnts) # reading requested number of points in chunks @@ -187,9 +191,9 @@ class RigolDS1054z(ScopeSCPI): ) if len(wfRawChunk) == 0: continue # we need to repeat chunk read - wfRaw[strt-1:stp] = wfRawChunk + wfRaw[strt - 1 : stp] = wfRawChunk errorFreeChunkSize.append(chunk_size) - chunk_size = min(maxreadable, int(chunk_size*1.1)) + chunk_size = min(maxreadable, int(chunk_size * 1.1)) strt += chunk_size except VisaIOError: errCnt += 1 @@ -199,10 +203,9 @@ class RigolDS1054z(ScopeSCPI): if len(errorFreeChunkSize) > 10: chunk_size = int(np.mean(errorFreeChunkSize)) else: - chunk_size = max(1, int(np.mean(errorProneChunkSize)*0.8)) + chunk_size = max(1, int(np.mean(errorProneChunkSize) * 0.8)) print(f"new {chunk_size=}") pass # we repeat this loop iteration again - print(f"final {chunk_size=}") if True: |