Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
from picoscope import ps5000a
import matplotlib.pyplot as plt
import numpy as np
import time
ps = ps5000a.PS5000a()
# rapid block mode
ps.setChannel(channel="A", coupling="DC", VRange=1)
ps.setChannel(channel="B", enabled=False)
n_captures = 100
sample_interval = 100e-9 # 100 ns
sample_duration = 2e-3 # 1 ms
ps.setResolution('16')
ps.setSamplingInterval(sample_interval, sample_duration)
ps.setSimpleTrigger("A", threshold_V=0.1, timeout_ms=1)
samples_per_segment = ps.memorySegments(n_captures)
ps.setNoOfCaptures(n_captures)
import matplotlib.pyplot as plt
import numpy as np
import time
from picoscope import ps3000a
SERIAL_NUM = 'AR911/011\x00'
ps = ps3000a.PS3000a(SERIAL_NUM)
# now = time.strftime("%Y%m%d_%H%M%S")
# filename = "sweep_" + now + ".swp"
# output_file = open(filename, "wb")
c = 3e8
# rapid block mode
ps.setChannel(channel="A", coupling="DC", VRange=1)
n_captures = 2300 * 3 # int(600 * 1.4)
sample_interval = 5 / 3e8
sample_duration = 1e3 * 2 / 3e8
ps.setSamplingInterval(sample_interval, sample_duration)
from picoscope import ps4000a
import matplotlib.pyplot as plt
import numpy as np
import time
ps = ps4000a.PS4000a()
# rapid block mode
ps.setChannel(channel="A", coupling="DC", VRange=1)
ps.setChannel(channel="B", enabled=False)
ps.setChannel(channel="C", enabled=False)
ps.setChannel(channel="D", enabled=False)
n_captures = 100
sample_interval = 100e-9 # 100 ns
sample_duration = 2e-3 # 1 ms
ps.setResolution('12') # Resolution can only be set on the PS4444
ps.setSamplingInterval(sample_interval, sample_duration)
ps.setSimpleTrigger("A", threshold_V=0.1, timeout_ms=1)
samples_per_segment = ps.memorySegments(n_captures)
"""
from __future__ import division
import time
from picoscope import ps6000
import pylab as plt
import numpy as np
if __name__ == "__main__":
print(__doc__)
print("Attempting to open Picoscope 6000...")
# see page 13 of the manual to understand how to work this beast
ps = ps6000.PS6000()
print(ps.getAllUnitInfo())
waveform_desired_duration = 1E-3
obs_duration = 10 * waveform_desired_duration
sampling_interval = obs_duration / 4096
(actualSamplingInterval, nSamples, maxSamples) = ps.setSamplingInterval(
sampling_interval, obs_duration)
print("Sampling interval = %f ns" % (actualSamplingInterval * 1E9))
print("Taking samples = %d" % nSamples)
print("Maximum samples = %d" % maxSamples)
ps.setChannel('A', 'DC', 5.0, 0.0, True, False)
ps.setSimpleTrigger('A', 0.0, 'Rising', delay=0, timeout_ms=100,
enabled=True)
def examplePS6000():
fig = plt.figure() # noqa
plt.ion()
plt.show()
print("Attempting to open...")
ps = ps6000.PS6000()
# Example of simple capture
res = ps.setSamplingFrequency(250E6, 4096)
sampleRate = res[0] # noqa
print("Sampling @ %f MHz, %d samples" % (res[0]/1E6, res[1]))
ps.setChannel("A", "AC", 50E-3)
blockdata = np.array(0)
for i in range(0, 50):
ps.runBlock()
while(ps.isReady() is False):
time.sleep(0.01)
print("Sampling Done")
data = ps.getDataV("A", 4096)
from __future__ import print_function
from __future__ import unicode_literals
import time
from picoscope import ps6000
import pylab as plt
import numpy as np
if __name__ == "__main__":
print("Checking for devices")
ps = ps6000.PS6000(connect=False)
allSerialNumbers = ps.enumerateUnits()
assert len(allSerialNumbers) == 1, "Device not found"
serial = allSerialNumbers[0]
print("Connecting to PS6000 %s" % serial)
ps = ps6000.PS6000(serial)
print("Found the following picoscope:")
print(ps.getAllUnitInfo())
print()
'''
original settings
20 ms/div
100 Ms
ch1
+/- 1 V/div AC
current probe
ch3
pin 28?
shows clock like pattern
gaps move around
def setupScope():
ps = ps6000.PS6000()
# Example of simple capture
res = ps.setSamplingFrequency(500E6, 4096)
sampleRate = res[0]
print("Sampling @ %f MHz, %d samples" % (res[0] / 1E6, res[1]))
ps.setChannel("A", "AC", 50E-3)
return [ps, sampleRate]
def __init__(self):
PicoScopeBase.__init__(self, ps6000.PS6000(connect=False))
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import time
from picoscope import ps6000
import pylab as plt
import numpy as np
if __name__ == "__main__":
print(__doc__)
print("Attempting to open Picoscope 6000...")
# see page 13 of the manual to understand how to work this beast
ps = ps6000.PS6000()
print("Found the following picoscope:")
print(ps.getAllUnitInfo())
waveform_desired_duration = 1E-3
obs_duration = 3 * waveform_desired_duration
sampling_interval = obs_duration / 4096
(actualSamplingInterval, nSamples, maxSamples) = \
ps.setSamplingInterval(sampling_interval, obs_duration)
print("Sampling interval = %f ns" % (actualSamplingInterval * 1E9))
print("Taking samples = %d" % nSamples)
print("Maximum samples = %d" % maxSamples)
waveformAmplitude = 1.5
waveformOffset = 0
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import time
from picoscope import ps6000
import pylab as plt
import numpy as np
if __name__ == "__main__":
print("Checking for devices")
ps = ps6000.PS6000(connect=False)
allSerialNumbers = ps.enumerateUnits()
assert len(allSerialNumbers) == 1, "Device not found"
serial = allSerialNumbers[0]
print("Connecting to PS6000 %s" % serial)
ps = ps6000.PS6000(serial)
print("Found the following picoscope:")
print(ps.getAllUnitInfo())
print()
'''
original settings
20 ms/div
100 Ms
ch1
+/- 1 V/div AC