| 1 |
.. raw:: html |
| 2 |
|
| 3 |
<style> .red {color:red} </style> |
| 4 |
<style> .blue {color:blue} </style> |
| 5 |
<style> .green {color:green} </style> |
| 6 |
<style> .cyan {color:cyan} </style> |
| 7 |
<style> .magenta {color:magenta} </style> |
| 8 |
<style> .orange {color:orange} </style> |
| 9 |
<style> .brown {color:brown} </style> |
| 10 |
|
| 11 |
.. role:: red |
| 12 |
.. role:: blue |
| 13 |
.. role:: green |
| 14 |
.. role:: cyan |
| 15 |
.. role:: magenta |
| 16 |
.. role:: orange |
| 17 |
.. role:: brown |
| 18 |
|
| 19 |
---- |
| 20 |
Tips |
| 21 |
---- |
| 22 |
|
| 23 |
|
| 24 |
Selective channel loading |
| 25 |
========================= |
| 26 |
Since asammdf 6.1.0 you can use the `channels` argument to perform a selective channel loading. Only the metadata |
| 27 |
of channels found in the selection iterable will be preserved after loading the file. This can yield a big |
| 28 |
speed improvement for loading the file, but also when performing operations with the `MDF` object (for example |
| 29 |
`select`, `get`, etc.). |
| 30 |
|
| 31 |
.. code-block:: python |
| 32 |
|
| 33 |
required_channels = ["Speed", "Acceleration", "Force"] |
| 34 |
mdf = MDF("input.mf4", channels=required_channels) |
| 35 |
|
| 36 |
|
| 37 |
Data coupling |
| 38 |
============= |
| 39 |
All the data returned by the `MDF` methods is decoupled from the raw data found in the original file. |
| 40 |
For example, if you modify the `Signal` returned by the `get` call the changes will not be seen in the |
| 41 |
raw data. A second `get` call of the same channel name will once again give you the data found in the |
| 42 |
original file. |
| 43 |
|
| 44 |
|
| 45 |
Chunked data access |
| 46 |
=================== |
| 47 |
|
| 48 |
`asammdf` optimizes memory usage by processing samples |
| 49 |
in fragments. The read fragment size was tuned based on experimental measurements and should |
| 50 |
give a good compromise between execution time and memory usage. |
| 51 |
|
| 52 |
You can further tune the read fragment size using the `configure` method, to favor execution speed |
| 53 |
(using larger fragment sizes) or memory usage (using lower fragment sizes). |
| 54 |
|
| 55 |
|
| 56 |
Optimized methods |
| 57 |
================= |
| 58 |
The `MDF` methods (`cut`, `filter`, `select`) are optimized and should be used instead of calling `get` for several channels. |
| 59 |
|
| 60 |
Each `get` call will read all channel group raw samples from disk. If you need to extract multiple channels it is strongly advised to use the `select` method: |
| 61 |
for each channel group that contains channels submitted for selection, the raw samples will only be read once. |
| 62 |
|
| 63 |
|
| 64 |
Faster file loading |
| 65 |
=================== |
| 66 |
|
| 67 |
Skip XML parsing for MDF4 files |
| 68 |
------------------------------- |
| 69 |
`MDF4` uses the XML channel comment to define the channel's display name (this acts |
| 70 |
as an alias for the channel name). XML parsing is an expensive operation that can |
| 71 |
have a big impact on the loading performance of measurements with high channel |
| 72 |
count. |
| 73 |
|
| 74 |
You can use the keyword only argument `use_display_names` when creating `MDF` |
| 75 |
objects to control the XML parsing (default is True). This means that the display names will be |
| 76 |
available when calling the `get` method. |
| 77 |
|
| 78 |
|
| 79 |
|