ui framework for distributed fitting service
DESCRIPTION
UI Framework for Distributed Fitting Service. Paul Kienzle Wenwu Chen, Ziwen Fu Reflectometry Group, NIST. View Developer (UI). Reduce Service Developer (Reduce). Service. Service. Service. Service. Scientist (Application). Data simulation. Theory Developer (Map). - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: UI Framework for Distributed Fitting Service](https://reader034.vdocument.in/reader034/viewer/2022051517/56815a86550346895dc7f63f/html5/thumbnails/1.jpg)
UI Framework for Distributed Fitting Service
Paul KienzleWenwu Chen, Ziwen Fu
Reflectometry Group,NIST
![Page 2: UI Framework for Distributed Fitting Service](https://reader034.vdocument.in/reader034/viewer/2022051517/56815a86550346895dc7f63f/html5/thumbnails/2.jpg)
Software Infrastructure of PARK: the distributed fitting service
Job Server
ServiceService
ServiceService
Working Nodes
User Interface
Scientist (Application)
View Developer (UI)Reduce Service Developer (Reduce)
Data reduction
Theory Developer (Map)
Data simulation
Data presentation
Model buildingData View
![Page 3: UI Framework for Distributed Fitting Service](https://reader034.vdocument.in/reader034/viewer/2022051517/56815a86550346895dc7f63f/html5/thumbnails/3.jpg)
Distributed Computing Environmentloose coupled server/client pattern (map/reduce)
Service ServerMaster Node
User
Cluster
Working Nodes
User/Client
ServiceServerManagement
WorkingServer
User User User User
![Page 4: UI Framework for Distributed Fitting Service](https://reader034.vdocument.in/reader034/viewer/2022051517/56815a86550346895dc7f63f/html5/thumbnails/4.jpg)
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
![Page 5: UI Framework for Distributed Fitting Service](https://reader034.vdocument.in/reader034/viewer/2022051517/56815a86550346895dc7f63f/html5/thumbnails/5.jpg)
Data Structure & UI for Fitting(1)
FittingConstrain
![Page 6: UI Framework for Distributed Fitting Service](https://reader034.vdocument.in/reader034/viewer/2022051517/56815a86550346895dc7f63f/html5/thumbnails/6.jpg)
Data Structure & UI for Fitting(2)
FittingModelBuilder
FittingDatasetViewer/EditorFittingResultsViewer
![Page 7: UI Framework for Distributed Fitting Service](https://reader034.vdocument.in/reader034/viewer/2022051517/56815a86550346895dc7f63f/html5/thumbnails/7.jpg)
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?
![Page 8: UI Framework for Distributed Fitting Service](https://reader034.vdocument.in/reader034/viewer/2022051517/56815a86550346895dc7f63f/html5/thumbnails/8.jpg)
GUI Framework
FittingConstrain
FittingModelBuilderFittingDatasetViewer
FittingDatasetEditor
FittingModelPage
Dataset event
Dataset event
Model event
Model event Model events:1. The whole model is updated2. The parameter value is changed
FittingViewer
Network event
![Page 9: UI Framework for Distributed Fitting Service](https://reader034.vdocument.in/reader034/viewer/2022051517/56815a86550346895dc7f63f/html5/thumbnails/9.jpg)
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)
![Page 10: UI Framework for Distributed Fitting Service](https://reader034.vdocument.in/reader034/viewer/2022051517/56815a86550346895dc7f63f/html5/thumbnails/10.jpg)
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
![Page 11: UI Framework for Distributed Fitting Service](https://reader034.vdocument.in/reader034/viewer/2022051517/56815a86550346895dc7f63f/html5/thumbnails/11.jpg)
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
![Page 12: UI Framework for Distributed Fitting Service](https://reader034.vdocument.in/reader034/viewer/2022051517/56815a86550346895dc7f63f/html5/thumbnails/12.jpg)
Examples: SNS Refl Fitting
• Theory – ReflTheory*
• Data structure – ReflSNSDataset, ReflSNSData– ReflParameter*
• Dataset – reflDatasetViewer, reflDatasetEditor– reflDatasetMeta, reflDatasetPanel
• Model Builder – ReflModelPage, ReflModelBuilder
![Page 13: UI Framework for Distributed Fitting Service](https://reader034.vdocument.in/reader034/viewer/2022051517/56815a86550346895dc7f63f/html5/thumbnails/13.jpg)
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
![Page 14: UI Framework for Distributed Fitting Service](https://reader034.vdocument.in/reader034/viewer/2022051517/56815a86550346895dc7f63f/html5/thumbnails/14.jpg)
Download PARK
Source code:
svn co svn://[email protected]/park
Windows executable files:
http://chemnuc-20.umd.edu/~DANSE/ download/index.html
![Page 15: UI Framework for Distributed Fitting Service](https://reader034.vdocument.in/reader034/viewer/2022051517/56815a86550346895dc7f63f/html5/thumbnails/15.jpg)
Data Structure & UI for Fitting(1)
XmlMultiplexor
![Page 16: UI Framework for Distributed Fitting Service](https://reader034.vdocument.in/reader034/viewer/2022051517/56815a86550346895dc7f63f/html5/thumbnails/16.jpg)
Data Structure & UI for Fitting(2)
![Page 17: UI Framework for Distributed Fitting Service](https://reader034.vdocument.in/reader034/viewer/2022051517/56815a86550346895dc7f63f/html5/thumbnails/17.jpg)
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
![Page 18: UI Framework for Distributed Fitting Service](https://reader034.vdocument.in/reader034/viewer/2022051517/56815a86550346895dc7f63f/html5/thumbnails/18.jpg)
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
![Page 19: UI Framework for Distributed Fitting Service](https://reader034.vdocument.in/reader034/viewer/2022051517/56815a86550346895dc7f63f/html5/thumbnails/19.jpg)
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
![Page 20: UI Framework for Distributed Fitting Service](https://reader034.vdocument.in/reader034/viewer/2022051517/56815a86550346895dc7f63f/html5/thumbnails/20.jpg)
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<dataset>
<data> … </data>* <reduction> [<array> array_data </array> <matrix> </matrix> <narray> </narray>]* reduction_data</reduction> <theory> [<array> array_data </array> <matrix> </matrix> <narray> </narray>]* theory_data </theory>
</dataset>
![Page 21: UI Framework for Distributed Fitting Service](https://reader034.vdocument.in/reader034/viewer/2022051517/56815a86550346895dc7f63f/html5/thumbnails/21.jpg)
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 / Parametermetadata.para_name = para_valueparameter.attr_name = attr_value
![Page 22: UI Framework for Distributed Fitting Service](https://reader034.vdocument.in/reader034/viewer/2022051517/56815a86550346895dc7f63f/html5/thumbnails/22.jpg)
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 1st or 2nd derivative
Optimizer
optimizer.para_name = para_value
Optimize()do the optimization
![Page 23: UI Framework for Distributed Fitting Service](https://reader034.vdocument.in/reader034/viewer/2022051517/56815a86550346895dc7f63f/html5/thumbnails/23.jpg)
<fitting> <multiplexor> <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"> <gauss scale="0.500000015926"/> </data>
<data classname="gaussXmlDataSource.GaussXmlData" file="C:\gauss\gauss1.dat" srctype="local"> <gauss scale="0.500000015926"/> </data> </dataset> <param a0="39.0" name="g0" sigma="1.0" x0="0.0"/> </model> <optimizer classname=‘scipy.sciopt‘ funcname=‘fmin’
xtol='1e-005' ftol='1e-005' maxiter='1000'/> </multiplexor></fitting>
![Page 24: UI Framework for Distributed Fitting Service](https://reader034.vdocument.in/reader034/viewer/2022051517/56815a86550346895dc7f63f/html5/thumbnails/24.jpg)
<fitting> <multiplexor> <model name='M0' theory=‘reflTheory' weight='1.0'>
<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'/>
</data> </dataset> <profile> … </profile></model><constrains></constrains><variables></variables></multiplexor><optimizer classname='boxmin' xtol='1e-005' ftol='1e-005' maxiter='1000'/></fitting>
![Page 25: UI Framework for Distributed Fitting Service](https://reader034.vdocument.in/reader034/viewer/2022051517/56815a86550346895dc7f63f/html5/thumbnails/25.jpg)
<profile script='profile.py'>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])
</profile>