ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change
on this file since 1c94a9f1 was
cf3b781,
checked in by Gervaise Alina <gervyh@…>, 16 years ago
|
need more tests.but usecase 3 implemented
|
-
Property mode set to
100644
|
File size:
1.4 KB
|
Rev | Line | |
---|
[7705306] | 1 | #class Fitting |
---|
| 2 | from sans.guitools.plottables import Data1D |
---|
| 3 | from Loader import Load |
---|
| 4 | from scipy import optimize |
---|
| 5 | from ScipyFitting import ScipyFit |
---|
| 6 | from ParkFitting import ParkFit |
---|
| 7 | |
---|
| 8 | |
---|
| 9 | class Fit: |
---|
| 10 | """ |
---|
| 11 | Wrap class that allows to select the fitting type |
---|
| 12 | """ |
---|
| 13 | def __init__(self): |
---|
| 14 | |
---|
| 15 | # To initialize a type of Fit |
---|
| 16 | self._engine=None |
---|
| 17 | |
---|
| 18 | def fit_engine(self,word): |
---|
| 19 | """ |
---|
| 20 | Select the type of Fit |
---|
| 21 | @param word: the keyword to select the fit type |
---|
| 22 | """ |
---|
| 23 | if word=="scipy": |
---|
| 24 | self._engine=ScipyFit() |
---|
| 25 | elif word=="park": |
---|
| 26 | self._engine=ParkFit() |
---|
| 27 | else: |
---|
| 28 | raise ValueError, "enter the keyword scipy or park" |
---|
| 29 | def returnEngine(self): |
---|
| 30 | return self._engine |
---|
| 31 | |
---|
| 32 | def fit(self,pars, qmin=None, qmax=None): |
---|
| 33 | """ Do the fit """ |
---|
| 34 | |
---|
| 35 | def set_model(self,model,Uid): |
---|
| 36 | """ Set model """ |
---|
| 37 | |
---|
| 38 | def set_data(self,data,Uid): |
---|
| 39 | """ Receive plottable and create a list of data to fit""" |
---|
| 40 | |
---|
| 41 | def get_model(self,Uid): |
---|
| 42 | """ return list of data""" |
---|
| 43 | |
---|
[cf3b781] | 44 | def set_param(self,model,name, pars): |
---|
[7705306] | 45 | """ Recieve a dictionary of parameter and save it """ |
---|
| 46 | |
---|
[cf3b781] | 47 | def remove_data(self,Uid,data=None): |
---|
| 48 | """ remove one or all data""" |
---|
| 49 | |
---|
| 50 | def remove_model(self,Uid): |
---|
| 51 | """ remove model """ |
---|
[7705306] | 52 | |
---|
| 53 | """ |
---|
Note: See
TracBrowser
for help on using the repository browser.