Changeset 5005ae0 in sasview


Ignore:
Timestamp:
Sep 28, 2017 5:28:40 PM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
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
Message:

doc formatting cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/media/fitting_help.rst

    rc5cfb20 r5005ae0  
    33.. This is a port of the original SasView html help file to ReSTructured text 
    44.. by S King, ISIS, during SasView CodeCamp-III in Feb 2015. 
    5  
    6 .. |inlineimage004| image:: sm_image004.png 
    7 .. |inlineimage005| image:: sm_image005.png 
    8 .. |inlineimage008| image:: sm_image008.png 
    9 .. |inlineimage009| image:: sm_image009.png 
    10 .. |inlineimage010| image:: sm_image010.png 
    11 .. |inlineimage011| image:: sm_image011.png 
    12 .. |inlineimage012| image:: sm_image012.png 
    13 .. |inlineimage018| image:: sm_image018.png 
    14 .. |inlineimage019| image:: sm_image019.png 
    15  
    165 
    176Fitting 
     
    3827   for example, if you have measured the same sample at different contrasts) 
    3928 
    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!) 
    4132 
    4233.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     
    5445*  *Lamellae* - lamellar shapes (lamellar, core shell lamellar, stacked 
    5546   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 
    5749*  *Paracrystal* - semi ordered structures (bcc, fcc, etc) 
    5850*  *Structure Factor* - S(Q) models 
     
    143135   and/or relatively simple models) 
    144136*  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 
    146138   :ref:`Advanced_Plugin_Editor` (suitable for all use cases) 
    147139*  By writing a model from scratch outside of SasView (only recommended for code 
     
    181173.. image:: new_model.png 
    182174 
    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  
     175When using this feature, be aware that even if your code has errors, including 
     176syntax errors, a model file is still generated. When you then correct the errors 
     177and click 'Apply' again to re-compile you will get an error informing you that 
     178the model already exists if the 'Overwrite' box is not checked. In this case you 
     179will need to supply a new model function name. By default the 'Overwrite' box is 
    188180*checked*\ . 
    189181 
     
    195187the :ref:`Advanced_Plugin_Editor` . 
    196188 
    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 
     190the *New Plugin Model* dialog is actually a form factor P(Q) or a structure factor 
     191S(Q). To do this, simply add one or other of the following lines under the *import* 
    200192statements. 
    201193 
     
    203195 
    204196     form_factor = True 
    205           
     197 
    206198or for a structure factor:: 
    207199 
    208200     structure_factor = True 
    209           
    210 If the plugin is a structure factor it is *also* necessary to add two variables to  
     201 
     202If the plugin is a structure factor it is *also* necessary to add two variables to 
    211203the parameter list:: 
    212204 
    213      parameters = [  
     205     parameters = [ 
    214206                     ['radius_effective', '', 1, [0.0, numpy.inf], 'volume', ''], 
    215207                     ['volfraction', '', 1, [0.0, 1.0], '', ''], 
     
    222214     def Iqxy(x, y, radius_effective, volfraction, ...): 
    223215 
    224 Such a plugin should then be available in the S(Q) drop-down box on a FitPage (once  
     216Such a plugin should then be available in the S(Q) drop-down box on a FitPage (once 
    225217a P(Q) model has been selected). 
    226218 
     
    243235them. Finally, click the *Apply* button to generate and test the model and then click *Close*. 
    244236 
    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  
     237Any changes to a plugin model generated in this way only become effective *after* it is re-selected 
     238from the plugin models drop-down menu on the FitPage. If the model is not listed you can force a 
    247239recompilation of the plugins by selecting *Fitting* > *Plugin Model Operations* > *Load Plugin Models*. 
    248240 
    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 
     242generated through the Easy Sum/Multi Editor. For example, the code for a combination of a sphere model 
    251243with a power law model now looks like this:: 
    252244 
    253245     from sasmodels.core import load_model_info 
    254246     from sasmodels.sasview_model import make_model_from_info 
    255       
     247 
    256248     model_info = load_model_info('sphere+power_law') 
    257249     model_info.name = 'MyPluginModel' 
     
    259251     Model = make_model_from_info(model_info) 
    260252 
    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  
     253To change the models or operators contributing to this plugin it is only necessary to edit the string 
     254in the brackets after *load_model_info*, though it would also be a good idea to update the model name 
    263255and description too!!! 
    264256 
    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  
     257The model specification string can handle multiple models and combinations of operators (+ or *) which 
     258are processed according to normal conventions. Thus 'model1+model2*model3' would be valid and would 
     259multiply model2 by model3 before adding model1. In this example, parameters in the *FitPage* would be 
     260prefixed A (for model2), B (for model3) and C (for model1). Whilst this might appear a little 
     261confusing, unless you were creating a plugin model from multiple instances of the same model the parameter 
    270262assignments ought to be obvious when you load the plugin. 
    271263 
    272 If you need to include another plugin model in the model specification string, just prefix the name of  
     264If you need to include another plugin model in the model specification string, just prefix the name of 
    273265that model with *custom*. For instance:: 
    274266 
     
    278270 
    279271     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 
     273This streamlined approach to building complex plugin models from existing library models, or models 
     274available on the *Model Marketplace*, also permits the creation of P(Q)*\S(Q) plugin models, something 
     275that was not possible in earlier versions of SasView. 
    284276 
    285277.. _Advanced_Plugin_Editor: 
     
    471463 
    472464This 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  
     465sets *to the same model* simultaneously. If necessary it is possible to constrain 
    474466fit parameters between data sets (eg, to fix a background level, or radius, etc). 
    475467 
     
    689681recognises the operators +, -, \*, /, or 'pow', and allows the following 
    690682types of expression : 
    691   
     683 
    692684  1) if an axis label range is a function of 1 or more *columns*, write 
    693685     this type of expression 
     
    706698 
    707699     Example: radius [2 : 5] , radius [10 : 25] 
    708       
     700 
    709701.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
    710702 
     
    756748   p#_ appended to the beginning and thus radius and p1_radius will not be 
    757749   recognized as the same parameter. 
    758     
     750 
    759751.. image:: combine_batch_grid.png 
    760752 
     
    764756time is not listed in the file but the file name contains the information. As 
    765757described in :ref:`Grid_Window`, a column can be added manually, in this case 
    766 called time, and the peak position plotted against time.  
     758called time, and the peak position plotted against time. 
    767759 
    768760.. image:: combine_batch_plot.png 
Note: See TracChangeset for help on using the changeset viewer.