Warning: this manual page is not up-to-date as of version 4.9
This subpage of the Scripting page allows the user to automate repetitive tasks performed on a contiguous set of photons (a window) within a given datafile.The user needs to define 3 sets of parameters:
Windows Definition
Script Actions
Monitored Variables
Note: currently, this scripting capability is only supported for .sm files
1. Windows Definition
The definition of which subsets of a file are studied can be entered in two different ways: either by duration (shown in the screenshot above) or by Photon Index (and number). It is important to understand that the first option (Duration) requires an additional step to figure out which photons are encompassed in each window). This step involves loading the whole file (by chunks) and decode all photons' timestamps. Obviously this will take longer the larger the file is.
No such step is necessary when selecting the Photon Index option. However, since the number of photons per window is constant, variations in the emission rate will result in variations in window duration (and location).
1.1. Windows Definition by Duration
4 parameters (one optional) need to be specified:
The Start Time of the first Window and the End Time of the last Window (the time unit is user-adjustable and by default is second ("s"). Using the default value of -1 for the End Time ensures that all photons in the file will be used.
The Window Size, whose definition is self-explanatory.
The Time Step by which each new window start time is incremented with respect to the previous window. In the screenshot shown above, this parameter has been set to be equal to the window size, which ensures that the window are non-overlapping and contiguous.
1.2. Windows Definition by Photon Index
In this case, at least two parameters need to be defined:
The First Photon index specifies which photon is used to define the start of the first window. Note that there is no photon stream option, which means that all photons, irrespective of their nature, are use in this definition
The Last Photon index, like the End Time parameter of the Definition by Duration, can be left to its default value of -1 if all photons are to be used in the analysis.
The Window Size, whose definition is self-explanatory (once again, no distinction of photon nature is made in this definition).
The Step Size works in a similar manner as the Time Step parameter of the Definition by Duration, and can be set to its default value of -1 to ensure that the windows are non-overlapping and contiguous.
2. Script Action List
For each window defined above, the program will perform a series of actions exactly as they would be performed by a user pressing on different buttons throughout the different pages of ALiX.
The Script Actions List is an array of Actions, which can be selected from a pulldown list.
Elements can be added to the end of the list (click on the empty item at the end of the array and select the desired action to be added) or inserted within the existing actions list (click on the item before which you want to insert an action and select "Insert Element Before").
The list can be emptied (right-click on the scrollbar area and chose "Empty Array") or a specific element deleted (right-click on the element and select "Delete Element").
The elements in the list of available actions are sorted alphabetically and their denomination corresponds to the caption of the corresponding button, which can be seen in the Context Help window. For instance, the Macrotime Histo button in the us Alternation Periods page is called "Macrotime Histogram".
The page screenshot shown at the top of this page shows a list of all actions required to select bursts within the current window. The last element of the list, "ALEX Histogram", is not visible in the screenshot.
Note that all actions will be performed with the settings specified by the user before running the script. In particular, if the user has checked the checkboxes automatically switching to the next page involved during data analysis, the execution of the script will be constantly switching from page to page, making it impossible for the user to focus on a graph or a page of interest. It is therefore recommended to uncheck all these "Switch to..." checkboxes before starting the script.
Another example of settings which the user may want to check is that the plots within graphs that support this option, are kept from on window to the next. For instance, the Burst Statistics Histograms Graph of the Burst Analysis page has a "Keep Burst Statistics Plots" checkbox, which probably should be checked, in order to keep all the plots generated during analysis.
Another important fact to keep in mind is that any user actions performed during the script execution will be postponed until after the script is completed. In other words, the user should refrain from clicking on any action button while the script is still going on.
3. Monitored Variables List
In addition to preserving plots computed for each window, the user might be interested to keep track of quantities computed during each analysis. This is possible by selecting the variables of interest in the Monitored Variables List. This list functions similarly to the Script Action List in the sense that it allows the user to select variables within a supported variable list. The resulting values are plotted in separate plots in the Sliding Window Monitored Variables Graph. This allows the user to "Export Data to Clipboard" at the end of the script and paste it into a file or different analysis software. Each plot is identified by the name of the variable for easy reference.
Three different types of variable can be selected. All are numeric or boolean values (the latter being interpreted as True: 1, False: 0).
Scalar variable
Array variables
Cluster element
The different types are described below.
3.1. Scalar variables
Scalar variables are numeric indicator values computed (and displayed) in ALiX. Numeric indicators appear on a dark gray background and cannot be edited by the user (in contrast to numeric controls, which have a white background and are editable). For instance, the Burst Search page has two such variables: # Detected Bursts and Duration.
3.2. Array variables
Numeric array indicators appear in the list with the "[]" symbol appended to their name. For instance, there are 3 such arrays in the Background Analysis page: Average Rates (Hz), MLE Bkgd R and Fitted Bkgd R. Each element of an array is displayed in a separate plot in the Sliding Window Monitored Variables Graph.
To monitor a single element of the array, simply edit the variable namle and insert the element index between the brackets. For instance, to only monitor the All Photons Fitted Background Rate, type "Fitted Bkgd R[0]".
To monitor several elements, enter one such variable per line.
Another important example of array are those found on the ALEX Analysis page: E Fit Parameter Values[] and S Fit Parameter Values[]. These arrays contain the fit parameter values of the last fit performed in the E Histogram or S Histogram graph.
To monitor a specific parameter, first identify its index (order in the array minus 1) in the Fit Parameter Names array shown on the Graph when right-clicking on the graph ans selecting "Show Fit Parameters".
For instance, for a Gaussian fit, the Gaussian center position correspond to element index 2, while the standard deviation corresponds to element index 3.
3.3 Cluster element
Cluster indicators are groups of indicators bundled in a single data structure. To access numeric components of such a structure, the name of the element is appended to that of the cluster, separated by a period ".". For instance, the 4 components of the Rate Statistics cluster in the Count Rate Analysis page are referred to as Rate Statistics.Background Rate, Rate Statistics.Max Rate, Rate Statistics.Mean Rate and Rate Statistics.Min Rate.