def readScanAttributes(): selectedScan = scans.get() scan = read.scan(selectedScan) attributes = read.scanHeader(scan) message = "SCAN " + str(selectedScan) + ":\n" for k in attributes.keys(): message = message + str(k) + ' = ' + str(attributes[k]) + '\n' attributesMessage.configure(text=message)
def readValidity(): scanNum = scans.get() coordNum = coordinates.get() scan = read.scan(scanNum) coord = read.coordinate(scan, coordNum) attrs = read.coordinateHeader(coord) scan.close() if attrs['Valid'] == 1: return True else: return False
def readCoordinateAttributes(): scanNum = scans.get() coordNum = coordinates.get() scan = read.scan(scanNum) coord = read.coordinate(scan, coordNum) attrs = read.coordinateHeader(coord) scan.close() message = "Scan " + str(scanNum) + " at COORDINATE " + str( coordNum) + ":\n" for k in attrs.keys(): message = message + str(k) + ' = ' + str(attrs[k]) + '\n' attributesMessage.configure(text=message)
def readChannelAttributes(): selectedScan = scans.get() selectedCoordinate = coordinates.get() selectedChannel = convertChannelNameToIndex(channels.get()) scan = read.scan(selectedScan) coord = read.coordinate(scan, selectedCoordinate) channel = read.channel(coord, selectedChannel) attributes = read.channelHeader(channel) message = "Scan " + str(selectedScan) + " at coord " + str( selectedCoordinate) + " CHANNEL " + selectedChannel + ":\n" for k in attributes.keys(): message = message + str(k) + ' = ' + str(attributes[k]) + '\n' attributesMessage.configure(text=message)
def rawGraph(): scanNum = scans.get() coordNum = coordinates.get() channelNum = convertChannelNameToIndex(channels.get()) scan = read.scan(scanNum) coord = read.coordinate(scan, coordNum) channel = read.channel(coord, channelNum) attrs = read.channelHeader(channel) samplePeriodNano = int(attrs['SamplePeriod']) voltage = read.channelData(channel) * ( (read.channelHeader(channel)['InputRange']) / 65536) scan.close() time = range(0, samplePeriodNano * (len(voltage)), samplePeriodNano) newPlotWindow( time, voltage, "Time (ns)", "Voltage (V)", "Raw graph for scan " + scanNum + " coord " + coordNum + " channel " + channelNum)