diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2024-07-18 23:53:55 -0400 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2024-07-18 23:53:55 -0400 |
commit | a82fed884f8ff660a9805b444c34877836a7c474 (patch) | |
tree | 495bbb4f5193b2322a6fed81609090e90a057cf7 | |
parent | 54aef3614ae202245894b0272428fd677f4c0b65 (diff) | |
download | qolab-a82fed884f8ff660a9805b444c34877836a7c474.tar.gz qolab-a82fed884f8ff660a9805b444c34877836a7c474.zip |
black formatter
-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: |