A comprehensive, user-centric Python API for working with enDAQ data and devices
Project description
endaq-ide
endaq.ide
contains high-level utility functions to aid in importing and inspecting enDAQ IDE recording files. Key functions/features include:
get_channel_table()
: Get summary information about the contents of a file.get_doc()
: Open an IDE, either locally or from a URL.to_pandas()
: Convert IDE data to apandas
DataFrame
, for use with other packages.
Note: This is a component of the endaq
package; it is separate to allow users to install it independently, avoiding the core endaq-python
dependencies. It is included in a full endaq
install.
endaq.ide
usage examples
Here are a few examples of endaq.ide
in use. For more information, see the full documentation.
For brevity, the following examples assume everything has been imported from endaq.ide
:
from endaq.ide import *
Opening IDE files: endaq.ide.get_doc()
endaq.ide
includes a convenient shortcut for importing IDE data: get_doc()
. It can load data from local files, or read data directly from a URL.
doc = get_doc("tests/test.ide")
doc1 = get_doc("https://mide.services/software/test.ide")
IDE files can be retrieved directly from Google Drive using a Drive 'sharable link' URL. The file must be set to allow access to "Anyone with the link."
doc2 = get_doc("https://drive.google.com/file/d/1t3JqbZGhuZbIK9agH24YZIdVE26-NOF5/view?usp=sharing")
Whether opening a local file or a URL, get_doc()
can be used to import only a specific interval by way of its start
and end
parameters:
doc3 = get_doc("tests/test.ide", start="5s", end="10s")
Summarizing IDE files: endaq.ide.get_channel_table()
Once an IDE file has been loaded, endaq.ide.get_channel_table()
will retrieve basic summary information about its contents.
get_channel_table(doc)
channel | name | type | units | start | end | duration | samples | rate | |
---|---|---|---|---|---|---|---|---|---|
0 | 32.0 | X (16g) | Acceleration | g | 00:00.0952 | 00:19.0012 | 00:18.0059 | 7113 | 393.86 Hz |
1 | 32.1 | Y (16g) | Acceleration | g | 00:00.0952 | 00:19.0012 | 00:18.0059 | 7113 | 393.86 Hz |
2 | 32.2 | Z (16g) | Acceleration | g | 00:00.0952 | 00:19.0012 | 00:18.0059 | 7113 | 393.86 Hz |
3 | 80.0 | X (8g) | Acceleration | g | 00:00.0948 | 00:19.0013 | 00:18.0064 | 9070 | 502.09 Hz |
4 | 80.1 | Y (8g) | Acceleration | g | 00:00.0948 | 00:19.0013 | 00:18.0064 | 9070 | 502.09 Hz |
5 | 80.2 | Z (8g) | Acceleration | g | 00:00.0948 | 00:19.0013 | 00:18.0064 | 9070 | 502.09 Hz |
6 | 36.0 | Pressure/Temperature:00 | Pressure | Pa | 00:00.0945 | 00:19.0175 | 00:18.0230 | 20 | 1.10 Hz |
7 | 36.1 | Pressure/Temperature:01 | Temperature | °C | 00:00.0945 | 00:19.0175 | 00:18.0230 | 20 | 1.10 Hz |
8 | 70.0 | X | Quaternion | q | 00:01.0132 | 00:18.0954 | 00:17.0821 | 1755 | 98.47 Hz |
9 | 70.1 | Y | Quaternion | q | 00:01.0132 | 00:18.0954 | 00:17.0821 | 1755 | 98.47 Hz |
10 | 70.2 | Z | Quaternion | q | 00:01.0132 | 00:18.0954 | 00:17.0821 | 1755 | 98.47 Hz |
11 | 70.3 | W | Quaternion | q | 00:01.0132 | 00:18.0954 | 00:17.0821 | 1755 | 98.47 Hz |
12 | 59.0 | Control Pad Pressure | Pressure | Pa | 00:00.0979 | 00:18.0910 | 00:17.0931 | 180 | 10.04 Hz |
13 | 59.1 | Control Pad Temperature | Temperature | °C | 00:00.0979 | 00:18.0910 | 00:17.0931 | 180 | 10.04 Hz |
14 | 76.0 | Lux | Light | Ill | 00:00.0000 | 00:18.0737 | 00:18.0737 | 71 | 3.79 Hz |
15 | 76.1 | UV | Light | Index | 00:00.0000 | 00:18.0737 | 00:18.0737 | 71 | 3.79 Hz |
The results can be filtered by measurement type:
get_channel_table(doc, ACCELERATION)
channel | name | type | units | start | end | duration | samples | rate | |
---|---|---|---|---|---|---|---|---|---|
0 | 32.0 | X (16g) | Acceleration | g | 00:00.0952 | 00:19.0012 | 00:18.0059 | 7113 | 393.86 Hz |
1 | 32.1 | Y (16g) | Acceleration | g | 00:00.0952 | 00:19.0012 | 00:18.0059 | 7113 | 393.86 Hz |
2 | 32.2 | Z (16g) | Acceleration | g | 00:00.0952 | 00:19.0012 | 00:18.0059 | 7113 | 393.86 Hz |
3 | 80.0 | X (8g) | Acceleration | g | 00:00.0948 | 00:19.0013 | 00:18.0064 | 9070 | 502.09 Hz |
4 | 80.1 | Y (8g) | Acceleration | g | 00:00.0948 | 00:19.0013 | 00:18.0064 | 9070 | 502.09 Hz |
5 | 80.2 | Z (8g) | Acceleration | g | 00:00.0948 | 00:19.0013 | 00:18.0064 | 9070 | 502.09 Hz |
Measurement types can be combined to retrieve more than one:
get_channel_table(doc, ACCELERATION+TEMPERATURE)
channel | name | type | units | start | end | duration | samples | rate | |
---|---|---|---|---|---|---|---|---|---|
0 | 32.0 | X (16g) | Acceleration | g | 00:00.0952 | 00:19.0012 | 00:18.0059 | 7113 | 393.86 Hz |
1 | 32.1 | Y (16g) | Acceleration | g | 00:00.0952 | 00:19.0012 | 00:18.0059 | 7113 | 393.86 Hz |
2 | 32.2 | Z (16g) | Acceleration | g | 00:00.0952 | 00:19.0012 | 00:18.0059 | 7113 | 393.86 Hz |
3 | 80.0 | X (8g) | Acceleration | g | 00:00.0948 | 00:19.0013 | 00:18.0064 | 9070 | 502.09 Hz |
4 | 80.1 | Y (8g) | Acceleration | g | 00:00.0948 | 00:19.0013 | 00:18.0064 | 9070 | 502.09 Hz |
5 | 80.2 | Z (8g) | Acceleration | g | 00:00.0948 | 00:19.0013 | 00:18.0064 | 9070 | 502.09 Hz |
6 | 36.1 | Pressure/Temperature:01 | Temperature | °C | 00:00.0945 | 00:19.0175 | 00:18.0230 | 20 | 1.10 Hz |
7 | 59.1 | Control Pad Temperature | Temperature | °C | 00:00.0979 | 00:18.0910 | 00:17.0931 | 180 | 10.04 Hz |
Information about a specific interval can be retrieved by using the start
and/or end
arguments. Note that due to different sampling rates, the start and end times for slower channels may not precisely match the specified start
or end
.
get_channel_table(doc, ACCELERATION+TEMPERATURE, start="0:05", end="0:10")
channel | name | type | units | start | end | duration | samples | rate | |
---|---|---|---|---|---|---|---|---|---|
0 | 32.0 | X (16g) | Acceleration | g | 00:05.0000 | 00:10.0001 | 00:05.0000 | 1969 | 393.75 Hz |
1 | 32.1 | Y (16g) | Acceleration | g | 00:05.0000 | 00:10.0001 | 00:05.0000 | 1969 | 393.75 Hz |
2 | 32.2 | Z (16g) | Acceleration | g | 00:05.0000 | 00:10.0001 | 00:05.0000 | 1969 | 393.75 Hz |
3 | 80.0 | X (8g) | Acceleration | g | 00:05.0000 | 00:10.0001 | 00:05.0000 | 2510 | 501.98 Hz |
4 | 80.1 | Y (8g) | Acceleration | g | 00:05.0000 | 00:10.0001 | 00:05.0000 | 2510 | 501.98 Hz |
5 | 80.2 | Z (8g) | Acceleration | g | 00:05.0000 | 00:10.0001 | 00:05.0000 | 2510 | 501.98 Hz |
6 | 36.1 | Pressure/Temperature:01 | Temperature | °C | 00:04.0954 | 00:10.0966 | 00:06.0011 | 6 | 1.00 Hz |
7 | 59.1 | Control Pad Temperature | Temperature | °C | 00:05.0086 | 00:10.0095 | 00:05.0008 | 50 | 9.98 Hz |
Extracting intervals: endaq.ide.extract_time()
A portion of an IDE file can be saved to another, new IDE. The source can be a local filename or an opened IDE (from a file or URL).
extract_time("tests/test.ide", "doc_extracted.ide", start="0:05", end="0:10")
extract_time(doc1, "doc1_extracted.ide", start="0:05", end="0:10")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.