Changeset 5005ae0 in sasview for src/sas/sasgui/perspectives/fitting
- Timestamp:
- Sep 28, 2017 5:28:40 PM (7 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, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 99ded31
- Parents:
- b916afa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/media/fitting_help.rst
rc5cfb20 r5005ae0 3 3 .. This is a port of the original SasView html help file to ReSTructured text 4 4 .. by S King, ISIS, during SasView CodeCamp-III in Feb 2015. 5 6 .. |inlineimage004| image:: sm_image004.png7 .. |inlineimage005| image:: sm_image005.png8 .. |inlineimage008| image:: sm_image008.png9 .. |inlineimage009| image:: sm_image009.png10 .. |inlineimage010| image:: sm_image010.png11 .. |inlineimage011| image:: sm_image011.png12 .. |inlineimage012| image:: sm_image012.png13 .. |inlineimage018| image:: sm_image018.png14 .. |inlineimage019| image:: sm_image019.png15 16 5 17 6 Fitting … … 38 27 for example, if you have measured the same sample at different contrasts) 39 28 40 * 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!) 29 * in *Batch* fit mode - multiple data sets are fitted sequentially to the 30 *same* model (this might be useful, for example, if you have performed 31 a kinetic or time-resolved experiment and have *lots* of data sets!) 41 32 42 33 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ … … 54 45 * *Lamellae* - lamellar shapes (lamellar, core shell lamellar, stacked 55 46 lamellar, etc) 56 * *Shape-Independent* - models describing structure in terms of density correlation functions, fractals, peaks, power laws, etc 47 * *Shape-Independent* - models describing structure in terms of density 48 correlation functions, fractals, peaks, power laws, etc 57 49 * *Paracrystal* - semi ordered structures (bcc, fcc, etc) 58 50 * *Structure Factor* - S(Q) models … … 143 135 and/or relatively simple models) 144 136 * By copying/editing an existing model (this can include models generated by 145 the New Plugin Model* dialog) in the :ref:`Python_shell` or 137 the New Plugin Model* dialog) in the :ref:`Python_shell` or 146 138 :ref:`Advanced_Plugin_Editor` (suitable for all use cases) 147 139 * By writing a model from scratch outside of SasView (only recommended for code … … 181 173 .. image:: new_model.png 182 174 183 When using this feature, be aware that even if your code has errors, including 184 syntax errors, a model file is still generated. When you then correct the errors 185 and click 'Apply' again to re-compile you will get an error informing you that 186 the model already exists if the 'Overwrite' box is not checked. In this case you 187 will need to supply a new model function name. By default the 'Overwrite' box is 175 When using this feature, be aware that even if your code has errors, including 176 syntax errors, a model file is still generated. When you then correct the errors 177 and click 'Apply' again to re-compile you will get an error informing you that 178 the model already exists if the 'Overwrite' box is not checked. In this case you 179 will need to supply a new model function name. By default the 'Overwrite' box is 188 180 *checked*\ . 189 181 … … 195 187 the :ref:`Advanced_Plugin_Editor` . 196 188 197 **SasView version 4.2** made it possible to specify whether a plugin created with 198 the *New Plugin Model* dialog is actually a form factor P(Q) or a structure factor 199 S(Q). To do this, simply add one or other of the following lines under the *import* 189 **SasView version 4.2** made it possible to specify whether a plugin created with 190 the *New Plugin Model* dialog is actually a form factor P(Q) or a structure factor 191 S(Q). To do this, simply add one or other of the following lines under the *import* 200 192 statements. 201 193 … … 203 195 204 196 form_factor = True 205 197 206 198 or for a structure factor:: 207 199 208 200 structure_factor = True 209 210 If the plugin is a structure factor it is *also* necessary to add two variables to 201 202 If the plugin is a structure factor it is *also* necessary to add two variables to 211 203 the parameter list:: 212 204 213 parameters = [ 205 parameters = [ 214 206 ['radius_effective', '', 1, [0.0, numpy.inf], 'volume', ''], 215 207 ['volfraction', '', 1, [0.0, 1.0], '', ''], … … 222 214 def Iqxy(x, y, radius_effective, volfraction, ...): 223 215 224 Such a plugin should then be available in the S(Q) drop-down box on a FitPage (once 216 Such a plugin should then be available in the S(Q) drop-down box on a FitPage (once 225 217 a P(Q) model has been selected). 226 218 … … 243 235 them. Finally, click the *Apply* button to generate and test the model and then click *Close*. 244 236 245 Any changes to a plugin model generated in this way only become effective *after* it is re-selected 246 from the plugin models drop-down menu on the FitPage. If the model is not listed you can force a 237 Any changes to a plugin model generated in this way only become effective *after* it is re-selected 238 from the plugin models drop-down menu on the FitPage. If the model is not listed you can force a 247 239 recompilation of the plugins by selecting *Fitting* > *Plugin Model Operations* > *Load Plugin Models*. 248 240 249 **SasView version 4.2** introduced a much simplified and more extensible structure for plugin models 250 generated through the Easy Sum/Multi Editor. For example, the code for a combination of a sphere model 241 **SasView version 4.2** introduced a much simplified and more extensible structure for plugin models 242 generated through the Easy Sum/Multi Editor. For example, the code for a combination of a sphere model 251 243 with a power law model now looks like this:: 252 244 253 245 from sasmodels.core import load_model_info 254 246 from sasmodels.sasview_model import make_model_from_info 255 247 256 248 model_info = load_model_info('sphere+power_law') 257 249 model_info.name = 'MyPluginModel' … … 259 251 Model = make_model_from_info(model_info) 260 252 261 To change the models or operators contributing to this plugin it is only necessary to edit the string 262 in the brackets after *load_model_info*, though it would also be a good idea to update the model name 253 To change the models or operators contributing to this plugin it is only necessary to edit the string 254 in the brackets after *load_model_info*, though it would also be a good idea to update the model name 263 255 and description too!!! 264 256 265 The model specification string can handle multiple models and combinations of operators (+ or *) which 266 are processed according to normal conventions. Thus 'model1+model2*model3' would be valid and would 267 multiply model2 by model3 before adding model1. In this example, parameters in the *FitPage* would be 268 prefixed A (for model2), B (for model3) and C (for model1). Whilst this might appear a little 269 confusing, unless you were creating a plugin model from multiple instances of the same model the parameter 257 The model specification string can handle multiple models and combinations of operators (+ or *) which 258 are processed according to normal conventions. Thus 'model1+model2*model3' would be valid and would 259 multiply model2 by model3 before adding model1. In this example, parameters in the *FitPage* would be 260 prefixed A (for model2), B (for model3) and C (for model1). Whilst this might appear a little 261 confusing, unless you were creating a plugin model from multiple instances of the same model the parameter 270 262 assignments ought to be obvious when you load the plugin. 271 263 272 If you need to include another plugin model in the model specification string, just prefix the name of 264 If you need to include another plugin model in the model specification string, just prefix the name of 273 265 that model with *custom*. For instance:: 274 266 … … 278 270 279 271 sphere@hardsphere 280 281 This streamlined approach to building complex plugin models from existing library models, or models 282 available on the *Model Marketplace*, also permits the creation of P(Q)*\S(Q) plugin models, something 283 that was not possible in earlier versions of SasView. 272 273 This streamlined approach to building complex plugin models from existing library models, or models 274 available on the *Model Marketplace*, also permits the creation of P(Q)*\S(Q) plugin models, something 275 that was not possible in earlier versions of SasView. 284 276 285 277 .. _Advanced_Plugin_Editor: … … 471 463 472 464 This mode is an extension of the :ref:`Single_Fit_Mode` that fits two or more data 473 sets *to the same model* simultaneously. If necessary it is possible to constrain 465 sets *to the same model* simultaneously. If necessary it is possible to constrain 474 466 fit parameters between data sets (eg, to fix a background level, or radius, etc). 475 467 … … 689 681 recognises the operators +, -, \*, /, or 'pow', and allows the following 690 682 types of expression : 691 683 692 684 1) if an axis label range is a function of 1 or more *columns*, write 693 685 this type of expression … … 706 698 707 699 Example: radius [2 : 5] , radius [10 : 25] 708 700 709 701 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 710 702 … … 756 748 p#_ appended to the beginning and thus radius and p1_radius will not be 757 749 recognized as the same parameter. 758 750 759 751 .. image:: combine_batch_grid.png 760 752 … … 764 756 time is not listed in the file but the file name contains the information. As 765 757 described in :ref:`Grid_Window`, a column can be added manually, in this case 766 called time, and the peak position plotted against time. 758 called time, and the peak position plotted against time. 767 759 768 760 .. image:: combine_batch_plot.png
Note: See TracChangeset
for help on using the changeset viewer.