Presentation is loading. Please wait.

Presentation is loading. Please wait.

UI Framework for Distributed Fitting Service Paul Kienzle Wenwu Chen, Ziwen Fu Reflectometry Group, NIST.

Similar presentations


Presentation on theme: "UI Framework for Distributed Fitting Service Paul Kienzle Wenwu Chen, Ziwen Fu Reflectometry Group, NIST."— Presentation transcript:

1 UI Framework for Distributed Fitting Service Paul Kienzle Wenwu Chen, Ziwen Fu Reflectometry Group, NIST

2 Software Infrastructure of PARK: the distributed fitting service Job Server Service Working Nodes User Interface Scientist (Application) View Developer (UI)Reduce Service Developer (Reduce) Data reduction Theory Developer (Map) Data simulation Data presentation Model building Data View

3 Distributed Computing Environment loose coupled server/client pattern (map/reduce) Service Server Master Node User Cluster Working Nodes User/Client ServiceServer Management WorkingServer User

4 UI Overview High Level –Job Work flow –Job History, Redo, Undo –…… Low level (UI/GUI*) –Model building (dataset, reduction, model) –Job request –Viewer of Job reply

5 Data Structure & UI for Fitting(1) FittingConstrain

6 Data Structure & UI for Fitting(2) FittingModelBuilder FittingDatasetViewer/Editor FittingResultsViewer

7 Developed GUI for Fitting Service TraitsUI –Easy for simple applications –Less-controllable of the widgets –Compatible, complexity, speed wx AUI + matplotlib –Dataset orientated (works now, version 0.3) –Job orientated (in developing, version 0.4) –wx.plot now, changed to matplotlib later Future?

8 GUI Framework FittingConstrain FittingModelBuilderFittingDatasetViewer FittingDatasetEditor FittingModelPage Dataset event Model event Model events: 1. The whole model is updated 2. The parameter value is changed FittingViewer Network event

9 Models Dataset UI –DatasetViewer : FittingDatasetViewer –DatasetEditor : FittingDatasetEditor –DatasetMetadataViewer : FittingDatasetMetaViewer Data Structure –Dataset : XmlDataset (data reduction) –Data : XmlData (read/write data) –MetaData : XmlMetaData (read/write data) –Parameter : XmlParameter (parameters for model)

10 Models ModelBuilder UI –ModelPage : FittingModelPage –ModelBuilder : FittingModelBuilder –ModelResultViewer: FittingViewer (optional) –ModelParameterViewer: FittingParameterViewer (optional) Theory –ModelTheory: Theory Available Models: Gaussian Fitting, Reflectometry for NCNR and SNS ~/park/parkClient/builder/gauss, NCNRRefl, refl

11 Examples: Gaussian Fitting Theory (Theory developer) –GaussTheory Data structure (Theory & UI developer) –GaussXmlDataset, GaussXmlData –GaussParameter Dataset (UI developer) –GaussDatasetViewer, GaussDatasetEditor –GaussDatasetMeta, GaussDatasetPanel Model Builder (UI developer) –GaussModelPage, GaussModelBuilder

12 Examples: SNS Refl Fitting Theory –ReflTheory* Data structure –ReflSNSDataset, ReflSNSData –ReflParameter* Dataset –reflDatasetViewer, reflDatasetEditor –reflDatasetMeta, reflDatasetPanel Model Builder –ReflModelPage, ReflModelBuilder

13 Examples: NCNR Refl Fitting Theory –ReflTheory* Data structure –NCNRDataset, NCNRData –ReflParameter* Dataset –NCNRDatasetViewer, NCNRDatasetEditor –NCNRDatasetMeta, NCNRDatasetPanel Model Builder –ReflModelPage, ReflModelBuilder Shared with SNS Refl Fitting

14 Download PARK Source code: svn co svn://svn@danse.us/park Windows executable files: http://chemnuc-20.umd.edu/~DANSE/ download/index.htmlhttp://chemnuc-20.umd.edu/~DANSE/

15 Data Structure & UI for Fitting(1) XmlMultiplexor

16 Data Structure & UI for Fitting(2)

