PAN Controls

There are two menus, FILE and PRINT, located at the top of the main interface. 

FILE menu
The file menu is shown in figure 1 below and the options are described below the figure.

File menu  
Figure 1 File menu options.

Load 3-col ascii data
format described here

Load grouped ascii data
format described here

Load test data
used in the tutorial here

Save fit parameters as text
all fit parameters, uncertainties and chi-squared values are saved into an ascii file

Read in fit parameters
all fit parameters are restored from the same ascii file that was created with Save fit parameters as text

Display current file information
displays filename of current data file

Launches dialog shown in figure 2.  Details described below.  Note that this is a persistent dialog and will close only after the user presses the Dismiss button.  If you change one of the fields and press Accept, the dialog will remain but PAN’s preferences will be updated.
preferences dialog  
Figure 2 Preferences dialog.

Fit all groups to same model
After you specify the curve components for a single data group, if you select FIT ALL GROUPS, each group will be fit with a model identical to the first one.  Otherwise each group can have a different model.

Use dialogs for parameter initial guesses
When this box is checked the user enters the initial guesses in a dialog box rather than using the mouse to specify location, widths, etc.

Enforce x-range/Enforce y-range/min(x)/max(x)/min(y)/max(y)
When checked, Enforce x-range and Enforce y-range cause the PAN display to show only the limits listed in min(x), max(x), min(y), max(y).  These text fields are editable and allow the user to change the viewing range.  Note also that, when the Enforce boxes are unchecked, the user can change the viewing range by pressing the left mouse button and dragging a rubberband box around the desired view region.  A right mouse button press results in autoscaling the range.

x-axis label, y-axis label
These text fields allow the user to specify the plot axes in the main PAN display.

Lower fit limit, Upper fit limit
These text fields allow the user to change the range over which to fit the data.  The fit region is delineated by vertical dashed lines.

Maximum fit iterations
From time to time the fit algorithm may get stuck and not converge to a solution.  In this case, PAN will stop fitting when it has reached the maximum number of fit iterations.  The default is 200 but the user can change this value.

PRINT menu
The Print menu is shown in figure 3 below and the options are described below the figure.

print menu  
Figure 3 Print menu options.

Print screen to .JPEG file
This selection will print the contents of the main display window, the residuals window if a fit is present, the fit parameters with uncertainties and chi-squared values (if fit is present), to a JPEG file.

Print to PS file
This selection will print the contents of the main display window, the residuals window if a fit is present, the fit parameters with uncertainties and chi-squared values (if fit is present).

Print data and fits to text file
This selection prints data from all groups into three columns (x,z,zerr) for each group if no fits are present.  If fits are present the number of columns increases to 3+1+ncurves.  The first three columns are x,z,zerr.  The fourth column is the overall fit.  The remaining ncurves columns contain the fit components evaluated at x.

Select function dropdown menu
This menu, shown in figure 4, allows the user to select which curve to add to the overall fit function.  After selecting one of these functions, the user is given instructions in the text display (to the right of the main plotting window) on how to specify the initial parameter values for the function using the mouse (if the preference has been set to always use a dialog then a dialog will appear). 

curve types  
Figure 4 Select function dropdown menu.

If the user selects userfunction then curve entry dialog appears (figure 5) allowing the user to enter his/her custom fitting function.  Note that this custom fit function must be written in IDL syntax with the independent variable specified as x in the expression,  and the parameters specified by elements of an array, p.  The example shown in figure 5 is that of a quadratic equation with fit parameters p[0], p[1], and p[2]. You can find more examples of user-defined functions here.  If you use a function on more than one occasion then you can save it by pressing Save Expression. This will save it as an ASCII file. You can read the expression back in using this same interface by pressing Restore Expression.

user function  
Figure 5 User function curve entry dialog.

After pressing Accept the dialog shown in figure 6 appears allowing the user to enter the initial parameter values.
user function parameters  
Figure 6 Parameter entry for user function dialog.

The remaining controls in the left hand control panel of the main PAN interface are listed below.

