Changes in / [f1d9da7:bac81f4] in sasview
- Files:
-
- 5 deleted
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
docs/sphinx-docs/source/user/menu_bar.rst
rd1fa2b8 r959eb01 11 11 Data can be loaded one file at a time, or by selecting multiple files, or by loading an entire folder of 12 12 files (in which case *SasView* will attempt to make an intelligent guess as to what to load based on the 13 file formats it recognises in the folder!). Data can also be loaded by dragging and dropping files directly 14 onto Data Explorer. 13 file formats it recognises in the folder!). 15 14 16 15 A *SasView* session can also be saved and reloaded as an 'Analysis' (an individual model fit or invariant … … 32 31 33 32 - show the Batch Fitting Results Panel if it has been closed; 33 - show/hide the Data Explorer Panel; 34 34 - show/hide the Toolbar of icons below the Menu Bar; 35 35 - select the default location that *SasView* looks in for data to analyse (the *SasView* installation directory, the initial default, or a custom folder). NB: any change only takes effect when *SasView* is restarted; … … 60 60 61 61 - create a new FitPage; 62 - setting up a Constrained or Simultaneous Fit;63 62 - change optimiser (under Fit Options); 64 63 - view fit parameter correlations, distributions, and convergence traces (under Fit Results); 65 - create a Plugin Model. 66 - edit a Plugin Model. 67 - manage Plugin Models 68 - create a Sum/Multiple Plugin Model 69 64 - create/edit a Plugin Model. 65 66 Additional functionality is available under this menu option during particular types of model fitting, including: 67 68 - setting up a Constrained or Simultaneous Fit; 69 - combining a Batch Fit (an obscure capability); 70 - setting up Chain Fitting. 70 71 71 72 Help -
src/sas/qtgui/MainWindow/UI/DataExplorerUI.ui
rd1fa2b8 rc6fb57c 87 87 <widget class="QPushButton" name="cmdDeleteData"> 88 88 <property name="text"> 89 <string>Delete Data</string>89 <string>Delete</string> 90 90 </property> 91 91 </widget> -
src/sas/qtgui/MainWindow/media/data_explorer_help.rst
rd1fa2b8 r417c03f 16 16 the context menu of plot panels or other menus within the application. 17 17 18 Under *View* in the menu bar, *Data Explorer* can be toggled between Show and 19 Hide by clicking *Show/Hide Data Explorer*. 20 21 *NOTE! When* Data Explorer *is hidden, all data loaded will be sent directly 22 to the current active analysis, if possible. When* Data Explorer *is 23 shown, data go first to the* Data Explorer. 24 18 25 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 19 26 … … 28 35 specified folder; 29 36 30 Drag and drop a file or multiple files from the external file explorer into31 the Data Explorer area.32 33 37 Or, in the *Data Explorer* click the button *Load Data*, then select one or more 34 38 (by holding down the Ctrl key) files to load into SasView. 35 39 36 40 The name of each loaded file will be listed in the *Data Explorer*. Clicking the 37 empty trianglesymbol alongside will display any available metadata read from the file.41 *+* symbol alongside will display any available metadata read from the file. 38 42 39 43 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ … … 44 48 Right-clicking on a loaded dataset (or model calculation, what SasView calls a 45 49 'theory') brings up a *Handy Menu* from which it is possible to access *Data Info*, 46 *Save* the data/theory, *Delete* the data/theoryor *Plot* the data/theory.50 *Save* the data/theory, or *Plot* the data/theory. 47 51 48 52 .. image:: hand_menu.png … … 54 58 55 59 To interact with data it must be activated. This is accomplished by checking 56 the box next to the file name in the *Data Explorer*. A tick will appear.60 the box next to the file name in the *Data Explorer*. A green tick will appear. 57 61 58 62 Unchecking/unticking a box deactivates that data set. … … 69 73 selected data sets.* 70 74 71 *Delete Data* removes all references to selected data from SasView. 72 73 Right-clicking on one or more datasets also gives the option of removing 74 the selected datasets. 75 *Remove Data* removes all references to selected data from SasView. 75 76 76 77 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ … … 79 80 ------------------- 80 81 81 Click on the * Create New* button in the *Plot* section to create a new plot82 panel where the currentlyselected data will be plotted.82 Click on the *New Plot* button to create a new plot panel where the currently 83 selected data will be plotted. 83 84 84 85 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ … … 104 105 ------------------- 105 106 106 The *Freeze Theory* button on the *Theory* tab pagegenerates data from the selected theory.107 The *Freeze Theory* button generates data from the selected theory. 107 108 108 109 *NOTE! This operation can only be performed when theory labels are selected in* … … 114 115 ---------------------------- 115 116 116 Click on the *Send data TO* button to send the currently selected data to the currently117 a ctiveanalysis (*Fitting*, *P(r) Inversion*, or *Invariant* calculation).117 Click on the *Send To* button to send the currently selected data to one of the 118 available types of analysis (*Fitting*, *P(r) Inversion*, or *Invariant* calculation). 118 119 119 The *Single*/*Batch* mode radio buttons only apply to *Fitting* and *P(r) Inversion*.120 The *Single*/*Batch* mode radio buttons only apply to *Fitting*. 120 121 121 122 *Batch mode* provides serial (batch) fitting with one model function, that is, … … 126 127 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 127 128 128 .. note:: This help document was last changed by Piotr Rozyczko, 11May2018129 .. note:: This help document was last changed by Steve King, 01May2015 -
src/sas/qtgui/Perspectives/Fitting/media/fitting_help.rst
rb31b7e2 r417c03f 52 52 53 53 Use the *Category* drop-down menu to chose a category of model, then select 54 a model from the drop-down menu to the right. The "Show Plot" button on the 55 bottom of the dialog will become active. If you click on it, 56 a graph of the chosen model, calculated using default parameter values, will appear. 57 The graph will update dynamically as the parameter values are changed. 54 a model from the drop-down menu beneath. A graph of the chosen model, calculated 55 using default parameter values, will appear. The graph will update dynamically 56 as the parameter values are changed. 58 57 59 58 You can decide your own model categorizations using the :ref:`Category_Manager`. 60 59 61 Once you have selected a model you can read its help documentation by right clicking 62 on the empty space in the parameter table. 63 64 .. image:: descr_fig.png 60 Once you have selected a model you can read its help documentation by clicking 61 on the *Description* button to the right. 65 62 66 63 Show 1D/2D … … 72 69 *NB: Magnetic scattering can only be fitted in SasView in 2D.* 73 70 74 To activate 2D fitting mode, select the *2D view* checkboxon the *Fit Page*. To75 return to 1D fitting model, de-select the same checkbox.71 To activate 2D fitting mode, click the *Show 2D* button on the *Fit Page*. To 72 return to 1D fitting model, click the same button (which will now say *Show 1D*). 76 73 77 74 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ … … 139 136 * By copying/editing an existing model (this can include models generated by 140 137 the New Plugin Model* dialog) in the :ref:`Python_shell` or 141 :ref:` Plugin_Editor` (suitable for all use cases)138 :ref:`Advanced_Plugin_Editor` (suitable for all use cases) 142 139 * By writing a model from scratch outside of SasView (only recommended for code 143 140 monkeys!) … … 154 151 ----------------------- 155 152 156 From the *Fitting* option in the menu bar, select one of the options:153 From the *Fitting* option in the menu bar, select *Plugin Model Operations* 157 154 158 155 .. image:: edit_model_menu.png 159 156 160 * *Add Custom Model* - to create a plugin model template with a helper dialog 161 * *Edit Custom Model* - to edit a plugin model in an editor window 162 * *Manage Custom Models* - to open a custom model manager allowing for a number of actions to be taken on custom models: listing, adding, deleteing, duplicating, editing 163 * *Add/Multiply Models* - to create a plugin model by summing/multiplying *existing models* in the model library 157 and then one of the sub-options 158 159 * *New Plugin Model* - to create a plugin model template with a helper dialog 160 * *Sum|Multi(p1,p2)* - to create a plugin model by summing/multiplying *existing models* in the model library 161 * *Advanced Plugin Editor* - to create/edit a plugin model in a Python shell 162 * *Delete Plugin Models* - to delete a plugin model 163 * *Load Plugin Models* - to (re-)load plugin models 164 164 165 165 .. _New_Plugin_Model: 166 166 167 Add CustomModel167 New Plugin Model 168 168 ^^^^^^^^^^^^^^^^ 169 169 170 170 Relatively straightforward models can be programmed directly from the SasView 171 GUI using the * Plugin Definition* Function.171 GUI using the *New Plugin Model Function*. 172 172 173 173 .. image:: new_model.png … … 185 185 186 186 A model file generated by this option can be viewed and further modified using 187 the :ref:` Model_Editor`.187 the :ref:`Advanced_Plugin_Editor` . 188 188 189 189 **SasView version 4.2** made it possible to specify whether a plugin created with … … 217 217 a P(Q) model has been selected). 218 218 219 220 .. Model_Editor: 221 222 Model Editor 223 ^^^^^^^^^^^^ 224 225 Selecting "Edit Custom Model" option opens the editor window. 226 227 .. image :: model_editor_empty.png 228 229 Initially, the editor is empty. A custom model can be loaded by clicking on the *Load plugin...* button and choosing one of the existing custom plugins. 230 231 Once the model is loaded, it can be edited and saved with *Save* button. 232 Saving the model will perform the validation and only when the model is correct it will be saved to a file. 233 Successful model check is indicated by a SasView status bar message. 234 235 When *Cancel* is clicked, any changes to the model are discarded and the window is closed. 236 237 238 For details of the SasView plugin model format see :ref:`Writing_a_Plugin` . 239 240 To use the model, go to the relevant *Fit Page*, select the *Plugin Models* 241 category and then select the model from the drop-down menu. 242 243 244 .. Plugin_Manager: 245 246 Plugin Manager 247 ^^^^^^^^^^^^^^ 248 249 Selecting the *Manage Custom Models* option shows a list of all the plugin models in the plugin model folder, on Windows this is 250 251 *C:\\Users\\{username}\\.sasview\\plugin_models* 252 253 You can add, edit, duplicate and delete these models using buttons on the right side of the list. 254 255 .. image:: plugin_manager.png 256 257 258 Add a model 259 ^^^^^^^^^^^ 260 261 Clicking the "Add" button opens the Model Editor window, allowing you to create a new plugin as described above. 262 263 Duplicate a model 264 ^^^^^^^^^^^^^^^^^ 265 266 Clicking the "Duplicate" button will create a copy of the selected model(s). Naming of the duplicate follows the standard, with added * (n)* to the plugin model name, with *n* being the first unused yet integer. 267 268 Edit a model 269 ^^^^^^^^^^^^ 270 271 When a single model is selected, clicking this button will open the Advanced *Model Editor* allowing you to edit the 272 Python code of the model. 273 If no models or multiple models are selected, the *Edit* button is disabled. 274 275 Delete Plugin Models 276 ^^^^^^^^^^^^^^^^^^^^ 277 278 Simply highlight the plugin model(s) to be removed and click on the "Delete" button. The operation is final. 279 280 *NB: Models shipped with SasView cannot be removed in this way.* 281 282 283 Add/Multiply Models 284 ^^^^^^^^^^^^^^^^^^^ 219 Sum|Multi(p1,p2) 220 ^^^^^^^^^^^^^^^^ 285 221 286 222 .. image:: sum_model.png … … 294 230 Plugin Model = scale_factor * (model1 * model2) + background 295 231 296 In the * Add/Multiply Models* give the new model a function name and brief232 In the *Easy Sum/Multi Editor* give the new model a function name and brief 297 233 description (to appear under the *Details* button on the *FitPage*). Then select 298 two existing models, as model_1 and model_2, and the required operator, '+' or '*' between234 two existing models, as p1 and p2, and the required operator, '+' or '*' between 299 235 them. Finally, click the *Apply* button to generate and test the model and then click *Close*. 300 236 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 239 recompilation of the plugins by selecting *Fitting* > *Plugin Model Operations* > *Load Plugin Models*. 301 240 302 241 **SasView version 4.2** introduced a much simplified and more extensible structure for plugin models 303 generated through the Add/Multiply Models editor. For example, the code for a combination of a sphere model242 generated through the Easy Sum/Multi Editor. For example, the code for a combination of a sphere model 304 243 with a power law model now looks like this:: 305 244 … … 336 275 that was not possible in earlier versions of SasView. 337 276 338 277 .. _Advanced_Plugin_Editor: 278 279 Advanced Plugin Editor 280 ^^^^^^^^^^^^^^^^^^^^^^ 281 282 Selecting this option shows all the plugin models in the plugin model folder, on Windows this is 283 284 *C:\\Users\\{username}\\.sasview\\plugin_models* 285 286 You can edit, modify, and save the Python code in any of these models using the 287 *Advanced Plugin Model Editor*. Note that this is actually the same tool as the :ref:`Python_shell` . 288 289 For details of the SasView plugin model format see :ref:`Writing_a_Plugin` . 290 291 .. note:: Model files generated with the Sum/Multi option are still using the SasView 3.x model format. Unless you are confident about what you are doing, it is recommended that you only modify lines denoted with the ## <----- comments! 292 293 When editing is complete, select *Run* > *Check Model* from the *Advanced Plugin Model Editor* menu bar. An *Info* box will appear with the results of the compilation and model unit tests. The model will only be usable if the tests 'pass'. 294 295 .. image:: ../calculator/new_pycrust_example_2.png 296 297 To use the model, go to the relevant *Fit Page*, select the *Plugin Models* 298 category and then select the model from the drop-down menu. 299 300 Any changes to a plugin model generated in this way only become effective *after* it is re-selected from the model drop-down menu on the FitPage. 301 302 Delete Plugin Models 303 ^^^^^^^^^^^^^^^^^^^^ 304 305 Simply highlight the plugin model to be removed. The operation is final!!! 306 307 *NB: Models shipped with SasView cannot be removed in this way.* 308 309 Load Plugin Models 310 ^^^^^^^^^^^^^^^^^^ 311 312 This option loads (or re-loads) all models present in the 313 *~\\.sasview\\plugin_models* folder. 339 314 340 315 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ … … 342 317 .. _Fitting_Options: 343 318 344 Fit Algorithms319 Fitting Options 345 320 --------------- 346 321 … … 348 323 to modify some of the configurational parameters for each optimiser. 349 324 350 From *Fitting* in the menu bar select *Fit Algorithms*, then select one of the following325 From *Fitting* in the menu bar select *Fit Options*, then select one of the following 351 326 optimisers: 352 327 … … 357 332 * Nelder-Mead Simplex 358 333 359 .. image:: fit_algorithms.png360 361 334 The DREAM optimiser is the most sophisticated, but may not necessarily be the best 362 335 option for fitting simple models. If uncertain, try the Levenberg-Marquardt optimiser … … 375 348 sub-region of the data for fitting. 376 349 377 In a *FitPage* or *BatchPage* change the tab to *Fit Options* and then change 378 the *Q* values in the *Min* and/or *Max* 379 text boxes. 380 381 .. 382 Vertical coloured bars will appear on the graph with the data and 383 'theory' indicating the current *Q* limits (red = *Qmin*, purple = *Qmax*). 350 In a *FitPage* or *BatchPage* change the *Q* values in the *Min* and/or *Max* 351 text boxes. Vertical coloured bars will appear on the graph with the data and 352 'theory' indicating the current *Q* limits (red = *Qmin*, purple = *Qmax*). 384 353 385 354 To return to including all data in the fit, click the *Reset* button. … … 387 356 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 388 357 389 .. 390 391 Shortcuts 392 --------- 393 394 Copy/Paste Parameters 395 ^^^^^^^^^^^^^^^^^^^^^ 396 397 It is possible to copy the parameters from one *Fit Page* and to paste them into 398 another *Fit Page* using the same model. 399 400 To *copy* parameters, either: 401 402 * Select *Edit -> Copy Params* from the menu bar, or 403 * Use Ctrl(Cmd on Mac) + Left Mouse Click on the *Fit Page*. 404 405 To *paste* parameters, either: 406 407 * Select *Edit -> Paste Params* from the menu bar, or 408 * Use Ctrl(Cmd on Mac) + Shift + Left-click on the *Fit Page*. 409 410 If either operation is successful a message will appear in the info line at the 411 bottom of the SasView window. 412 413 Bookmark 414 ^^^^^^^^ 415 416 To *Bookmark* a *Fit Page* either: 417 418 * Select a *Fit Page* and then click on *Bookmark* in the tool bar, or 419 * Right-click and select the *Bookmark* in the popup menu. 358 359 Shortcuts 360 --------- 361 362 Copy/Paste Parameters 363 ^^^^^^^^^^^^^^^^^^^^^ 364 365 It is possible to copy the parameters from one *Fit Page* and to paste them into 366 another *Fit Page* using the same model. 367 368 To *copy* parameters, either: 369 370 * Select *Edit -> Copy Params* from the menu bar, or 371 * Use Ctrl(Cmd on Mac) + Left Mouse Click on the *Fit Page*. 372 373 To *paste* parameters, either: 374 375 * Select *Edit -> Paste Params* from the menu bar, or 376 * Use Ctrl(Cmd on Mac) + Shift + Left-click on the *Fit Page*. 377 378 If either operation is successful a message will appear in the info line at the 379 bottom of the SasView window. 380 381 Bookmark 382 ^^^^^^^^ 383 384 To *Bookmark* a *Fit Page* either: 385 386 * Select a *Fit Page* and then click on *Bookmark* in the tool bar, or 387 * Right-click and select the *Bookmark* in the popup menu. 420 388 421 389 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ … … 423 391 .. _Status_bar: 424 392 425 Status Bar & Log Explorer426 -------------------- -----393 Status Bar & Console 394 -------------------- 427 395 428 396 The status bar is located at the bottom of the SasView window and displays 429 messages, warnings and errors.430 431 .. image:: log_explorer.png 432 433 The bottom part of the SasView application window contains the *Log Explorer*. 434 The *Log Explorer* displays available message history and run-time traceback information.397 messages, hints, warnings and errors. 398 399 At the right-hand side of the status bar is a button marked *Console*. The *Console* 400 displays available message history and some run-time traceback information. 401 402 During a long task the *Console* can also be used to monitor the progress. 435 403 436 404 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ … … 441 409 --------------- 442 410 443 *NB: Before proceeding, ensure that the Batch mode checkboxat the bottom of*444 *the Data Explorer is unchecked (see the section* :ref:`Loading_data` *).*411 *NB: Before proceeding, ensure that the Single Mode radio button at the bottom of* 412 *the Data Explorer is checked (see the section* :ref:`Loading_data` *).* 445 413 446 414 This mode fits one data set. 447 415 448 .. When data is sent to the fitting it is plotted in a graph window as markers. 449 When data is sent to the fitting, the Fit Page will show the dataset name. 450 451 .. image:: dataset_name.png 452 453 Clicking on the *Show Plot* will cause the data can be plotted in a graph window as markers. 416 When data is sent to the fitting it is plotted in a graph window as markers. 454 417 455 418 If a graph does not appear, or a graph window appears but is empty, then the data … … 457 420 or in the *Console* window. 458 421 459 Assuming the data has loaded correctly, when a model is selected a bluemodel422 Assuming the data has loaded correctly, when a model is selected a green model 460 423 calculation (or what SasView calls a 'Theory') line will appear in the earlier graph 461 424 window, and a second graph window will appear displaying the residuals (the … … 477 440 *'correlated').* 478 441 479 In the bottom right corner of the *Fit Page* is a box displaying the normalised value442 In the bottom left corner of the *Fit Page* is a box displaying the normalised value 480 443 of the statistical $\chi^2$ parameter returned by the optimiser. 481 444 -
src/sas/qtgui/Plotting/PlotterBase.py
re30646ab r42787fb 38 38 # Define canvas for the figure to be placed on 39 39 self.canvas = FigureCanvas(self.figure) 40 41 # ... and the toolbar with all the default MPL buttons 42 self.toolbar = NavigationToolbar(self.canvas, self) 40 43 41 44 # Simple window for data display … … 109 112 if not quickplot: 110 113 # Add the toolbar 111 self.toolbar = NavigationToolbar(self.canvas, self)112 114 layout.addWidget(self.toolbar) 113 115 # Notify PlotHelper about the new plot … … 295 297 Use the internal MPL method for saving to file 296 298 """ 297 if not hasattr(self, "toolbar"):298 self.toolbar = NavigationToolbar(self.canvas, self)299 299 self.toolbar.save_figure() 300 300 -
src/sas/qtgui/Utilities/TabbedModelEditor.py
rf9214aa raed0532 241 241 # Run the model test in sasmodels 242 242 try: 243 model_results = GuiUtils.checkModel(full_path)243 model_results = self.checkModel(full_path) 244 244 logging.info(model_results) 245 245 except Exception as ex: -
src/sas/sascalc/fit/AbstractFitEngine.py
racd9c311 r63319b0 300 300 self.qmax = math.sqrt(x_max * x_max + y_max * y_max) 301 301 ## new error image for fitting purpose 302 if self.err_data is None or self.err_data == []:302 if self.err_data is None or not self.err_data: 303 303 self.res_err_data = np.ones(len(self.data)) 304 304 else:
Note: See TracChangeset
for help on using the changeset viewer.