Python parser for CarMaker ERG files.
Project description
cmerg
Python parser for CarMaker ERG files with Pandas dataframe export.
Use and Examples
Moslty these are notes for myself but hopefully someone else finds them useful.
Installation
This package is published on PyPI under the name cmerg.
Windows
> python -m pip install -U pip
> python -m pip install cmerg
Linux
$ python3 -m pip install -U pip
$ python3 -m pip install cmerg
Examples
Import the package folder.
import cmerg
Create ERG file object. (Using example file from repo)
log1 = cmerg.ERG('test-data/Test-Dataset-1_175937.erg')
List of the signals in the file.
log1.signals
Save the vehicle speed signal to a variable.
speed = log1.get('Vhcl.v')
Plot signal.
speed.plot()
Add signal to dataframe.
# New easy call to return a pandas dataframe.
df = log1.to_pd()
# Simple example of adding ERG data to pandas.
# TODO: Make 'toPd()' call
import cmerg
import pandas as pd
import numpy as np
log1 = cmerg.ERG('data-file.erg')
speed = log1.get('Vhcl.v')
t = np.array(speed.timestamps)
spd = np.array(speed.samples)
df = pd.DataFrame({'time':t, 'speed':spd})
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.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
cmerg-0.2-py3-none-any.whl
(5.8 kB
view details)
File details
Details for the file cmerg-0.2-py3-none-any.whl
.
File metadata
- Download URL: cmerg-0.2-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d359b731eb1586616350732b9bb3fde05aa270b0d9f49eed6453282560dacdb0 |
|
MD5 | 5afd43d2efee79bb1979c86c2cd04daa |
|
BLAKE2b-256 | f5d7494b9f648447a3a567c81677dbb698f6454dc8346d9a92c86a568df18789 |