Package: idelib
idelibREADMEidelibis a Python API for accessingenDAQ'sIDE recordings.  The IDE format is
anEBMLencoded file using a
custom schema.  This library utilizes ourebmliteto parse the files, and
provides classes that make reading data simple.IDE File BasicsWhat's an IDE file?An IDE file is a read-only hierarchical data format that stores recording
information generated by anenDAQ sensor device. It contains both time-indexed
data from several different kinds of sensors (like acceleration, pressure,
temperature, etc.), as well as metadata about the recording device (like device
serial number, model number, device name, etc.) and recording settings.Accessing an IDE fileThe top-level interface for an IDE file is theDatasetobject, through which
one can access all of the above-listed information. When you open a file for
reading, for example, this is the type of object that is returned.Opening an IDE FileYou can open an IDE file like so:filename="your_file.IDE"withidelib.importFile(filename)asds:print(type(ds))Note: aDatasetobject perfomslazy-loading, meaning that it only loads
information as is needed. As a result, it internally retains a handle to the
source file which after use needs to be closed. This can be accomplished by
either usingDatasetas acontext manager(as seen above; this is the
recommended method), or by usingDatasetas a normal value and calling theclose()method manually:filename="your_file.IDE"ds=idelib.importFile(filename)# use `ds` hereds.close()# remember to close the file after use!Getting recording dataChannels and SubchannelsIDE files organize recording data intochannelsandsubchannels. A channel
encapsulates data recorded by a particular individual sensor on the device
(e.g., XYZ acceleration from the ADXL375 DC Accelerometer); a subchannel, if
present, specifies a particular data stream within a channel (e.g., the
X-coordinate acceleration from the ADXL375 DC Accelerometer).At the top-level, aDatasetobject has achannelsmember, which is a dict
of all channels recorded in the file. The dict is keyed by channel id numbers,
withChannelobjects in the values.EachChannelobject has asubchannelsmember, which is a list ofSubchannelobjects. If the channel has no subchannels, this member will beNone.The below table lists current conventions for channels across all enDAQ sensors:(Abbreviated) Product No.DescriptionExample Product Nos.S-DenDAQ S-series devices with a single digital accelerometerS3-D16, S4-D40S-DDenDAQ S-series devices with dual digital accelerometersS1-D100D40, S2-D25D16S-EDenDAQ S-series devices with an analog piezoelectric and digital accelerometerS5-E25D40, S4-E100D40S-RDenDAQ S-series devices with an analog piezoresistive and digital accelerometerS4-R500D40, S5-R2000D40W-DenDAQ W-series devices with a single digital accelerometerW5-D40W-EDenDAQ W-series devices with an analog piezoelectric and digital accelerometerW8-E100D40, W8-E2000D40W-RDenDAQ W-series devices with an analog piezoresistive and digital accelerometerW8-R500D40, W8-R2000D40SSXMidé Slam Stick X data recordersSSXSSCMidé Slam Stick C data recordersSSCSSSMidé Slam Stick S data recordersSSSThe below table lists channel ID numbers used in a recording file based on the
recording device’s product number (device series numbers and accelerometer
sensitivity ranges are omitted when applicable to all such devices):SensorChannelValid DevicesSuchannelsMain Accelerometer8S-RD, S-ED, SSS, SSXX-, Y-, Z-axis Acceleration16/200g Accelerometer32S-DD, SSX, SSS, SSC, S-D16, S-D200X-, Y-, Z-axis Acceleration8/40g Accelerometer80S-RD, S-DD, S-ED, S-D40, S-D8X-, Y-, Z-axis AccelerationIMU Gyroscope47All1X-, Y-, Z-axis RotationAbsolute Orientation65All1X-, Y-, Z-, W-axis Quaternion; AccRelative Orientation70All1X-, Y-, Z-, W-axis QuaternionMPL311536S-D16, All1before Mid-2023Pressure, Temperature2MS8607 Internal20All1after Mid-2023Pressure, Temperature, HumidityMS8607 Control Pad59All1Pressure, Temperature, HumiditySI113376All1Lux, UVBMI270/BMG250 Gyroscope84All1after Mid-2023X-, Y-, Z-axis RotationCAM-M8Q GPS88W-D, W-ED, W-RDLatitude, Longitude, Time, Speed1excluding early SSC/SSS/SSX models21 Hz Internal Measurements310 Hz Control Pad MeasurementsTo simply use all recording data, we can iterate through each subchannel in a dataset like so:forchinds.channels.values():forschinch.subchannels:print(sch)EventArrays and raw dataEachChannelandSubchannelobject has agetSession()method, which
returns anEventArrayobject.EventArrayis a wrapper around a channel's
underlying recording data that loads data on demand from the source file. You
can index anEventArray(e.g.,eventarray[i]for some indexi) to get a
numpyndarrayof data. Data is organized in an n-dimensional array.For subchannels, this will always be a 2-by-n array, where n is the number of
samples recorded;eventarray[1]indexes the samples,eventarray[0]indexes
the respective timestamps.For channels, this will be a (c+1)-by-n array, where n is the number of samples
recorded and c is the number of subchannels;eventarray[1:]indexes the
samples,eventarray[0]indexes the respective timestamps.Getting metadataDatasetmakes available some basic metadata. Some useful pieces of information
are stored directly as members:>>>ds.filename'C:\\Users\\Public\\SSX09546_019.IDE'Other data is stored in the dict member recorderInfo:>>>ds.recorderInfo['RecorderSerial']9546>>>ds.recorderInfo['PartNumber']'S3-E500D40'EventArrayalso stores some sample-specific metadata, like the data's units:>>>eventarray.units('Acceleration',u'g')