MakeFile

From SweepMe! Wiki
Jump to navigation Jump to search

Last update for: Version 1.6.1.7

MakeFile is the essential Module to control file generation, file names, and file filling.

Usage and rules

MakeFile is placed in the sequencer as any other module. Its correct position has strong impact onto how many files are created. Therefore, it is important to know the following rules:

  1. For each variation (Sweep) of a Module above MakeFile, a new file will be generated.
  2. For each Branch, where MakeFile is in, a separate file will be generated.
  3. If there are multiple MakeFile modules in one branch, the lowest active one (it also means checked in the Sequencer) will determine the file generation and the ID string.
  4. If no MakeFile is in one branch or if MakeFile is unchecked, no file will generated.

If you have no MakeFile in your sequencer, SweepMe! automatically adds one at the start of the run. It is placed at the top of the sequencer with all other modules as its children, so that you do not lose any data. A message informs you about it. To circumvent this behavior, you can:

  • Uncheck the option "Add MakeFile automatically if missing" in the Options dialog, tab "Sequencer"
  • Use at least one MakeFile in your sequencer and uncheck it

If a branch contains only a MakeFile, a message informs you that this results in an almost empty file.

File name

Each file has a name consisting of

  • the file name as given in the field "File" of the General tab or of the Save Bar widget
  • the File ID of MakeFile, by default "ID"
  • the branch index and the file index, e.g. "1-3"
  • the label and current sweep value of all modules above MakeFile in the sequencer that have more than one sweep value, e.g. "_Loop1=10"

Double-click MakeFile in the sequencer to open its configuration dialog:

  • File ID: a text to distinguish your files and to identify the kind of measurement. Typically, one uses a different ID for each branch. The File ID supports the parameter syntax, e.g. "Ch={Loop_SweepValue}" changes the file name for each sweep value of the module "Loop".
  • Advanced options: choose whether the branch index (Add branch index), the file index (Add file index), and the module labels with their sweep values (Add module labels) are added. All three are checked by default.
  • Resulting final name (example): a preview of the resulting file name.

The branch index increments for each branch of the sequencer and makes sure that each branch gets its own files, which is important because each branch can have different variables. The file index increments for each newly created file and shows in which order the files have been created. If SweepMe! writes into a file again, e.g. when branches alternate, the file keeps its index.

Float sweep values are written in scientific notation with four significant digits, e.g. "Vgs=1.000e+00". Integer and text values are written as they are. Characters that are not allowed in file names (* \ | : " < > ? /) are replaced by "_".

MakeFile returns the variable "File path" with the path of the current data file in the temp folder. It is neither plotted nor saved, but can be used by other modules, e.g. a CustomFunction.

Examples

"Sample34 Test2_ID3-4_Loop1=10.txt"

  • 'Sample34 Test2' is the file name given in the program
  • ID3-4 is the ID given by the MakeFile, '3' is the third branch of the sequencer, '4' means the fourth file generated for this branch
  • The module with the label 'Loop1' is above MakeFile in the sequencer and has currently the sweep value 10.

"FET12_Output1-2_Vgs=1.000e+00.txt"

  • 'FET12' is the file name given in the program, e.g. a field-effect transistor is measured, abbreviated with 'FET'
  • Output1-2 is the ID. The default File ID 'ID' has been changed to 'Output' to indicate that this file saves data that belongs to an output characteristic. '1' indicates that this file belongs to the first branch of the sequencer, '2' means that it is the second file that has been generated for this branch.
  • The label of the module 'SMU' has been changed to 'Vgs' because the gate-source voltage is varied by this module.

This example demonstrates how the file name is changed to represent that an output characteristic at a gate-source voltage of 1 V is measured for sample 'FET12'.

File structure

Each file has the same structure with 3 header lines:

  • 1st header line: Module label + variable
  • 2nd header line: Unit
  • 3rd header line: empty

The data is always written to the latest file that has been generated or activated by MakeFile. The order of the columns is related to the order of the Modules of the particular Branch for which the file is saved. Thus, you can change the order of columns by changing the order of Modules in the sequencer (as long as it does not change your sweep procedure). If the same file is used again by another branch, a new block with header lines is appended after two empty lines. However, the first two columns are always related to the invisible root Module of the sequencer being Time and this behavior cannot be changed.

Data will not be written into the file if the save type of a variable is set to 'False'. It can be the case if:

  • The option 'save' in modules like Calc or CustomFunction is not checked.
  • It is defined in a driver to not save a particular variable by changing the save type to 'False'.
  • Variables of a Module have save type of 'False' but can be seen because their plot type is 'True'.

Data of variables that is 0-dimensional, i.e. strings, integers, or floats are saved to the main data files. Data from variables that contain 1-dimensional values like lists or arrays are saved to additional files that contain the label Data1D. For each iteration of the sequencer, a new 1D data file is created while the creation of 0D data files depends on the position of MakeFile in the sequencer.

Description of the measurement

Many programs save meta data in the header of the data files which makes it sometimes difficult to import data files by other programs. In SweepMe!, the sequence of your measurement is not saved to the header of the data files but in a separate sequence file in which all elements of the graphical user interface are stored. It is saved together with the data files. From SweepMe! 1.6.1.6, it is saved as ".seq" file and additionally in the legacy ".set" format (in version 1.5, only ".set"). That way, data files have always the same structure.

To see how to read in data files, please follow this link: Loading data files.

Metadata and further instrument parameters

Data that is not saved yet via the measurement data files or the sequence file can be saved by the following options:

  • A driver for a Logger or a Form module is used to add parameters that describe the measurement
  • A driver or a CustomFunction script writes instrument parameters to a self-made file that is saved in the temp folder. If the file name starts with "temp_", it will automatically be copied to the measurement data folder when the data is saved.

Saving data

MakeFile creates all data files and makes sure they are filled correctly. To finally save the data, use the button "Save Data" in the General tab, the menu File → Save Data, or the Save Bar widget in the dashboard. If "Auto Save Data" is checked in the General tab, the data is saved automatically after each run. Until SweepMe! 1.5.8.2, the Save Bar was an element of the ControlWidgets module. From SweepMe! 1.5.8.3, it is a permanent widget of SweepMe!.

When the user triggers the action to save data, all files from the temp folder are copied to the final measurement data folder. Each file in the temp folder created by MakeFile has the prefix "temp_". The first 4 characters will be replaced by the final file name that is defined in the field "File". You can add your own files to the temp folder during a measurement. They will also be copied to the measurement data folder, independent from the file extension. However, please make sure that the file name is prefixed with "temp_" as the first four characters are always replaced by the file name.

In the Options dialog, tab "Saving", section "Data export", you can choose the formats of the result files (from SweepMe! 1.5.8.7):

  • Text files (.txt): checked by default. Uncheck it if you do not want the tab-separated .txt result files in the result folder. Files written by yourself, e.g. by a CustomFunction script, are kept, and the temp folder always keeps a .txt backup of the run.
  • Excel (.xlsx) (Pro): after each completed or stopped run, an Excel workbook is created next to the result files. Each branch of the sequencer becomes a separate sheet. This option requires a SweepMe! Pro license.