|
|
|
The Computing for Science (CS) group supports ILL scientists, students and visitors in a number of activities including data analysis, instrument simulation and sample simulation.

Filing for VMS/UNIXA tutorialContents1. Goals and definitionsFiling is an interactive tool for the handling of TAS data files. It makes it possible to create a new data set from one or more data files, the contents of which can be modified, grouped and/or combined. The main features of the program are listed below. Modifying a data setWith Filing, almost all the data set inputs can be modified manually:
The latter option is especially usefull to improve the statistic or to make the plot more understandable e.g., when the used scan step is too narrow compared to the resolution width. Option "Add files"When performing a TAS experiment many measuring strategies can be used. For example, a given scan may be repeated several times or performed by parts. Scan ranges can be identical, contiguous, non-contiguous, overlapping, etc. Step widths and/or counting times can be identical or not. The goal of the option "Add files" is thus to merge, concatenate, append, rescale, etc, data to produce a single data set from several data files whenever this makes sense. Option "Combine files"The goal of the option "Combine files" is to perform a linear combination of the contents of several data files. This is especially useful: - to subtract a background, either observed or given. - to remove unwanted peaks. E.g., the same scan may be repeated above and below a phase transition or with different neutron polarizations. In such a case combining data sets may be used to remove all peaks but those present only in one of the states. Filing limitations
2. AlgorithmsTo divide the sheep from the goats, Filing performs a set of compatibility tests when running the options "Add files" and "Combine files". Some tests require that some file characteristics be strictly identical. Others are controlled by user defined tolerance levels. Compatibility between plot-axis variablesFiling can only add or combine data files if they have identical scan variables and identical X and Y plot-axis variables. When this compatibility test is not satisfied, the program refuses to process the files. Header parameters' compatibilityThis second set of compatibility tests is applyed to the header parameters of the input files. Each header parameter of each input file is compared to the corresponding header parameter of the first input file on the basis of a custom set of tolerance levels, Tol. A file File_j is said compatible with the first one File_1 if all header parameters are equal within the specified tolerance. If the files are not compatible, Filing displays a warning message and writes a failure report to the text window (see below). The user can then decide either to ignore the parameter discrepancy or to abandon the file processing. Superimposed and not-superimposed pointsOnce the compatibility tests have been performed successfully, the contents of the input files can be concatenated, added or combined. However, during the processing, an extra tolerance level is used to decide wether or not very close data points should be considered as superimposed or independent. This tolerance level, Tol, is applied to the mean value of the scan step, DX. Two points from different input files, X(File1) and X(File2), will be superimposed if the following condition is satisfied: <dd>|DX|*(1-Tol) < |X(File2)-X(File1)| < |DX|*(1+Tol) </dd> <dd>
Note that, as explained below, the options "Add files" and "Combine files" use different algorithms to process superimposed and not-superimposed points. Option "Add files"When n files are added all data points are kept. Superimposed points are summed and rescaled. For 2 files, the add algorithm is as follows: Not-superimposed points are copied unchanged to the resulting data set.
</dd> while two superimposed points are added as follows: with, for a given scan point from file i,
and for the resulting data point
Option "Combine files"When n files are combined, each point of the resulting data set is the scaled sum of n "superimposed" data points. When less than n data are observed at a given x-value, the resulting point cannot be computed and the corresponding input points are simply skipped. For two files the combine algorithm is as follows: with, for a given scan point of file i
and for the resulting data point
In the resulting data set all points are scaled to the monitor counts <tt>Mon</tt>. Note that, with the option "Add files", the Poisson statistics of the data is kept while, with the option "Combine files", it is generally lost. As a consequence, be careful when you use a resulting data set created by the option "Combine files". E.g., using the option "Add files" after the option "Combine files" may result in wrong Y-errors. 3. Launching FilingTo launch PkFit, simply double-click on its icon or type the name of the program as the command. Then type a return or "/xserve" if you are using an X terminal otherwise see the graphics device help. The PGPLOT window is displayed with a menu bar in its bottom part. 4. Setting general optionsSelect the item "General" from the menu "Options". A dialogue allows you to fix the monitor to a given value, or to set the default file format and the default data-directory. 5. Setting tolerance levelsSelect the item "Tolerances" from the menu "Options". A dialogue allows you to set the tolerance levels. Click the button OK to exit from the dialogue. Then click the item "Menu1" to go back to the main menu. 6. Ex. 1: Grouping a set of scansAs a first example of the use of Filing, we will add the contents of four data files. These files are compatible, since they correspond to a Q-scan performed in four parts with different Q-ranges and with different Q-steps. 6.1. Opening the set of data files
Filing immediately reads the file and displays its contents in a graphic window. This window is divided into three parts: the plot region (top left), the caption region (top right), and the message region (bottom), which is presently empty. The open-dialogue is shown again to allow you to successively open the remaining three files (Add_2.tas,Add_3.tas, and Add_4.tas). For each file, select the edit text "Filename" and move the cursor on the integer with the key "<". Note that typing a key will erased the selected one. Once the four files have been opened, click the button "MENU1". Filing is now ready to process the series of opened files. 6.2. Adding filesSelect the item "Add" from the menu "Filing". A dialogue box allows you to select the files to be added. Check the boxes of the four files and click the button OK. The compatibility tests are performed. In the present case, Filing displays a warning message and reports that the parameter ALF1 from file Add_2.tas is not compatible with the same parameter from file Add_1.tas: A more detailed incompatibility report is given in the text window with, the parameter name, its values in the different input files and the tolerance value. The user can now decide either to ignore the parameter discrepancy or to abandon the file processing. In the present case the parameter ALF1 is not an important one. Thus we can bo ahead by clicking the button "Continue". Note that the default output value of an "incompatible" parameter is that from the first file. However this value can even be edited using the item "Set resolution parameters" from the menu "Options". The graphic window displays the resulting data set. Note that the comment region shows the equation of the add process. To allow you keeping track of the various processing performed during a sesssion, the program writes to the text window:
To help you understand the add process, the table below shows how the resulting data set was built from the contents of the input files.
Note that while point 7 has a QL value very close to that of point 8, they were not added. Why? Because the differences between the two abscissa (here 0.0002) is larger than the absolute tolerance level of 0.000152. From the above table we can see that the abscissa differences are also small for point pairs 7-8, 10-11, 17-18, and 24-25. These differences are less than 0.0003, while the narrowest scan step in the input files is 0.002. 6.3. Changing the tolerance level on the scan stepThus we may decide to relax the abscissa tolerance-level by a factor of two so that the pairs 7-8, 10-11, 17-18, and 24-25 can be added. Select the item "Tolerances" from the menu "Options". Type 0.2 instead of 0.1 in the edit text "Scan step" of the dialogue "Tolerance levels". Note that the physical tolerance level of the scan step is the product of this "fractional" tolerance level and of the mean value of the scan steps. Click the button OK and select the item "Add files" in the menu "Filing". Since the last resulting data set was not saved, a warning message is displayed. Click the button "Yes", check the boxes of the four files in the dialogue "Add data sets" and click the button OK to add again the four file contents. Ignore the warning message about the file incompatibility. The new resulting data set is displayed and you can verify that the four pairs of nearly superimposed points have been combined.
At this stage it would be a good practice to save the resulting data set as explained below. 7. Ex. 2: Subtracting a backgroundAs a second example of the use of Filing, we will subtract a background scan (file Combine_2.tas) from a measurement scan (file Combine_1.tas) by means of the option "Combine files". These two files are compatible since they correspond to the same energy scan performed at two different temperatures, above and below a magnetic transition. 7.1. Opening the two data files
7.2. Combining files
Click in the text window to make it the front one. The message below tells us that two points from file combine_2.tas were not transfered to the resulting data set since they have no equivalent in file combine_1.tas. At this stage it would be a good practice to save the resulting data set as explained below. 7.3. Plotting data setsOnce the background has been subtracted, you may want to display all data sets on the same plot.. Select the item "Plot" from the menu "Plot". A dialogue box allows you to select the data sets to be ploted. Check the three boxes "Plot" and click the button OK. The window contents display the selected data sets as shown below. 7.4. Saving data and resultsSelect the item "Save" from the main menu. A new menu bar allows you to decide what should be saved: the contents of the text window, the contents of the graphic window, the resulting data set, the "grouping data set", or the resolution parameters. Note that the "grouping data set" is the resulting data set obtained after performing the option "Group points". For example select the item "Graph". A dialogue allows you to edit the file name. In the example below, the contents of the graphic window will be saved to the PostScript file PGPlot.Plt. 7.5. Printing resultsSelect the item "Print" from the main menu. The graphic window is automatically printed on the current printer. Note that the current printer is defined by the environment variable PGPLOT_ILL_PRINT_CMD. 7.6. Quitting the programSelect the item "Exit" from the menu. A dialogue box allows you to confirm or to cancel. |