Group selection
This slider control allows user to view the different groups, i.e. change the y-value to yo, say, to look at z=z(x,y=yo).

Clear all curves
If curves (or a fit) are present then this will remove all of the fits from all of the groups.

Modify fit parameters
Pressing this button launches a parameter modification dialog as shown in figure 7.

modify parms  
Figure 7 Parameter modification dialog.

This dialog lists all of the curves in the currently selected group (as specified by the Group selection slider control.  The example shown in figure 7 shows that one of the curves in the current fit is the sloping background.  The current values are shown as well as a number of check boxes (all unchecked).  Any of the these values can be fixed at some value by checking the box marked Fixed.  Furthermore you can impose upper and lower limits on any of the parameters by checking the appropriate Set Low or Set High boxes and typing in the appropriate limits in the text field labeled Lower Limit or Upper Limit.  In addition, any of the parameters can be tied together by checking the Tie box on the appropriate parameters. 

When there are more than one curve in the fit you can access the other curves via the dropdown menu in the upper left corner of this dialog as shown in figure 8.

other modify parms  
Figure 8 Parameter modification dialog showing multiple curve entries.

Clear current curves
If curves (or a fit) are present then this will remove the fit from the currently selected group.

Remove selected curve
Set the slider labeled Curve selection to the curve number you wish to remove from the currently selected group and press this button to perform this action.

Curve selection
Set the slider to the desired curve as listed in the right hand text panel of the main display (see figure 9).

curve info  
Figure 9 Right hand text panel displaying curve information.

Fit current group
Pressing this button results in the current group displayed to be fit to the model selected by the user.

Fit all groups
Pressing this button results in all of the groups listed in the text box labeled Groups to fit to be fit to the same model if this is the preference set in the Preferences dialog by the user.

Interrupt fit
If the fit “gets stuck” in a local minimum then you can press this button to stop the fit.  Pressing it again resumes the fit.  Note however that if it gets stuck and you don’t press this then the fit routine will continue trying to fit it until the maximum number of fit iterations are reached (as specified in the Preferences dialog).

Groups to fit
This text box specifies which groups will be fit if the user presses the Fit all groups button.

Fitting status
If fitting this reads “fitting” else it reads “resting”.  This is useful when deciding if the fit routine is “stuck”.

Display fit parameters
Displays the current fit parameters in the text box on the right hand side of the main interface (see figure 9).

Plot fit parameter
If you have fit multiple groups with the same model then you can plot the group dependence of one of the parameters (see figure 10). You can save the output in 3-column ascii format that can be read back into PAN for further analysis. The plot can be saved in JPEG format or it can be added to an HTML log file (if a log file is open).

plot parameter  
Figure 10 Example of plotting the group dependence of parameter #6 of the fit.

This is a function that neutron scatterers use called the Elastic Incoherent Structure Factor.  It has a similar look as the Plot fit parameter interface does and the user specified those parameters that correspond to the elastic integrated intensity and the quasielastic integrated intensity.

HTML Log Controls
You can save details of your session in a web-type of format in order to make your results available to a wider audience. PAN will create an HTML file that contains any of the figures generated during your session. You can distribution the folder/directory containing the web page and JPEG files to collaborators, for instance, so that they can review the results.
The controls for the HTML log output are shown in figure 11.

plot parameter plot parameter  

Figure 11 HTML log output controls.

In figure 11, the same controls are seen when at HTML log file is closed (left panel) and when open (right panel). When no log file is open, you have the option to create a new log file or opent an existing one and append new plots and/or comments. If you create a new HTML log file then you will be prompted to specify a directory name that will hold the contents of the log file as well as the log file itself, a user name, and a title for the log file. Once the file is opened then the user can add a comment by pressing the Enter comment button or add a plot with a fit to the data (and parameters) by pressing the Add plot to log button. Also the user can add a plot of the EISF or the group dependence of some parameter just by pressing the Add plot to log file button in the appropriate interface.

Back to top
Back to PAN web page