Bases: sans.guiframe.plugin_base.PluginBase
Fitting plugin is used to perform fit
Display fit result in batch :param result: list of objects received fromt fit engines :param pars: list of fitted parameters names :param page_id: list of page ids which called fit function :param elapsed: time spent at the fitting level
Get handy Chisqr using the output from draw1D and 2D, instead of calling expansive CalcChisqr in guithread
request fitpanel to close a given page when its unique data is removed from the plot. close fitpage only when the a loaded data is removed
Complete plotting 1D data
Complete get the result of modelthread and create model 2D that can be plot.
Draw model 1D from loaded data1D
Parameters: |
|
---|
draw model in 2D
Parameters: |
|
---|
Display result of the fit on related panel(s). :param result: list of object generated when fit ends :param pars: list of names of parameters fitted :param page_id: list of page ids which called fit function :param elapsed: time spent at the fitting level
Create and set fit engine with series of data and model :param pars: list of fittable parameters :param fitter_list: list of fit engine :param value: structure storing data mapped to their model, range etc..
Give sleep to MAC
receive and event telling to update a panel with a name starting with event.panel_name. this method update slicer panel for a given interactor.
Parameters: | event – contains type of slicer , paramaters for updating the panel and panel_name to find the slicer ‘s panel concerned. |
---|
when Select data to fit a new page is created .Its reference is added to self.page_finder
Allow to select the type of engine to perform fit
Parameters: | engine – the key work of the engine |
---|
react to model selection on any combo box or model menu.plot the model
Parameters: | evt – wx.combobox event |
---|
Receive a panel as event and send it to guiframe
Parameters: | event – event containing a panel |
---|
Clear the boxslicer when close the panel associate with this slicer
set engine to park
set engine to scipy
Plot the residuals
Parameters: |
|
---|
: Note: this is different from the residuals in cal_chisqr()
unschedule or schedule all fitproblem to be fit
return the current type of engine
Update the output of plotting model 1D
Update the output of plotting model
Update Fit button when fit stopped
: parameter page_id: fitpage where the button is
adds a color as a key with a plot id as its value to a dictionary
given a data, ask to the fitting panel to create a new fitting page, get this page and store it into the page_finder of this plug-in :param data: is a list of data
if return True, then call handler to laod data
Given an ID create a fitproblem container
delete the given data from panel
Given an ID create a fitproblem container
Draw model.
Parameters: |
|
---|
Check if the plugin has a batch capability
Get the context menu items available for P(r).them allow fitting option for Data2D and Data1D only.
Parameters: | graph – the Graph object to which we attach the context menu |
---|---|
Returns: | a list of menu items with call-back function |
Note : | if Data1D was generated from Theory1D the fitting option is not allowed |
return state reader and its extensions
Set graph_id for fitprobelm
return self.page_finder used also by simfitpage.py
Create and return a list of panel objects
Get the list of panel names for this perspective
Returns a set of menu entries for tools
Show a general help dialog.
return True is this plugin is always active and it is local to guiframe even if the user is switching between perspectives
data_name = ‘None’ in_use = False example [(data_name, self.sub_menu)]
Load data
Load entire folder
Get series of data, model, associates parameters and range and send then to series of fit engines. Fit data and model, display result to corresponding panels. :param uid: id related to the panel currently calling this fit function.
ask fit panel to create a new empty page
Create a page to access simultaneous fit option
switch the the notebook of batch mode or not
Call back function for the perspective menu item. We notify the parent window that the perspective has changed.
Parameters: | event – menu event |
---|
Set batch_reset_flag
Set_state_helper. This actually sets state after plotting data from state file.
Append menu item under file menu item of the frame
Create a menu for the Fitting plug-in
Parameters: |
|
---|---|
Returns: | list of information to populate the main menu |
Post initialization call back to close the loose ends
Ready for another fit
remove model plot when a fit page is closed :param uid: the id related to the fitpage to close :param fid: the id of the fitproblem(data, model, range,etc)
save fit page state into file
Set the fit problem field to 0 or 1 to schedule that problem to fit. Schedule the specified fitproblem or get the fit problem related to the current page and set value. :param value: integer 0 or 1 :param uid: the id related to a page contaning fitting information
the plugin to its batch state if flag is True
receive a list of data to fit
Call back method that True to notify the parent that the current plug-in can be set as default perspective. when returning False, the plug-in is not candidate for an automatic default perspective setting
Set the fitting range of a given page for all its data by default. If fid is provide then set the range only for the data with fid as id :param uid: id corresponding to a fit page :param fid: id corresponding to a fit problem (data, model) :param qmin: minimum value of the fit range :param qmax: maximum value of the fit range
Set the fit weights of a given page for all its data by default. If fid is provide then set the range only for the data with fid as id :param uid: id corresponding to a fit page :param fid: id corresponding to a fit problem (data, model) :param weight: current dy data
Set ftol: Relative error desired in the sum of chi squares.
Set graph_id for fitprobelm
Used by simfitpage.py to reset a parameter given the string constrainst.
Parameters: |
|
---|---|
Note : | expecting park used for fit. |
Set the list of param names to fit for fitprobelm
Get a smear object and store it to a fit problem of fid as id. If proper flag is enable , will plot the theory with smearing information.
Parameters: |
|
---|
Call-back method for the fit page state reader. This method is called when a .fitv/.svs file is loaded.
: param state: PageState object : param datainfo: data
Close default (welcome) panel
Dialog to select ftol for Scipy
receive a word containing dot and split it. used to split parameterset name into model name and parameter name example:
paramaterset (item) = M1.A
Will return model_name = M1 , parameter name = A
Stop the fit engine
Recieve a list of data and store them ans well as a caption of the fit page where they come from. :param uid: if related to a fit page :param data_list: list of data to fit :param caption: caption of the window related to these data
return True if these plugin use data