Guide to write the Configuration Files

This guide explains how to write configurations files for Hardy

1. Configuration file for the Transformations

Here you will find an introduction and explanation on how to construct the transformations configuration file.

This configuration file can be split into 3 main sections.

First, at the top of the file it is always a good idea to add a comment section with the basic organization of the raw data files. Here you can indicate which quantity is contained in each column.

38e28e1404b242c890ff1be7f113e7e6

If you look at the image on the right, the yellow circle is pointing towards thsi information section. In the case for a Small angle Scattering dataset, ther are only two quantities : the scattering vector q and the scattering intensity I(q).

Next, the purple box indicates an example of the transformation command list. The names for transformation must be listed under tform_command_list. The actual name of each transformation run can be any string the user prefers to use for identifying the run. In this case, the transformations used to modify the data were used as run name.

883993d3afba45eebe34acad14c86a0d

Once the list of runs is indicated, the next section of the configuration file allow the user to fully define the :

  1. Raw Data Column Number:
  2. Transformation Name
  3. Plot Code

The rules for plotting must be defined in tform_command_dict. The header of each entry in the dictionary corresponds to the transformation name which should be same as entered in the tform_command_list. The operations performed on the data are defined as lists under this entry. The Raw Data Column Number corresponds to the column number according to the data in csv file. Transformation Name is the operation that needs to be performed on this column and Plot Code corresponds to the color and orientation of the plot in final image that is to be read by machine learning algorithm.

As many as six definitions can be entered under transformation command of dictionary. Each command follows the structure of [column_number, mathematical operation, plotting_value].

The scheme for plotting_values is as follow:

0. Red on x-axis
1. Green on x-axis
2. Blue on x-axis
3. Red on y-axis
4. Green on y-axis
5. Blue on y-axis

Currently supported mathematical operations are as follows:

  • raw : returns raw data without performing any operation
  • exp: exponential
  • nlog: natural log
  • log10: logarithm tranformation with base 10
  • reciprocal: reciprocal
  • cumsum: cumulative sum
  • derivative_1d: Differential with respect to 1 dimension
  • derivative_2d: 2-D differentiation
  • power: can be used for array multiplication or to take user defined power for array