Entering Data into a Data File

First you need to enter some data into a file. Open your editor and start entering the data shown below:

The text version of this example data is my_exp_1.data in the example directory.

Fig.1: Structure of a data file

Now save the file as my_exp_1.data (this is the standard format of a LT.datafile.dfile object). I prefer to give the data files the extension .data in order to distinguish them from other files.

This example shows the four main parts of a data file.

  1. Comment lines (starting with a # in the first column) are ignored by the program and are used to add information that you might later find useful for yourself.

  2. Parameter definition lines. These ALWAYS start with #\. In this way you can enter values which are common to all data points.

  3. THE HEADER LINE, this is the most important line and MUST BE PRESENT. It always starts with #! followed by the names of the variables of the data entered below in column form.

  4. Each columns is represented by name[dtype, col.nr.]/, dtype is the data type and col.nr (starting at 0) is the column number, do not forget the / at the end of the name

  5. Data types:

    • s : string

    • f : float

    • i : integer

  1. blank lines are ignored

  2. Data lines. Each line of MUST have the same number of data as you have variable names in the header line. In the end each variable name labels a column of data.

Preparing data files should be done before you start the experiments and is part of your preparation for your next lab session. Entering data into a file is what one of you can do during the experiment and/or what you need to do when you start analyzing the data. These data can now be used in python using the (LabTool) LT.box for further analysis.