Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Python parser for CarMaker ERG files

License

NotificationsYou must be signed in to change notification settings

danielhrisca/cmerg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python parser for CarMaker ERG files with Pandas DataFrame export.

Use and Examples

Mostly these are notes for myself but hopefully someone else finds them useful.

Installation

This packageis published on PyPI under the namecmerg.

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')

Dictionary 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.importcmergimportpandasaspdimportnumpyasnplog1=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})

Export ERG file to CarMaker compliant csv (e.g. for import usingImport from File)

log1=cmerg.ERG('data-file.erg')log1.export_cm_csv("./target.csv")# it's also possible to export only quantities that matches a namespace:log1.export_cm_csv("./target.csv",columns_filter=["Car_"])# CM's Import from File cannot handle many digits well, therefore the exported values are rounded. The number of digits can be sepcified:log1.export_cm_csv("./target.csv",columns_filter=["Car_"],digits=5)

About

Python parser for CarMaker ERG files

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp