from paida import * analysisFactory = IAnalysisFactory.create() treeFactory = analysisFactory.createTreeFactory() tree = treeFactory.create() functionFactory = analysisFactory.createFunctionFactory(tree) func1 = functionFactory.createFunctionFromScript('sincos', 1, 'a * sin(x[0]) * cos(x[0])', 'a', 'SinCos') functionFactory.catalog().add('SinCos', func1) func2 = functionFactory.createFunctionByName('g-sincos', 'SinCos * G') func1.setParameter('a', 5.0) ### func2 was created from 'SinCos' and 'G'. ### SinCos has the parameter 'a'. ### G has the parameters 'amplitude', 'mean' and 'sigma'. ### Then func2 has the parameters 'SinCos_a', 'G_amplitude', 'G_mean' and 'G_sigma'. func2.setParameter('SinCos_a', 5.0) func2.setParameter('G_mean', 3.0) func2.setParameter('G_sigma', 3.0) plotterFactory = analysisFactory.createPlotterFactory() plotter = plotterFactory.create('PAIDA Plotter') plotter.createRegions(1, 2) plotter.region(0).setTitle('User created function (cataloged as SinCos)') plotter.region(0).style().setParameter('showTitle', 'true') plotter.region(0).plot(func1) plotter.region(1).setTitle('Reuse cataloged SinCos as a part of new function') plotter.region(1).style().setParameter('showTitle', 'true') plotter.region(1).plot(func2) ### Wait. dummy = raw_input('Hit any key.')