1 / 25

UI Framework for Distributed Fitting Service

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).

aysha
Download Presentation

UI Framework for Distributed Fitting Service

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

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

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

  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 FittingModelPage FittingDatasetEditor Dataset event Dataset event FittingDatasetViewer FittingModelBuilder Model event Network event Model event Model events: 1. The whole model is updated 2. The parameter value is changed FittingConstrain FittingViewer

  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.html

  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 <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>

  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 1st or 2nd derivative Optimizer optimizer.para_name = para_value Optimize() do the optimization

  23. <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>

  24. <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>

  25. <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>

More Related