17 Fitting doFitting() –Return the object representing the fitting results getOptimizer() –Return a real optimizer object getXmlOptimizer() –return the object that is the xml representation of the optimizer setXmlOptimizer(optimizer) –set the object that is the xml representation of the optimizer getXmlMultiplexor() –get the object that is the xml representation of the multiplexor setXmlMultiplexor(xor) –set the object that is the xml representation of the multiplexor

18 XmlMultiplexor getVariables() –Return a list of variable definitions –Variable attributes: Name: read only, model_name.parameter_name.attribute_name Flag: ‘optimized’ | ‘fixed’ | ‘constrains’ Value: initial value Range: [value0, value1] getConstrains() –Return a list of variable constrains –Constrain attributes: Target: model_name.parameter_name.attribute_name Constrain expression: string representation of constrain evaluate(): evaluate and set the parameter’s value getModels() –Return a list of models

19 Model getDataSet() –Return the data set object representing the experimental data and meta data getWeight() / setWeight(weight) –Get/set the weight getTheory() / setTheoryName(string name) –Return /set the theory object to calculate the theoretical data. getParameters() / addParameter() –Return the parameters representing the model

20 Dataset addData(data) –Add a data removeData(data) –Remove a data getData() –Return a list of data getReductionData() –Return the joined experimental data in order of (x, y, dy)* –x, y, dy are data objects setTheoryData(data) –Set the theoretical data associated with the dataset getTheoryData() –Return the theory data associated with the dataset getDataSourceType() –Return the data source type setDataSourceType(dstype) –Set the data source type –XML format for dataset … * [ array_data ]* reduction_data [ array_data ]* theory_data

21 Data getReductionData() / getRawData() –Return the reduction/raw data in order of (x, y, dy)* getMetaData() –Return the meta data associated with this data getDataSourceType() –Return the data source type setDataSourceType(dstype) –Set the data source type _readData () –Read the data from the data source _writeData () –Write the data to the data source DataSourceType: –‘Local’, ‘Imbed’, ‘Reply’, ‘URL’, ‘USER’ MetaData / Parameter metadata.para_name = para_value parameter.attr_name = attr_value

22 Theory getDataset() / setDataset(dataset) –Return the dataset / set the dataset object getParameters() –Return a list of parameters getTheoryData() –Return the theoretical data object getObjectiveFx() –Return the objective function for optimizer has1stDerivate / has2ndDerivate (parameter_name) / –Return the true if the given parameter has the 1 st or 2 nd derivative Optimizer optimizer.para_name = para_value Optimize() do the optimization

23 <model modelType="gauss" name="M0“ theory="gaussTheory.GaussTheory" weight="1.0"> <dataset classname="gaussXmlDataSource.GaussXmlDataset" srctype="local"> <data classname="gaussXmlDataSource.GaussXmlData“ file="C:\ gauss\gauss1.dat" srctype="local"> <data classname="gaussXmlDataSource.GaussXmlData" file="C:\gauss\gauss1.dat" srctype="local"> <optimizer classname=‘scipy.sciopt‘ funcname=‘fmin’ xtol='1e-005' ftol='1e-005' maxiter='1000'/>

24 <dataset classname=‘NCNRReflDataset.NCNRDataset' name='Dataset1' srctype='local'> <data srctype='local' classname='shannonDataset.ShannonData' file='C:\Documents and Settings\UMCP\park-0.3.8\du53.dat'> <NCNR wavelength='14.85' scale='1.0' divergence='10' offset2='2.0' offset='2.0' wavelengthdivergence='0.021' angulardivergence='0.007' background='1e-010'/> …

25 from parseReflModelNb import * M1 = ReflModel("M1", file="inline", magnetic=False) M1.incident('Air', phi=0) M1.interface(8) M1.layer('dPS', depth=[80,90], rho=[5, 6, 9], mu=0) M1.interface(5) M1.layer('P2VP', depth=[10, 30], rho=[1, 1.8, 3], mu=0) M1.interface(5) M1.layer('SiOx', depth=[14, 20.4], rho=3.80, mu=0) M1.interface(5) M1.substrate('Si', rho=2.07, mu=0 ) fit = ParkFit([M1])


Download ppt "UI Framework for Distributed Fitting Service Paul Kienzle Wenwu Chen, Ziwen Fu Reflectometry Group, NIST."

Similar presentations


Ads by Google