def __init__(self, *args, **kwargs): FigureWindow.__init__(self, *args, **kwargs) # The toolbar { toolTabs = self.toolTabs # Data tab { frmCAF = Frame(toolTabs) grpLoad = LoadGroup(frmCAF, topwin = self) grpLoad.pack(side=LEFT, fill=Y) grpColormap = ColormapGroup(frmCAF, topwin=self) grpColormap.pack(side=LEFT, fill=Y) toolTabs.add(frmCAF, text='CAF') # } End data tab self.makeViewTab() self.makeMarkerTab() #} End toolbar figureBook = self.figureBook figureBook.makeFigures( figureMeta=[ {'name':'discrete-CAF', 'polar':False} ] ) self.caf = None
def __init__(self, *args, **kwargs): FigureWindow.__init__(self, *args, **kwargs) # The toolbar { toolTabs = self.toolTabs # Algorithm tab { frmAlgo = Frame(toolTabs) grpSolve = OptimizeGroup(frmAlgo, topwin=self) grpSolve.pack(side=LEFT, fill=Y) grpEdit = EditGroup(frmAlgo, topwin=self) grpEdit.pack(side=LEFT, fill=Y) self.__grpEdit = grpEdit toolTabs.add(frmAlgo, text='Algorithm') # } End Algorithm tab # View Tab { self.makeViewTab() # } End View tab # Marker Tab { self.makeMarkerTab() #} End Marker tab # Export tab { self.makeExportTab() frmExport = self.exportFrame grpExport = FileExportGroup(frmExport, topwin=self) grpExport.pack(side=LEFT, fill=Y) # } End Export tab # } End toolbar self.idealPattern = None self.angles = None figureBook = self.figureBook figureBook.makeFigures( figureMeta=[ dict(name='Cartesian' , polar=False), dict(name='Polar' , polar=True) ] ) figCart = figureBook[0] figCart.plotFunction = lambda *args, **kwargs: figCart.plot(*args, **kwargs) figPolar = figureBook[1] figPolar.plotFunction = lambda angles, pattern, **kwargs: figPolar.plot(angles/180.*pi, pattern, **kwargs) self.angles = r_[-90:90.1:0.1] self.__problem = pattern2corrmtx.Problem() self.__piecewisePattern = pattern2corrmtx.PiecewisePattern() self.R = None
def __init__(self, *args, **kwargs): FigureWindow.__init__(self, *args, **kwargs) # The toolbar { toolTabs = self.toolTabs # Algorithm tab { frmAlgo = Frame(toolTabs) grpSolve = OptimizeGroup(frmAlgo, topwin=self) grpSolve.pack(side=LEFT, fill=Y) grpEdit = EditGroup(frmAlgo, topwin=self) grpEdit.pack(side=LEFT, fill=Y) self.__grpEdit = grpEdit toolTabs.add(frmAlgo, text='Algorithm') # } End Algorithm tab # View Tab { self.makeViewTab() # } End View tab # Marker Tab { self.makeMarkerTab() #} End Marker tab # Export tab { self.makeExportTab() frmExport = self.exportFrame grpExport = FileExportGroup(frmExport, topwin=self) grpExport.pack(side=LEFT, fill=Y) # } End Export tab # } End toolbar self.idealPattern = None self.angles = None figureBook = self.figureBook figureBook.makeFigures(figureMeta=[ dict(name='Cartesian', polar=False), dict(name='Polar', polar=True) ]) figCart = figureBook[0] figCart.plotFunction = lambda *args, **kwargs: figCart.plot( *args, **kwargs) figPolar = figureBook[1] figPolar.plotFunction = lambda angles, pattern, **kwargs: figPolar.plot( angles / 180. * pi, pattern, **kwargs) self.angles = r_[-90:90.1:0.1] self.__problem = pattern2corrmtx.Problem() self.__piecewisePattern = pattern2corrmtx.PiecewisePattern() self.R = None
def __init__(self, *args, **kwargs): FigureWindow.__init__(self, *args, **kwargs) # The toolbar { toolTabs = self.toolTabs # Data tab { frmCAF = Frame(toolTabs) grpLoad = LoadGroup(frmCAF, topwin=self) grpLoad.pack(side=LEFT, fill=Y) grpColormap = ColormapGroup(frmCAF, topwin=self) grpColormap.pack(side=LEFT, fill=Y) toolTabs.add(frmCAF, text='CAF') # } End data tab self.makeViewTab() self.makeMarkerTab() #} End toolbar figureBook = self.figureBook figureBook.makeFigures(figureMeta=[{ 'name': 'discrete-CAF', 'polar': False }]) self.caf = None
def __init__(self, *args, **kwargs): FigureWindow.__init__(self, *args, **kwargs) self.currentData = None # algorithm dict and current data self.algorithms = AlgorithmDict() self.lockAttribute('algorithms') # # The toolbar toolTabs = self.toolTabs figureBook = self.figureBook frmAlgo = Frame(toolTabs) grpAlgoSel = AlgoSelGroup(frmAlgo, topwin=self) grpAlgoSel.pack(side=LEFT, fill=Y) grpParams = ParamsGroup(frmAlgo, topwin=self) grpParams.pack(side=LEFT, fill=Y) grpSolve = OptimizeGroup(frmAlgo, topwin=self) grpSolve.pack(side=LEFT, fill=Y) toolTabs.add(frmAlgo, text='Algorithm') with self.attributeLock: setMultiAttr(self, grpAlgoSel = grpAlgoSel, grpParams = grpParams, grpSolve = grpSolve ) self.makeViewTab() self.makeMarkerTab() self.makeExportTab() # End toolbar figureBook.makeFigures( figureMeta = [ dict(name='Envelope', polar=False), dict(name='Phase', polar=False), dict(name='AutoCorrelation', polar=False), dict(name='PSD', polar=False) ] ) with open(Application.instance.configFileName) as f: config = json.load(f) algorithms = config['SingleWaveformAlgorithms'] for algo in algorithms: self.loadAlgorithm(moduleName=algo['ModuleName'], className=algo['ClassName']) self.grpAlgoSel.algoList.current(len(algorithms)-1) figEnvelope = figureBook[0] figEnvelope.plotFunction = lambda currentData, *args, **kwargs:\ figEnvelope.plot(abs(currentData), *args, **kwargs) figPhase = figureBook[1] figPhase.plotFunction = lambda currentData, *args, **kwargs:\ figPhase.plot(angle(currentData), *args, **kwargs) def plot_acdb(currentData, *args, **kwargs): s = currentData if not isinstance(s, ndarray): s = array(s) N = len(s) ac = convolve(s, conj(s[::-1])) acdb = 20*log10(abs(ac)) acdb = acdb - max(acdb) figAuto.plot(r_[(-N+1):N], acdb, *args, **kwargs) figAuto = figureBook[2] figAuto.plotFunction = plot_acdb figPSD = figureBook[3] figPSD.plotFunction = lambda currentData, *args, **kwargs:\ figPSD.plot(abs(fft.fft(currentData)), *args, **kwargs)