Saving data

From SweepMe! Wiki
Jump to navigation Jump to search

SweepMe! writes all measurement data to a temporary folder while a run is ongoing. When you save the data, SweepMe! copies these files to your measurement folder and renames them. The format of the data files and how to open them in other programs is described in Loading data files.

Temporary folder

During a run, all files are written to the temporary folder of the current Windows user:

%LOCALAPPDATA%\SweepMe!\temp

The names of these files start with "temp", e.g. temp_ID1-1.txt. You can open the folder via File → Open Folder → Temp.

The temporary folder is emptied at the start of each run. Data that you have not saved is therefore lost as soon as the next run starts.

If you run several instances of SweepMe! at the same time, each additional instance uses its own temporary folder (see Folder system).

Measurement folder

When the data is saved, SweepMe! copies all files and subfolders of the temporary folder to

<measurement folder>\<profile>\<folder>

where

  • <measurement folder> is %PUBLIC%\Documents\SweepMe!\Measurement by default, usually C:\Users\Public\Documents\SweepMe!\Measurement,
  • <profile> is the name of the selected user profile, and
  • <folder> is the folder name that you entered when saving.

During the copy, "temp" at the beginning of each file name is replaced by the file name that you entered. For example, temp_ID1-1.txt becomes MyMeasurement_ID1-1.txt. If you leave the file name empty, the file is called _ID1-1.txt.

You can open the measurement folder of your profile via File → Open Folder → Measurement Data. All other folders that SweepMe! uses are listed in Folder system.

Custom data path (Pro)

With SweepMe! Pro, you can use a different measurement folder: File → Options… → Paths (Pro) → Use custom data path:. Check the box and click Choose path to select the folder. The data is then saved to <custom data path>\<profile>\<folder>. The custom data path must exist, otherwise the data is not saved.

Saving data in the General tab

The General tab of the main window contains the following fields:

  • Profile: the selected user profile.
  • Folder: the folder that is created inside the measurement folder of your profile. A folder name is required. You can create subfolders with backslashes, e.g. "folder\subfolder1\subfolder2".
  • File: the text that is put at the beginning of each file name. It can be empty and must not contain "\" or "/".
  • Save Data: saves the data of the last run. The same function is available via File → Save Data.
  • Auto Save Data: if checked, the data is saved automatically at the end of each run.

Folder and file names must not contain the characters * | : " < > ? and they support the parameter syntax.

The icon of the Save Data button shows the state of your data:

  • grey: no data yet,
  • orange: a run is ongoing or its data has not been saved yet,
  • green: the data has been saved,
  • red: the data could not be saved or the files had to be renamed.

If files with the same names already exist in the folder, SweepMe! asks whether to add an index to the file name, e.g. MyMeasurement(1)_ID1-1.txt. With Auto Save Data, this index is added without asking, and SweepMe! shows a message with the new name.

Data can also be saved without the GUI, e.g. with the option --save of the Command line interface or with the tool save_data of the MCP server.

Save Bar (Pro)

With SweepMe! Pro, the Dashboard widget Save Bar lets you save the data directly from the dashboard. It has the fields Main path:, Folder: and File: and the buttons Save data and Open folder. The main path is <measurement folder>\{profile} by default and can be changed to any existing folder, so you can save data outside the measurement folder.

In the settings of the Save Bar, you can choose which fields and buttons are shown, add an Auto save check box, and choose what happens if files already exist (If filenames exist: ask always or add incrementing index).

The Save Bar works independently of the General tab of the main window. Both can be used in parallel.

Data files

Each branch of the Sequencer that contains a MakeFile module writes its own data file. With the default options of MakeFile, the file name is built as

<file name>_<File ID><branch index>-<file index>_<module label>=<sweep value>.txt

e.g. MyMeasurement_ID1-1.txt. The module labels and sweep values are added for modules above MakeFile that have more than one sweep value. You can change the File ID and switch off the branch index, file index, and module labels in the advanced options of MakeFile. Use MakeFolder to sort the files of a run into subfolders. If Add MakeFile automatically if missing is checked in File → Options… → Sequencer, SweepMe! adds a MakeFile to a sequence that does not contain one.

How many files will I get?

Only branches that contain a MakeFile module write a data file, and each of these branches writes its own file. In addition, MakeFile starts a new file whenever it is entered again for a new step of a module above it.

MakeFile → SMU                          → 1 file  (one branch)
MakeFile → SMU → Logger                 → 1 file  (Logger is the only leaf)
MakeFile → SMU                          → 2 files (SMU and Logger are both leaves)
         → Logger
MakeFile → Temperature (5 steps) → SMU  → 1 file  (MakeFile is above Temperature)
Temperature (5 steps) → MakeFile → SMU  → 5 files (one file per temperature)

Rule of thumb: count the branches that contain MakeFile and multiply by the number of times MakeFile is entered. Branches without MakeFile (e.g. a branch that ends in a Hold module) produce no file. By default, each file name contains the branch index, so the data of different branches never ends up in the same file.

Content of the data files

SweepMe! puts 0-dimensional (0D) data in the main data file, for example strings, integers, or floats, together with the elapsed time and a time stamp. Variables that contain 1-dimensional (1D) data like lists or arrays are saved to separate files, one file per measurement point, named _Data1D_<n>.txt, where <n> is the number of the measurement point. See Loading data files for the file format.

Further files are saved together with the data:

  • <file name>_setting.set and <file name>_setting.seq: a copy of the sequence that was used for the run. Load it to see how SweepMe! was configured or to repeat the measurement. The .seq file is saved from version 1.6.1.6 on. Older versions only save the .set file.
  • <file name>_Plot_<plot title>.png (and .pdf or .svg): images of the Plot widgets, if selected in the options (see below).
  • <file name>_Notes.txt: the entries of the Notes widget, if you have written notes.
  • Any other file that modules write to the temporary folder during the run.

Options

The tab Saving in File → Options… has the following options:

  • Plot images, Save thumbnail: select png, pdf, and/or svg to save an image of each Plot widget together with the data.
  • Data export (from version 1.5.8.7):
    • Text files (.txt): checked by default. If unchecked, the .txt data files are removed from the measurement folder after saving, e.g. if you only need the Excel files. Files that your own scripts or modules write to the temporary folder are kept, and the temporary folder always keeps the .txt files of the run.
    • Excel (.xlsx) (Pro): SweepMe! additionally creates an Excel file next to each data file when the data is saved. The 1D data files are added as additional sheets.