# This script is just to test waverunner functionality as a module # import numpy from matplotlib import pyplot import sys import os sys.path.append(os.path.expanduser('~/Source')) sys.path.append(os.path.expanduser('~/src')) sys.path.append('/var/local/src') from pyoscope import Waverunner """ Example program to plot the Y-T data from one scope channel derived from capture_channel_1.py but using new interface methods """ # Initialize our scope scope = Waverunner("127.0.0.1") scope.grabData() data1 = scope.getScaledWaveform(1) data2 = scope.getScaledWaveform(2) # Now, generate a time axis. time = scope.getTimeAxis() # See if we should use a different time axis if (time[599] < 1e-3): time = time * 1e6 tUnit = "uS" elif (time[599] < 1): time = time * 1e3 tUnit = "mS" else:
import os from matplotlib import pyplot sys.path.append(os.path.expanduser('~/Source')) sys.path.append(os.path.expanduser('~/src')) sys.path.append('/var/local/src') from pyoscope import RigolScope from pyoscope import Waverunner from pyoscope import makeDataFilePath """ Capture data from Rigol oscilloscope and write to a file usage: python save_channel.py <filename> if filename is not given STDOUT will be used""" SCOPE_ADDRESS = 'nigpib1' try: filename = sys.argv[1] except: filename = makeDataFilePath() if filename == "--help": print """Usage: 1%s [filename]\n Reads both traces from oscilloscope and writes as ASCII tabular data to filename. If no filename is given the program outputs to STDOUT. STDOUT can be directed into a file or piped into another application. For example:\n 1%s myfile\n 1%s > myfile\n 1%s | ./plot_data.py"""%sys.argv[0] sys.exit(1) print filename #scope = RigolScope("/dev/usbtmc0") scope = Waverunner(SCOPE_ADDRESS) scope.grabData() scope.writeWaveformToFile(filename) scope.close()
import os from matplotlib import pyplot sys.path.append(os.path.expanduser('~/Source')) sys.path.append(os.path.expanduser('~/src')) sys.path.append('/var/local/src') from pyoscope import RigolScope from pyoscope import Waverunner from pyoscope import makeDataFilePath """ Capture data from Rigol oscilloscope and write to a file usage: python save_channel.py <filename> if filename is not given STDOUT will be used""" SCOPE_ADDRESS = 'nigpib1' try: filename = sys.argv[1] except: filename = makeDataFilePath() if filename == "--help": print """Usage: 1%s [filename]\n Reads both traces from oscilloscope and writes as ASCII tabular data to filename. If no filename is given the program outputs to STDOUT. STDOUT can be directed into a file or piped into another application. For example:\n 1%s myfile\n 1%s > myfile\n 1%s | ./plot_data.py""" % sys.argv[ 0] sys.exit(1) print filename #scope = RigolScope("/dev/usbtmc0") scope = Waverunner(SCOPE_ADDRESS) scope.grabData() scope.writeWaveformToFile(filename) scope.close()
# # This script is just to test waverunner functionality as a module # import numpy from matplotlib import pyplot import sys import os sys.path.append(os.path.expanduser('~/Source')) sys.path.append(os.path.expanduser('~/src')) sys.path.append('/var/local/src') from pyoscope import Waverunner """ Example program to plot the Y-T data from one scope channel derived from capture_channel_1.py but using new interface methods """ # Initialize our scope scope = Waverunner("127.0.0.1") scope.grabData() data1 = scope.getScaledWaveform(1) data2 = scope.getScaledWaveform(2) # Now, generate a time axis. time = scope.getTimeAxis() # See if we should use a different time axis if (time[599] < 1e-3): time = time * 1e6 tUnit = "uS" elif (time[599] < 1): time = time * 1e3 tUnit = "mS" else: