Changeset f3377b8 in sasview for src/sas/perspectives/fitting/media
- Timestamp:
- May 15, 2015 9:36:38 PM (10 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 1fda506
- Parents:
- a6f3613
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/perspectives/fitting/media/fitting_help.rst
ra6f3613 rf3377b8 35 35 each data set. 36 36 37 Instructions on how to load and activate data are in the User Documentation 38 section :ref:`Loading_data`. 37 Instructions on how to load and activate data are in the section :ref:`Loading_data`. 39 38 40 39 SasView can fit data in one of three ways: … … 42 41 * in *Single* fit mode - individual data sets are fitted independently one-by-one 43 42 44 * in *Simultaneous* fit mode - multiple data sets are fitted simultaneously to 45 the *same* model with/without constrained parameters (this might be useful, for 46 example, if you have measured the same sample at different contrasts) 47 48 * in *Batch* fit mode - multiple data sets are fitted sequentially to the 49 *same* model (this might be useful, for example, if you have performed a kinetic 50 or time-resolved experiment and have *lots* of data sets!) 43 * in *Simultaneous* fit mode - multiple data sets are fitted simultaneously to the *same* model with/without constrained parameters (this might be useful, for example, if you have measured the same sample at different contrasts) 44 45 * in *Batch* fit mode - multiple data sets are fitted sequentially to the *same* model (this might be useful, for example, if you have performed a kinetic or time-resolved experiment and have *lots* of data sets!) 51 46 52 47 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ … … 58 53 59 54 * *Shapes* - models describing 'objects' (spheres, cylinders, etc) 60 * *Shape-Independent* - models describing structure in terms of density 61 correlation functions, fractals, peaks, power laws, etc 55 * *Shape-Independent* - models describing structure in terms of density correlation functions, fractals, peaks, power laws, etc 62 56 * *Customized Models* - SasView-created (non-library) Python models 63 57 * *Uncategorised* - other models (for reflectivity, etc) … … 65 59 66 60 Use the *Category* drop-down menu to chose a category of model, then select 67 a model from the drop-down menu beneath. You can decide your own model 68 categorizations using the :ref:`Category_Manager`. 61 a model from the drop-down menu beneath. A graph of the chosen model, calculated 62 using default parameter values, will appear. The graph will update dynamically 63 as the parameter values are changed. 64 65 You can decide your own model categorizations using the :ref:`Category_Manager`. 69 66 70 67 Once you have selected a model you can read its help documentation by clicking … … 84 81 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 85 82 83 .. _Category_Manager: 84 85 Category Manager 86 ---------------- 87 88 To change the model categorizations, either choose *Category Manager* from the 89 *View* option on the menubar, or click on the *Modify* button on the *Fit Page*. 90 91 .. image:: cat_fig0.bmp 92 93 The categorization of all models except the customized models can be reassigned, 94 added to, and removed using *Category Manager*. Models can also be hidden from view 95 in the drop-down menus. 96 97 .. image:: cat_fig1.bmp 98 99 Changing category 100 ^^^^^^^^^^^^^^^^^ 101 102 To change category, highlight a model in the list by left-clicking on its entry and 103 then click the *Modify* button. Use the *Change Category* panel that appears to make 104 the required changes. 105 106 .. image:: cat_fig2.bmp 107 108 To create a category for the selected model, click the *Add* button. In order 109 to delete a category, select the category name and click the *Remove Selected* 110 button. Then click *Done*. 111 112 Showing/hiding models 113 ^^^^^^^^^^^^^^^^^^^^^ 114 115 Use the *Enable All/Disable All* buttons and the check boxes beside each model to 116 select the models to show/hide. To apply the selection, click *Ok*. Otherwise click 117 *Cancel*. 118 119 *NB: it may be necessary to change to a different category and then back again* 120 *before any changes take effect.* 121 122 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 123 86 124 Model Functions 87 125 --------------- 88 126 89 For a complete list of all the models available in SasView, see the section127 For a complete list of all the library models available in SasView, see the section 90 128 :ref:`SasView_model_functions`. 91 129 92 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 93 94 .. _Category_Manager: 95 96 Category Manager 97 ---------------- 98 99 To change the model categorizations, click on the *Modify* button on the *Fit Page*. 100 101 Our SAS models are, by default, classified into 5 categories; shapes, 102 shape-independent, structure factor, and customized models, where these 103 categories (except the customized models) can be reassigned, added, and 104 removed using 'Category Manager'. Each models can also be enabled(shown)/ 105 disabled(hidden) from the category that they belong. The Category Manager 106 panel is accessible from the model category 'Modify' button in the fitting 107 panel or the 'View/Category Manager' menu in the menu bar (Fig. 1). 108 109 1) Enable/Disable models: Check/uncheck the check boxes to enable/disable the 110 models (Fig. 2). 111 112 2) Change category: Highlight a model in the list by left-clicking and click 113 the 'Modify' button. In the 'Change Category' panel, one can create/use a 114 category for the model, then click the 'Add' button. In order to delete a 115 category, select a category name and click the 'Remove Selected' button 116 (Fig. 3). 117 118 3) To apply the changes made, hit the OK button. Otherwise, click the 'Cancel' 119 button (Fig. 2). 120 121 .. image:: cat_fig0.bmp 122 123 Fig.1 124 125 .. image:: cat_fig1.bmp 126 127 Fig.2 128 129 .. image:: cat_fig2.bmp 130 131 Fig.3 132 133 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 134 135 136 137 Change Model Parameters 138 ^^^^^^^^^^^^^^^^^^^^^^^ 139 140 To visualize model in a different window, from menu click on *Model*. Select 141 a type of model and then the name of your model.A new window will appear with 142 the plot of your model with default values. Change model's parameters on 143 *model view* tab and view the plotted model with its new parameters. 144 145 Write your Own Model 146 ^^^^^^^^^^^^^^^^^^^^ 147 148 The custom model editors are provided from 'Fitting' menu in the menu bar. 149 See 'Custom model editor' in the side menu on left. Advanced users can write 150 your own model and save it (in .py format) into *plugin_models* directory in 151 .sasview of your home directory (eg., username\.sasview>\plugin_models). Your 152 plugin model will be added into "<>Customized Models" on the next model 153 selection. 154 155 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 130 It is also possible to add your own models. 131 132 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 133 134 Adding your own models 135 ---------------------- 136 137 There are currently two ways to add your own models to SasView: 138 139 * using the :ref:`Custom_Model_Editor` 140 * by :ref:`Writing_a_Plugin` 141 142 *NB: Because of the way these options are implemented, it is not possible for them* 143 *to use the polydispersity algorithms in SasView. Only models in the model library* 144 *can do this. At the time of writing (Release 3.1.0) work is in hand to make it* 145 *easier to add new models to the model library.* 146 147 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 148 149 .. _Custom_Model_Editor: 156 150 157 151 Custom Model Editor 158 152 ------------------- 159 153 160 Description 161 ^^^^^^^^^^^ 162 163 This menu (Fitting/Edit Custom Model in the menu bar) interface is to provide 164 you an easy way to write your own custom models. The changes in a model 165 function are effective after it is re-selected from the combo-box menu. 154 From the *Fitting* option in the menu bar, select *Edit Custom Model*. 166 155 167 156 .. image:: edit_model_menu.bmp 168 157 158 and then one of the options 159 160 * *New* - to create a new custom model template 161 * *Sum|Multi(p1,p2)* - to create a new model by summing/multiplying existing models in the model library 162 * *Advanced* - to edit a new custom model 163 * *Delete* - to delete a custom model 164 169 165 New 170 --- 171 172 This option is used to make a new model. A model code generated by this option 173 can be viewed and further modified by the 'Advanced' option below. 166 ^^^^ 174 167 175 168 .. image:: new_model.bmp 169 170 A model template generated by this option can be viewed and further modified using 171 the :ref:`Advanced` option. 176 172 177 173 Sum|Multi(p1,p2) 178 174 ^^^^^^^^^^^^^^^^ 179 175 180 This option create a new sum (or multiplication) model. Fill up the (sum181 model function) name and the description. The description will show up on182 details button in the application. Then select the p1 or p2 model for the183 sum/multi model, select an operator as necessary and click the Apply button184 for activation. Hit the 'Close' button when it's done.185 186 176 .. image:: sum_model.bmp 177 178 This option creates a custom model of the form 179 180 Custom Model = scale_factor * (model1 +/* model2) 181 182 In the *Easy Sum/Multi Editor* give the new custom model a function name and brief 183 description (to appear under the *Details* button on the *Fit Page*). Then select 184 two existing models, as p1 and p2, and the required operator, '+' or '*' between 185 them. Finally, click the *Apply* button to generate the model and then click *Close*. 186 187 *NB: Any changes to a custom model generated in this way only become effective after* 188 *it is re-selected from the model drop-down menu on the Fit Page.* 189 190 .. _Advanced: 187 191 188 192 Advanced 189 193 ^^^^^^^^ 190 194 191 The menu option shows all the files in the plugin_models folder. You can edit, 192 modify, and save it. It is recommended to modify only the lines with arrow 193 (-------). In the end of edit, 'Compile' and 'Run' from the menu bar to 194 activate or to see the model working properly. 195 Selecting this option shows all the custom models in the plugin model folder 196 197 C:\Users\[username]\.sasview\plugin_models - (on Windows) 198 199 You can edit, modify, and save the Python code in any of these models using the 200 *Advanced Custom Model Editor*. 201 202 *NB: Unless you are confident about what you are doing, it is recommended that you* 203 *only modify lines denoted with the ## <----- comments!* 204 205 When editing is complete, select *Run -> Compile* from the *Model Editor* menu bar. An 206 *Info* box will appear with the results of the compilation and model unit tests. The 207 model will only be usable if the tests 'pass'. 208 209 To use the model, go to the relevant *Fit Page*, select the *Customized Models* 210 category and then select the model from the drop-down menu. 211 212 *NB: Any changes to a custom model generated in this way only become effective after* 213 *it is re-selected from the model drop-down menu on the Fit Page.* 195 214 196 215 Delete 197 216 ^^^^^^ 198 217 199 The menu option is to delete the custom models. Just select the file name to 200 delete. 201 202 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 203 204 Key Combinations 218 Simply highlight the custom model to be removed. This operation is final! 219 220 *NB: Custom models shipped with SasView cannot be removed in this way.* 221 222 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 223 224 .. _Writing_a_Plugin: 225 226 Writing a Plugin 205 227 ---------------- 206 228 207 Copy & Paste 208 ^^^^^^^^^^^^ 209 210 To copy the parameter values in a Fit(Model) panel to the clipboard: 211 212 *Ctrl(Cmd on MAC) + Left(Mouse)Click* on the panel. 213 214 To paste the parameter values to a Fit(Model)panel from the clipboard: 215 216 *Ctrl(Cmd on MAC) + Shift + Left(Mouse)Click* on the panel. 217 218 If this operation is successful, it will say so in the info line at the 229 Advanced users can write their own model in Python and save it to the the SasView 230 *plugin_models* folder 231 232 C:\Users\[username]\.sasview\plugin_models - (on Windows) 233 234 in .py format. The next time SasView is started it will compile the plugin and add 235 it to the list of *Customized Models*. 236 237 It is recommended that existing plugin models be used as templates. 238 239 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 240 241 Fitting Options 242 --------------- 243 244 It is possible to specify which optimiser SasView should use to fit the data, and 245 to modify some of the configurational parameters for each optimiser. 246 247 From *Fitting* in the menu bar select *Fit Options*, then select one of the following 248 optimisers: 249 250 * DREAM 251 * Levenberg-Marquardt 252 * Quasi-Newton BFGS 253 * Differential Evolution 254 * Nelder-Mead Simplex 255 256 These optimisers form the *Bumps* package written by P Kienzle. For more information 257 on each optimiser, see *Information on the SasView Optimisers* in the documentation 258 for the :ref:`Fitting Perspective`. 259 260 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 261 262 Shortcuts 263 --------- 264 265 Copy/Paste Parameters 266 ^^^^^^^^^^^^^^^^^^^^^ 267 268 It is possible to copy the parameters from one *Fit Page* and to paste them into 269 another *Fit Page* using the same model. 270 271 To *copy* parameters, either: 272 273 * Select *Edit -> Copy Params* from the menu bar, or 274 * Use Ctrl(Cmd on Mac) + Left Mouse Click on the *Fit Page*. 275 276 To *paste* parameters, either: 277 278 * Select *Edit -> Paste Params* from the menu bar, or 279 * Use Ctrl(Cmd on Mac) + Shift + Left-click on the *Fit Page*. 280 281 If either operation is successful a message will appear in the info line at the 219 282 bottom of the SasView window. 220 283 … … 222 285 ^^^^^^^^ 223 286 224 Bookmark of a fit-panel or model-panel status: 225 226 *(Mouse)Right-Click* and select the bookmark in the popup list. 227 228 Graph Context Menu 229 ^^^^^^^^^^^^^^^^^^ 230 231 To get the graph context menu to print, copy, save data, (2D)average, etc.: 232 233 *Locate the mouse point on the plot to highlight and *(Mouse) Right Click* 234 to bring up the full menu. 235 236 FTolerance (SciPy) 237 ^^^^^^^^^^^^^^^^^^ 238 239 To change the ftol value of the Scipy FitEngine (leastsq): 240 241 First, make sure that the Fit panel has data and a model selected. 242 243 *Ctrl(Cmd on MAC) + Shift + Alt + Right(Mouse)Click* on the panel. 244 245 Then, set up the value in the dialog panel. 246 247 If this operation is successful, the new ftol value will be displayed in the 248 info line at the bottom of the SV window.Note that increasing the ftol value 249 may cause for the fitting to terminate with higher |chi| sq. 287 To *Bookmark* a *Fit Page* or model-panel status, either: 288 289 * Select a *Fit Page* and then click on *Bookmark* in the tool bar, or 290 * Right-click and select the *Bookmark* in the popup menu. 250 291 251 292 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ … … 323 364 an empty batch page exists, it will be set there. Otherwise it will create a 324 365 new Batch Page. Set up the model and the parameter values as same as a single 325 fitting (see Single Fit help) <Single_Fit_>. Then use 'Fit' button to366 fitting (see Single Fit help). Then use 'Fit' button to 326 367 perform the fitting. 327 368
Note: See TracChangeset
for help on using the changeset viewer.