Bases: exceptions.Exception
Exception raise to stop the fit
exception message
add_data fill a self.data_list with data to fit
Parameters: | data – Data to add in the list |
---|
Returns: | list of data data_list |
---|
Returns: | saved model |
---|
return self.selected value
Remove one element from the list
Parameters: | data – Data to remove from data_list |
---|
set_model save a copy of the model
Parameters: | model – the model being set |
---|
set self.selected to 0 or 1 for other values raise an exception
Parameters: | value – integer between 0 or 1 |
---|
Bases: sans.dataloader.data_info.Data1D
Wrapper class for SANS data FitData1D inherits from DataLoader.data_info.Data1D. Implements a way to get residuals from data.
Add notes to datainfo
Clone the current object, without copying the data (which will be filled out by a subsequent operation). The data arrays will be initialized to zero.
Parameters: |
|
---|
return the range of data.x to fit
Check whether the data has slit smearing information
Returns: | True is slit smearing info is present, False otherwise |
---|
Compute residuals.
If self.smearer has been set, use if to smear the data before computing chi squared.
Parameters: | fn – function that return model value |
---|---|
Returns: | residuals |
Returns: | residuals derivatives . |
---|---|
Note : | in this case just return empty array |
to set the fit range
set the x axis label and unit
set the y axis label and unit
Bases: sans.dataloader.data_info.Data2D
Wrapper class for SANS data
Add notes to datainfo
Clone the current object, without copying the data (which will be filled out by a subsequent operation). The data arrays will be initialized to zero.
Parameters: |
|
---|
return the range of data.x to fit
return the residuals
Returns: | residuals derivatives . |
---|---|
Note : | in this case just return empty array |
Determine the correct qx_data and qy_data within range to fit
to set the fit range
Set smearer
set the x axis label and unit
set the y axis label and unit
set the z axis label and unit
Parameters: | id – id is key in the dictionary containing the model to return |
---|---|
Returns: | a model at this id or None if no FitArrange element was created with this id |
return the self.selected value of the fit problem of id
Parameters: | id – the id of the problem |
---|
remove fitarrange in id
select a couple of model and data at the id position in dictionary and set in self.selected value to value
Parameters: | value – the value to allow fitting. can only have the value one or zero |
---|
Receives plottable, creates a list of data to fit,set data in a FitArrange object and adds that object in a dictionary with key id.
Parameters: |
|
---|
set a model on a given in the fit engine.
Parameters: | model – sans.models type |
---|
Parameters: |
|
---|---|
Note : | pars must contains only name of existing model’s parameters |
Bases: park.model.Model
PARK wrapper for SANS models.
override eval method of park model.
Parameters: | x – the x value used to compute a function |
---|
Evaluate the model and derivatives wrt pars at x.
pars is a list of the names of the parameters for which derivatives are desired.
This method needs to be specialized in the model to evaluate the model function. Alternatively, the model can implement is own version of residuals which calculates the residuals directly instead of calling eval.
return a list of value of paramter to fit
Parameters: | fitparams – list of paramaters name to fit |
---|
Set the initial value for a set of parameters.
E.g., model.set(width=3,center=5)
Set value for parameters to fit
Parameters: | params – list of value for parameters to fit |
---|
Sans Assembly class a class wrapper to be call in optimizer.leastsq method
Check the lower and upper bound of the parameter value and set res to the inf if the value is outside of the range :limitation: the initial values must be within range.
Calculates chi^2
Parameters: | params – list of parameter values |
---|---|
Returns: | chi^2 |
Bases: park.parameter.Parameter
SANS model parameters for use in the PARK fitting service. The parameter attribute value is redirected to the underlying parameter value in the SANS model.
Return the current value for a parameter.
Return true if the value is in the range
parameter name
Override _getrange of park parameter return the range of parameter
Set a parameter to a value, a range or an expression. If it is a value, the parameter will be fixed for the fit. If it is a range, the value will be varying for the fit. If it is an expression, the parameter will be calculated from the values of other parameters in the fit.
Raises ValueError if the value could not be interpreted.
Set the full path to the parameter as used in expressions involving the parameter name.
Return parameter range string.
E.g., ” Gold .....|.... 5.2043 in [2,7]”
override the _getvalue of park parameter
:return value the parameter associates with self.name