Import Data from File
What are data sources?
A data source is the central container for signals in ScryLab. For a conceptual introduction, see Concepts: Data Sources.
Data can either be imported from files or sent programmatically via the REST API – both methods result in a data source whose signals are available in the Source Signals Browser.
You can load persisted measurement or simulation data using the “Load Data Source” button
in the Data Source Browser or via the Command Palette (Ctrl+P) with the command Load Data Source.
ScryLab currently supports importing files in the following formats:
| Format | Extensions |
|---|---|
| MDF | .mf4, .mf3, .dat, .mdf |
| HDF5 | .h5, .hdf5 |
| CSV | .csv |
| Excel | .xlsx, .xls |
The sections below describe how each format has to be structured so that ScryLab reads your signals correctly.
More formats
More formats will follow in the future. If you need a specific format, feel free to contact us via the contact form or by email.
MDF
MDF (.mf4, .mf3, .dat, .mdf) is a standardized measurement format – there is nothing to prepare on your side. ScryLab reads the file as it is:
- Every data channel becomes a signal. The channel name is the signal name, its unit is taken from the channel metadata.
- The master channel of each channel group is used as the x-axis (usually time).
- If the same channel name occurs several times, only the first occurrence is imported.
HDF5
ScryLab reads HDF5 files in one of two layouts. The layout is detected automatically: if any top-level group contains a dataset named y, the whole file is read as grouped, otherwise as flat.
Grouped layout (recommended)
Each signal is a group that holds its samples as datasets. This is also the layout ScryLab writes when it exports HDF5.
| Dataset | Required | Meaning |
|---|---|---|
y | yes | 1‑D array of y-samples |
x | no | 1‑D x-axis, same length as y. If missing, the sample index is used |
z | no | 1‑D z-samples (for 3‑D signals) |
Units are read from the group attributes y_unit, x_unit and z_unit (as a fallback, a unit attribute on the x/y dataset is used). The group name is the signal name; nested groups are allowed and become a path, e.g. engine/temperature.
# Example written with h5pyimport h5py, numpy as np
t = np.linspace(0, 1, 1000)with h5py.File("measurement.h5", "w") as f: g = f.create_group("Sine 5Hz") g.create_dataset("x", data=t) g.create_dataset("y", data=np.sin(2 * np.pi * 5 * t)) g.attrs["x_unit"] = "s" g.attrs["y_unit"] = "V"Flat layout
Every 1‑D dataset is treated as a signal (y-samples only); the sample index is used as the x-axis. The unit is read from the dataset’s unit attribute. Nested groups are traversed and become a path in the signal name.
Which layout should I use?
Prefer the grouped layout whenever you have a real x-axis (time, frequency, …) or want to set units. The flat layout is only meant for plain value vectors.
CSV & Excel
Tabular files are imported column by column: every numeric column becomes one signal, and the column header is the signal name. Text columns and columns without a header (Unnamed: …) are ignored. For Excel, each sheet is imported as its own data source.
Time axis
ScryLab tries to detect the x-axis automatically:
- A column whose name is a typical time name is used as the time axis:
time,zeit,timestamp,t,sec,secs,seconds,time_s. The comparison is case-insensitive and a unit suffix in brackets is ignored, soTime [s]orZEIT (s)are recognized as well. - Otherwise, the first column is used if it is numeric and strictly increasing.
- If neither applies, the sample index becomes the x-axis.
Time [s]; Speed; Voltage0.00; 0.0; 1.980.01; 0.5; 2.010.02; 1.1; 2.04Several sensors with their own time axis
If a table contains more than one time column, ScryLab uses a column-pair layout: each time column applies to the value columns to its right, up to the next time column. This lets you store asynchronously sampled channels side by side. Shorter channels may be padded with empty cells – ScryLab trims that padding per signal.
To keep the time columns apart, give each one a time name with a suffix, e.g. Time_A / Time_B or zeit_sensor1 / zeit_sensor2 – the prefixes time_, zeit_, timestamp_ and so on are all recognized. Two columns simply named Time work as well (the table reader renames the second one to Time.1). What does not work is the short t_ prefix (t_1, t_2): it is deliberately excluded so that a column like t_motor (a temperature) is not mistaken for a time axis.
Time_A; Pressure; Time_B; Temperature0.00; 1013; 0.0; 21.40.01; 1012; 0.5; 21.50.02; 1014; ; 21.6CSV details
The delimiter (comma, semicolon or tab) is detected automatically, and German number formatting with a decimal comma (1,5) is recognized as well. CSV and Excel files carry no unit information, so signals imported this way have no unit – you can assign one later inside ScryLab.