source: sasview/src/sas/sasgui/guiframe/media/graph_help.rst @ de68f78

magnetic_scattrelease-4.2.2ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249unittest-saveload
Last change on this file since de68f78 was de68f78, checked in by Paul Kienzle <pkienzle@…>, 6 years ago

Batch slicer documentation minor revisions.

  • Property mode set to 100644
File size: 13.8 KB
RevLine 
[23a9beb]1.. graph_help.rst
[0d66541]2
[78f02c3]3.. This is a port of the original SasView html help file to ReSTructured text
4.. by S King, ISIS, during SasView CodeCamp-III in Feb 2015.
5
[3fd3d5a4]6
[37bbd5f]7Plotting Data/Models
8====================
9
[96423f8]10SasView generates three different types of graph window: one that displays *1D data*
[5ed76f8]11(i.e., $I(Q)$ vs $Q$), one that displays *1D residuals* (ie, the difference between the
12experimental data and the theory at the same $Q$ values), and *2D color maps*.
[96423f8]13
[0cdf1af]14Graph window options
[3fd3d5a4]15--------------------
[78f02c3]16
[0cdf1af]17.. _Invoking_the_graph_menu:
[78f02c3]18
[0cdf1af]19Invoking the graph menu
20^^^^^^^^^^^^^^^^^^^^^^^
[3fd3d5a4]21
[e68c9bf]22To invoke the *Graph Menu* simply right-click on a data/theory plot, or click
23the *Graph Menu* (bullet list) icon in the toolbar at the bottom of the plot.
[3fd3d5a4]24Then select a menu item.
[78f02c3]25
[0cdf1af]26How to Hide-Show-Delete a graph
27^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[78f02c3]28
[e68c9bf]29To expand a plot window, click the *Maximise* (square) icon in the top-right
[3fd3d5a4]30corner.
[78f02c3]31
[e68c9bf]32To shrink a plot window, click the *Restore down* (square-on-square) icon in
[3fd3d5a4]33the top-right corner.
[78f02c3]34
[e68c9bf]35To hide a plot, click the *Minimise* (-) icon in the top-right corner of the
[3fd3d5a4]36plot window.
[23a9beb]37
[e68c9bf]38To show a hidden plot, select the *Restore up* (square-on-square) icon on the
[3fd3d5a4]39minimised window.
40
[e68c9bf]41To delete a plot, click the *Close* (x) icon in the top-right corner of the
[3fd3d5a4]42plot window.
43
[5ed76f8]44.. note::
[f9b0c81]45    *If a residuals graph (when fitting data) is hidden, it will not show up
46    after computation.*
[3fd3d5a4]47
[0cdf1af]48Dragging a plot
49^^^^^^^^^^^^^^^
[23a9beb]50
[e68c9bf]51Select the *Pan* (crossed arrows) icon in the toolbar at the bottom of the plot
52to activate this option. Move the mouse pointer to the plot. It will change to
53a hand. Then left-click and drag the plot around. The axis values will adjust
[3fd3d5a4]54accordingly.
[e68c9bf]55
[3fd3d5a4]56To disable dragging mode, unselect the *crossed arrows* icon on the toolbar.
[23a9beb]57
[0cdf1af]58Zooming In-Out on a plot
59^^^^^^^^^^^^^^^^^^^^^^^^
[78f02c3]60
[e68c9bf]61Select the *Zoom* (magnifying glass) button in the toolbar at the bottom of
62the plot to activate this option. Move the mouse pointer to the plot. It will
63change to a cross-hair. Then left-click and drag the pointer around to generate
[3fd3d5a4]64a region of interest. Release the mouse button to generate the new view.
[78f02c3]65
[3fd3d5a4]66To disable zoom mode, unselect the *Zoom* button on the toolbar.
[78f02c3]67
[e68c9bf]68After zooming in on a a region, the *left arrow* or *right arrow* buttons on
[3fd3d5a4]69the toolbar will switch between recent views.
[78f02c3]70
[f9b0c81]71The axis range can also be specified manually.  To do so go to the *Graph Menu*
72(see Invoking_the_graph_menu_ for further details), choose the *Set Graph Range*
73option and enter the limits in the pop box.
74
[e68c9bf]75*NOTE! If a wheel mouse is available scrolling the wheel will zoom in/out
76on the current plot (changing both axes). Alternatively, point at the numbers
[3fd3d5a4]77on one axis and scroll the wheel to zoom in/out on just that axis.*
[78f02c3]78
[e68c9bf]79To return to the original view of the data, click the the *Reset* (home) icon
[0cdf1af]80in the toolbar at the bottom of the plot (see Resetting_the_graph_ for further details).
[23a9beb]81
[0cdf1af]82Saving a plot image
83^^^^^^^^^^^^^^^^^^^
[78f02c3]84
[e68c9bf]85To save the current plot as an image file, right click on the plot to bring up
[0cdf1af]86the *Graph Menu* (see Invoking_the_graph_menu_) and select *Save Image*.
[e68c9bf]87Alternatively, click on the *Save* (floppy disk) icon in the toolbar at the
[3fd3d5a4]88bottom of the plot.
[e68c9bf]89
90A dialog window will open. Select a folder, enter a filename, choose an output
[3fd3d5a4]91image type, and click *Save*.
92
93The currently supported image types are:
94
95*  EPS (encapsulated postscript)
96*  EMF (enhanced metafile)
97*  JPG/JPEG (joint photographics experts group)
98*  PDF (portable documant format)
99*  PNG (portable network graphics)
100*  PS (postscript)
[318427a9]101*  RAW/RGBA (bitmap, stored as 935x635 pixels of depth 8)
[3fd3d5a4]102*  SVG/SVGA (scalable vector graphics)
103*  TIF/TIFF (tagged iamge file)
104
[0cdf1af]105Printing a plot
106^^^^^^^^^^^^^^^
[78f02c3]107
[e68c9bf]108To send the current plot to a printer, click on the *Print* (printer) icon in
[3fd3d5a4]109the toolbar at the bottom of the plot.
[78f02c3]110
[0cdf1af]111.. _Resetting_the_graph:
[3fd3d5a4]112
[0cdf1af]113Resetting the graph
114^^^^^^^^^^^^^^^^^^^
[78f02c3]115
[e68c9bf]116To reset the axis range of a graph to its initial values select *Reset Graph
[0cdf1af]117Range* on the *Graph Menu* (see Invoking_the_graph_menu_). Alternatively, use
[3fd3d5a4]118the *Reset* (home) icon in the toolbar at the bottom of the plot.
[78f02c3]119
[0cdf1af]120Modifying the graph
121^^^^^^^^^^^^^^^^^^^
[23a9beb]122
[f9b0c81]123It is possible to make custom modifications to plots including:
[23a9beb]124
[3fd3d5a4]125*  changing the plot window title
[f9b0c81]126*  changing the default legend location and toggling it on/off
127*  changing the axis label text
128*  changing the axis label units
129*  changing the axis label font & font colour
[3fd3d5a4]130*  adding/removing a text string
131*  adding a grid overlay
[23a9beb]132
[f9b0c81]133The legend and text strings can be drag and dropped around the plot
134
135These options are accessed through the *Graph Menu* (see Invoking_the_graph_menu_)
136and selecting *Modify Graph Appearance* (for axis labels, grid overlay and
137legend position) or *Add Text* to add textual annotations, selecting font, color,
138style and size. *Remove Text* will remove the last annotation added. To change
139the legend. *Window Title* allows a custom title to be entered instead of Graph
[5ed76f8]140x.
[f9b0c81]141
[0cdf1af]142Changing scales
143^^^^^^^^^^^^^^^
[78f02c3]144
[3fd3d5a4]145This menu option is only available with 1D data.
146
[0cdf1af]147From the *Graph Menu* (see Invoking_the_graph_menu_) select *Change Scale*. A
[e68c9bf]148dialog window will appear in which it is possible to choose different
[3fd3d5a4]149transformations of the x (usually Q) or y (usually I(Q)) axes, including:
150
151*  x, x^2, x^4, ln(x), log10(x), log10(x^4)
152*  y, 1/y, ln(y), y^2, y.(x^4), 1/sqrt(y),
153*  log10(y), ln(y.x), ln(y.x^2), ln(y.x^4), log10(y.x^4)
[e68c9bf]154
[3fd3d5a4]155A *View* option includes short-cuts to common SAS transformations, such as:
156
157*  linear
158*  Guinier
159*  X-sectional Guinier
160*  Porod
161*  Kratky
162
[e68c9bf]163For properly corrected and scaled data, these SAS transformations can be used
164to estimate, for example, Rg, rod diameter, or SANS incoherent background
[0cdf1af]165levels, via a linear fit (see Making_a_linear_fit_).
[3fd3d5a4]166
[0cdf1af]167Toggling scales
168^^^^^^^^^^^^^^^
[3fd3d5a4]169
170This menu option is only available with 2D data.
171
[0cdf1af]172From the *Graph Menu* (see Invoking_the_graph_menu_) select *Toggle Linear/Log
[e68c9bf]173Scale* to switch between a linear to log intensity scale. The type of scale
[3fd3d5a4]174selected is written alongside the colour scale.
175
[0cdf1af]1762D color maps
177^^^^^^^^^^^^^
[3fd3d5a4]178
179This menu option is only available with 2D data.
180
[a9dc4eb]181From the *Graph Menu* (see Invoking_the_graph_menu_) select *2D Color Map* to
[e68c9bf]182choose a different color scale for the image and/or change the maximum or
[3fd3d5a4]183minimum limits of the scale.
184
[0cdf1af]185Getting data coordinates
186^^^^^^^^^^^^^^^^^^^^^^^^
[3fd3d5a4]187
[e68c9bf]188Clicking anywhere in the plot window will cause the current coordinates to be
[3fd3d5a4]189displayed in the status bar at the very bottom-left of the SasView window.
[e68c9bf]190
[3fd3d5a4]191.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
[23a9beb]192
[0cdf1af]193Dataset menu options
194--------------------
195
196.. _Invoking_the_dataset_menu:
197
198Invoking the dataset menu
199^^^^^^^^^^^^^^^^^^^^^^^^^
200
201From the *Graph Menu* (see Invoking_the_graph_menu_) highlight a plotted
[3fd3d5a4]202dataset.
203
[0cdf1af]204Getting data info
205^^^^^^^^^^^^^^^^^
[3fd3d5a4]206
[0cdf1af]207In the *Dataset Menu* (see Invoking_the_dataset_menu_), highlight a data set
[e68c9bf]208and select *DataInfo* to bring up a data information dialog panel for that
[3fd3d5a4]209data set.
210
[0cdf1af]211Saving data
212^^^^^^^^^^^
[3fd3d5a4]213
[0cdf1af]214In the *Dataset Menu* (see Invoking_the_dataset_menu_), select *Save Points as
[e68c9bf]215a File* (if 1D data) or *Save as a file(DAT)* (if 2D data). A save dialog will
[3fd3d5a4]216appear.
217
[e68c9bf]2181D data can be saved in either ASCII text (.TXT) or CanSAS/SASXML (.XML)
[a9dc4eb]219formats (see :ref:`Formats`).
[1394952]220
[a9dc4eb]2212D data can only be saved in the NIST 2D format (.DAT) (see :ref:`Formats`).
[78f02c3]222
[0cdf1af]223.. _Making_a_linear_fit:
[78f02c3]224
[0cdf1af]225Making a linear fit
226^^^^^^^^^^^^^^^^^^^
[78f02c3]227
[5ed76f8]228Linear fit performs a simple $y(x)=ax+b$ linear fit within the plot window.
[3fd3d5a4]229
[0cdf1af]230In the *Dataset Menu* (see Invoking_the_dataset_menu_), select *Linear Fit*. A
[e68c9bf]231fitting dialog will appear. Set some initial parameters and data limits and
232click *Fit*. The fitted parameter values are displayed and the resulting line
233calculated from them is added to the plot.
[3fd3d5a4]234
235This option is most useful for performing simple Guinier, XS Guinier, and
[5ed76f8]236Porod type analyses, for example, to estimate $R_g$, a rod diameter, or incoherent
[3fd3d5a4]237background level, respectively.
238
239The following figure shows an example of a Guinier analysis using this option
[78f02c3]240
241.. image:: guinier_fit.png
242
[0cdf1af]243Removing data from the plot
244^^^^^^^^^^^^^^^^^^^^^^^^^^^
[3fd3d5a4]245
[0cdf1af]246In the *Dataset Menu* (see Invoking_the_dataset_menu_), select *Remove*. The
[3fd3d5a4]247selected data will be removed from the plot.
248
[f9b0c81]249.. note::
250    The Remove data set action cannot be undone.
[78f02c3]251
[0cdf1af]252Show-Hide error bars
253^^^^^^^^^^^^^^^^^^^^
[3fd3d5a4]254
[0cdf1af]255In the *Dataset Menu* (see Invoking_the_dataset_menu_), select *Show Error Bar*
[e68c9bf]256or *Hide Error Bar* to switch between showing/hiding the errors associated
257with the chosen dataset.
[3fd3d5a4]258
[0cdf1af]259Modify plot properties
260^^^^^^^^^^^^^^^^^^^^^^
[3fd3d5a4]261
[0cdf1af]262In the *Dataset Menu* (see Invoking_the_dataset_menu_), select *Modify Plot
[e68c9bf]263Property* to change the size, color, or shape of the displayed marker for the
[f9b0c81]264chosen dataset, or to change the dataset label that appears in the plot legend
265box.
[78f02c3]266
267.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
[ddb036e5]268.. _d_data_averaging:
[78f02c3]269
[0cdf1af]2702D data averaging
[78f02c3]271-----------------
272
[3fd3d5a4]273Purpose
[0cdf1af]274^^^^^^^
[3fd3d5a4]275
276This feature is only available with 2D data.
[23a9beb]277
[e68c9bf]2782D data averaging allows you to perform different types of averages on your
279data. The region to be averaged is displayed in the plot window and its limits
[3fd3d5a4]280can be modified by dragging the boundaries around.
[78f02c3]281
[0cdf1af]282How to average
283^^^^^^^^^^^^^^
[78f02c3]284
[0cdf1af]285In the *Dataset Menu* (see Invoking_the_dataset_menu_), select one of the
[3fd3d5a4]286following averages
[78f02c3]287
[3fd3d5a4]288*  Perform Circular Average
289*  Sector [Q view]
290*  Annulus [Phi view]
291*  Box sum
292*  Box averaging in Qx
293*  Box averaging on Qy
[78f02c3]294
[e68c9bf]295A 'slicer' will appear (except for *Perform Circular Average*) in the plot that
296you can drag by clicking on a slicer's handle. When the handle is highlighted
[3fd3d5a4]297in red, it means that the slicer can move/change size.
[78f02c3]298
[e68c9bf]299*NOTE! The slicer size will reset if you try to select a region greater than
[3fd3d5a4]300the size of the data.*
301
[e68c9bf]302Alternatively, once a 'slicer' is active you can also select the region to
303average by bringing back the *Dataset Menu* and selecting *Edit Slicer
[ddb036e5]304Parameters and Batch Fitting*. A dialog window will appear in which you can
305enter values to define a region, select the number of points to plot (*nbins*),
306or apply the slicer to any or all other 2D data plots.
[3fd3d5a4]307
[e68c9bf]308A separate plot window will also have appeared, displaying the requested
[3fd3d5a4]309average.
310
[f9b0c81]311.. note::
312    The displayed average only updates when input focus is moved back to
313    that window; ie, when the mouse pointer is moved onto that plot.
[3fd3d5a4]314
[e68c9bf]315Selecting *Box Sum* automatically brings up the 'Slicer Parameters' dialog in
[3fd3d5a4]316order to display the average numerically, rather than graphically.
317
318To remove a 'slicer', bring back the *Dataset menu* and select *Clear Slicer*.
[78f02c3]319
[ddb036e5]320Batch Slicing
321^^^^^^^^^^^^^
322
[3d86118]323A slicer can be applied to any or all existing 2D data plots using the 'Slicer
324Parameters' window. To open the window, select *Edit Slicer Parameters and Batch
325Fitting* in the *Dataset Menu* (see Invoking_the_dataset_menu_). Batch slicing
326options are available at the bottom of the window.
[ddb036e5]327
[de68f78]328Select the 2D plots you want to apply the slicer to. All 2D plots are selected
329by default. The resulting 1D data for all slicers can be saved as a text file
[3d86118]330and then sent to fitting by selecting the *Auto save generated 1D* check box.
[ddb036e5]331Sending data to the fitting perspective requires the data be saved.
332
333Once the auto save check box is selected, you can select where the files are
[3d86118]334saved. The file name for the saved data is the slicer name plus the file name
335of the original data set, plus what is in the *Append to file name* field. The
336default value in the append to field includes the names and values for all of
337the slicer parameters.
338
339The batch of slices can be sent to fitting if desired, with three options
340available. The first is to not fit the data, the second is to send the
341slices to individual fit pages, and the third is to send all sliced data to a
342single batch fit window.
343
344Clicking *Apply Slicer to Selected Plots* will create a slicer for each selected
345plot with the parameters entered in the 'Slicer Parameters' window. Depending on
346the options selected the data may then be saved, loaded as separate data sets in
347the data manager panel, and finally sent to fitting.
[ddb036e5]348
[0cdf1af]349Unmasked circular average
350^^^^^^^^^^^^^^^^^^^^^^^^^
[23a9beb]351
[5ed76f8]352This operation will perform an average in constant $Q$ rings around the (x,y)
[3fd3d5a4]353pixel location of the beam center.
[78f02c3]354
[0cdf1af]355Masked circular average
356^^^^^^^^^^^^^^^^^^^^^^^
[78f02c3]357
[e68c9bf]358This operation is the same as 'Unmasked Circular Average' except that any
[3fd3d5a4]359masked region is excluded.
[78f02c3]360
[0cdf1af]361Sector average [Q View]
362^^^^^^^^^^^^^^^^^^^^^^^
[23a9beb]363
[5ed76f8]364This operation averages in constant $Q$ arcs.
[3fd3d5a4]365
[5ed76f8]366The width of the sector is specified in degrees ($\pm\delta|\phi|$) each side
367of the central angle $\phi$.
[78f02c3]368
[5ed76f8]369Annular average [:math:`\phi`]
370^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[3fd3d5a4]371
[5ed76f8]372This operation performs an average between two $Q$ values centered on (0,0),
[3fd3d5a4]373and averaged over a specified number of pixels.
[78f02c3]374
[5ed76f8]375The data is returned as a function of angle $\phi$ in degrees with zero
[3fd3d5a4]376degrees at the 3 O'clock position.
[78f02c3]377
[0cdf1af]378Box sum
379^^^^^^^
[78f02c3]380
[3fd3d5a4]381This operation performs a sum of counts in a 2D region of interest.
382
[e68c9bf]383When editing the slicer parameters, the user can enter the length and the width
[3fd3d5a4]384the rectangular slicer and the coordinates of the center of the rectangle.
[78f02c3]385
[23a9beb]386Box Averaging in Qx
[0cdf1af]387^^^^^^^^^^^^^^^^^^^
[78f02c3]388
[5ed76f8]389This operation computes an average $I(Q_x)$ for the region of interest.
[3fd3d5a4]390
[e68c9bf]391When editing the slicer parameters, the user can control the length and the
392width the rectangular slicer. The averaged output is calculated from constant
[5ed76f8]393bins with rectangular shape. The resultant $Q$ values are nominal values, that
[3fd3d5a4]394is, the central value of each bin on the x-axis.
[78f02c3]395
[23a9beb]396Box Averaging in Qy
[0cdf1af]397^^^^^^^^^^^^^^^^^^^
[78f02c3]398
[5ed76f8]399This operation computes an average $I(Q_y)$ for the region of interest.
[23a9beb]400
[e68c9bf]401When editing the slicer parameters, the user can control the length and the
402width the rectangular slicer. The averaged output is calculated from constant
[5ed76f8]403bins with rectangular shape. The resultant $Q$ values are nominal values, that
[3fd3d5a4]404is, the central value of each bin on the x-axis.
[78f02c3]405
[3fd3d5a4]406.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
[78f02c3]407
[f9b0c81]408.. note::  This help document was last modified by Paul Butler, 05 September, 2016
Note: See TracBrowser for help on using the repository browser.