asammdf | Fast Python reader and editor for ASAM MDF | JSON Processing library

 by   danielhrisca Python Version: 7.4.5 License: LGPL-3.0

kandi X-RAY | asammdf Summary

kandi X-RAY | asammdf Summary

asammdf is a Python library typically used in Utilities, JSON Processing applications. asammdf has no bugs, it has no vulnerabilities, it has build file available, it has a Weak Copyleft License and it has high support. You can install using 'pip install asammdf' or download it from GitHub, PyPI.

asammdf is a fast parser and editor for ASAM (Association for Standardization of Automation and Measuring Systems) MDF (Measurement Data Format) files. asammdf supports MDF versions 2 (.dat), 3 (.mdf) and 4 (.mf4). asammdf works on Python >= 3.7 (for Python 2.7, 3.4 and 3.5 see the 4.x.y releases).
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              asammdf has a highly active ecosystem.
              It has 480 star(s) with 190 fork(s). There are 35 watchers for this library.
              There were 3 major release(s) in the last 12 months.
              There are 57 open issues and 568 have been closed. On average issues are closed in 46 days. There are 3 open pull requests and 0 closed requests.
              OutlinedDot
              It has a negative sentiment in the developer community.
              The latest version of asammdf is 7.4.5

            kandi-Quality Quality

              asammdf has 0 bugs and 0 code smells.

            kandi-Security Security

              asammdf has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              asammdf code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              asammdf is licensed under the LGPL-3.0 License. This license is Weak Copyleft.
              Weak Copyleft licenses have some restrictions, but you can use them in commercial projects.

            kandi-Reuse Reuse

              asammdf releases are available to install and integrate.
              Deployable package is available in PyPI.
              Build file is available. You can build the component from source.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed asammdf and discovered the below as its top functions. This is intended to give you an instant insight into asammdf implemented functionality, and help decide if they suit your requirements.
            • Save the current MDF file
            • Get the block data blocks at the given index
            • Load data from the given group
            • Load signal data
            • Exports the MDF file
            • Get a dataframe from a group
            • Convert to pandas DataFrame
            • Setup the UI
            • Translates the UI
            • Save the MDF file
            • Randomly scramble a MDF file
            • Update the aspects of the aspects
            • Return a dictionary with the stats for the given cursor
            • Concatenate multiple files
            • Create a signal that cuts the signal
            • Load tabular window
            • Stack multiple files
            • Extract bus logging
            • Opens the menu dialog
            • Plot the sample data
            • Update the search text
            • Paint the image
            • Opens the menu at the given position
            • Load a plot window
            • Convert values to records
            • Applies processing
            Get all kandi verified functions for this library.

            asammdf Key Features

            No Key Features are available at this moment for asammdf.

            asammdf Examples and Code Snippets

            Create MF4 to be decode by J1939 DBC - asammdf
            Pythondot img1Lines of Code : 51dot img1License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            from asammdf import MDF, SUPPORTED_VERSIONS, Signal
            import numpy as np
            from asammdf.blocks.source_utils import Source
            
            sigs = []
            mdf = MDF()
            
            samples = [
                np.array([1,1,1,1,1], dtype=np.uint32),
                np.array([217056256,217056256,2170562
            how to combine two datasets to make one combined plot in python
            Pythondot img2Lines of Code : 2dot img2License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            y = m.iloc[:, 1:3]
            
            mf4 to csv conversion in python
            Pythondot img3Lines of Code : 9dot img3License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            pip install asammdf[gui]
            
            from asammdf import MDF
            mdf = MDF('input.mf4')
            mdf.export(fmt='csv', filename='output.csv')
            
            from asammdf.gui.asammdfgui import main
            main()
            
            Convert MDF4 to Dataframe, plot it and save as image
            Pythondot img4Lines of Code : 8dot img4License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            mdf_object = MDF(mdf_file_path)
            
            signals_to_keep = ['v_spd', 'ax_xacc', 'ay_yacc']
            mdf_to_plot = mdf_object.filter(signals_to_keep).cut(start=100, stop=240)
            mdf_dataframe = mdf_to_plot.to_dataframe()
            ax = mdf_dataframe.plot(figsize=(20, 10
            timestamps not aligned when reading from mdf (python, asammdf)
            Pythondot img5Lines of Code : 4dot img5License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            >>> ch.timestamps[29040:29050]
            array([290.47998, 290.48998, 290.49998, 290.50998, 290.51998, 290.52998,
                     0.87998,   0.88998,   0.89998,   0.90998])
            
            Error in importing "asammdf" in Robotframework
            Pythondot img6Lines of Code : 6dot img6License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            *** Settings ***
            Library C:/SomeFolder/example.py
            
            *** Settings ***
            Library ../folder/example.py
            
            Reading .dat file in python
            Pythondot img7Lines of Code : 29dot img7License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            import re
            
            with open("resources/input.dat") as f:
                lines = f.readlines()
                text = "".join(lines)
            
            regex = r"\|(.*?);"
            matches = re.finditer(regex, text, re.MULTILINE | re.DOTALL)
            
            
            data = []
            
            for matchNum, match in enumerate(matches, 
            load specific channels from mdf (.mf4) file
            Pythondot img8Lines of Code : 11dot img8License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            from asammdf import MDF
            
            if __name__ == '__main__':
                path = 'C:/path/to/some/file.mf4'
                mdfObj = MDF(path, version='4.10')
                columns=['A','B','C']
                # 0.1s
                df = mdfObj.to_dataframe(channels=columns, raster=0.1)
                # or use t
            change specific value in mdf-object (python, asammdf)
            Pythondot img9Lines of Code : 2dot img9License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            data = data.applymap(lambda x: np.nan if x==10**10 else x)
            
            Python asammdf library requires dependencies
            Pythondot img10Lines of Code : 2dot img10License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            pip install asammdf[gui]
            

            Community Discussions

            QUESTION

            ldf is not supported
            Asked 2022-Apr-15 at 20:49

            I install asammdf package to read dat file in python. After installing asammdf using pip install asammdf, the installation is successful. However, when I import asammdf, I got ldf is not supported. May I know how to solve this issue and after installing the asammdf? Moreover I also cannot open the spyder in my anaconda

            ...

            ANSWER

            Answered 2022-Apr-15 at 20:49

            That is just a warning message from the canmatrix library. If you don't use LIN database file (ldf files) for bus logging decoding then you can just ignore it.

            If you really want to make it go away then just install the ldfparser package since this is required for ldf support ( see https://github.com/ebroecker/canmatrix/blob/6ed291b73a5824e367615c99ee1b4e6084eb026e/setup.py#L98)

            Source https://stackoverflow.com/questions/71869085

            QUESTION

            Merge or concatenate mdf files asammdf
            Asked 2022-Jan-20 at 17:19

            I am trying to merge some mdf files using asammdf python package. When using MDF.concatenate I get this error:

            ...

            ANSWER

            Answered 2022-Jan-20 at 17:19

            You will need to remove the "extra" signals from the files. (you can use the filter method for example)

            Source https://stackoverflow.com/questions/70713554

            QUESTION

            Create MF4 to be decode by J1939 DBC - asammdf
            Asked 2021-Mar-18 at 16:04

            I'm trying to create a MF4 file to be decoded by a 'J1939.dbc' as the same way of CSS electronics

            My code to generate a example file is like this:

            ...

            ANSWER

            Answered 2021-Mar-18 at 16:04

            The meta-data for bus logging has to be added as well to the new channel group:

            Source https://stackoverflow.com/questions/66630991

            QUESTION

            writing unsorted mf4 file using asammdf
            Asked 2021-Mar-17 at 22:10

            Does asammdf offer the possibility to write unsorted mf4 files? I have seen that it can read both unsorted and sorted mf4 files

            If it is possible do you know where I can find a short example?

            ...

            ANSWER

            Answered 2021-Mar-17 at 22:10

            The asammdf library always writes sorted files

            Source https://stackoverflow.com/questions/66671092

            QUESTION

            Where to find info about MDF file structures and about "Group" and "Index" when working with .mdf files?
            Asked 2021-Jan-20 at 20:12

            Background info:

            I'm trying to use asammdf to import .dat files in python.

            Trying to use "mdf.select(["Channel_name"])" - or variations thereof - gives the following error:

            asammdf - ERROR - Multiple occurances for channel "Channel_name": ((2, 18), (2, 18)). Provide both "group" and "index" arguments to select another data group in Python.

            I've sort of managed to get it to work by bastardising some other code written by someone else which uses "mdf.channels_db" to eventually extract the channel data.

            My issue is that I don't fully understand what I am doing, and therefore not sure I am using this in the most efficient way.

            I've been through the asammdf documentation but did not really find an explanation.

            What does the error even mean and why am I getting?

            My hunch is that it has something to do with the structure of MDF files. Is that correct?

            Potentially the Channel Name in question appears more than once in the MDF, but then the location given in the error is the same twice: (2, 18), and this matches with what is see returned by mdf.info()

            Any idea where I can find out more?

            ...

            ANSWER

            Answered 2021-Jan-20 at 20:12

            Data ia stores in channel groups in the MDF standard. See the intro here https://www.asam.net/standards/detail/mdf/wiki/

            To visualize the file internal structure you can use Vector MDFValidator or the asammdf library GUI

            Source https://stackoverflow.com/questions/65812639

            QUESTION

            how to combine two datasets to make one combined plot in python
            Asked 2021-Jan-13 at 12:39

            I have a dataset of 6 parameters with 500 values each and I want to combine the two of the datasets to get the road curvature but I am getting an error. Since I am new to python, I am not sure that I am using the correct logic or not. Please guide.

            ...

            ANSWER

            Answered 2021-Jan-13 at 12:39

            Starting from your dataframe m

            Source https://stackoverflow.com/questions/65684935

            QUESTION

            mf4 to csv conversion in python
            Asked 2020-Dec-18 at 06:49

            I have a dataset of mf4 and I want to convert it into CSV in python. I have read the data from mf4 and convert it into csv (as given below) but I am getting an error, as I am new to python, so unable to find an appropriate method to convert.

            ...

            ANSWER

            Answered 2020-Dec-18 at 01:48

            You already have mf4 file. Is this file converted from an mdf file? If it is as I thought, you should use the mdf file to convert it into a CSV file. Here it is anyway and hopefully you or someone else can come up with a better method.

            Source https://stackoverflow.com/questions/65332473

            QUESTION

            Convert MDF4 to Dataframe, plot it and save as image
            Asked 2020-Jul-10 at 13:29

            I have logger measurement data as a mdf4 file. I need to visualize some of the signals and save it as an image. While the asammdf GUI can plot signals, I couldn't find a way to save the plot as an image. That's why I'm trying to convert the mdf4 object to pandas dataframe with the build-in asammdf function, plot it with matplotlib and save the plot as an image. Here is the code:

            ...

            ANSWER

            Answered 2020-Jul-10 at 12:03
            mdf_object = MDF(mdf_file_path)
            
            signals_to_keep = ['v_spd', 'ax_xacc', 'ay_yacc']
            mdf_to_plot = mdf_object.filter(signals_to_keep).cut(start=100, stop=240)
            mdf_dataframe = mdf_to_plot.to_dataframe()
            ax = mdf_dataframe.plot(figsize=(20, 10), title='Test', grid=True)
            ax.figure.savefig(path)
            

            Source https://stackoverflow.com/questions/62832408

            QUESTION

            Reading between tags in MDF file?
            Asked 2020-Apr-16 at 13:51

            I'd like to read specific user inputted comments between tags in an MDF/MDF3 file with python. Is this possible using asammdf or mdfreader?

            Parsing through the file the 'pythonic' way is giving gibberish results for some files

            ...

            ANSWER

            Answered 2020-Apr-15 at 07:09

            You should look at the comment attributes of the blocks that are interesting to you. See https://asammdf.readthedocs.io/en/latest/api.html#mdf-version-2-3-blocks

            Can you give an example of what TXBLOCK needs to be parsed? A MDFValidator screenshot would be nice too.

            Source https://stackoverflow.com/questions/61221224

            QUESTION

            Error in importing "asammdf" in Robotframework
            Asked 2020-Apr-09 at 19:28

            i have written a custom Library in python, which imports a package named "asammdf". But, when i import my custom Library in Robot code, it shows error in importing "asammdf" in python. It says: "Error in File *.robot. Importing test Library *.py failed. Import Error: DLL load failed: the specified module could not be found."

            "asammdf" package is available in one of the PYTHONPATH it mentions during executions.

            Can someone please help me doing this and let me know, what have i done wrong? My python File (trialRobot.py):

            ...

            ANSWER

            Answered 2020-Apr-09 at 16:37

            You need to provide the absolute path or relative path to the example.py file.

            so like,

            Source https://stackoverflow.com/questions/61121823

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install asammdf

            asammdf is available on. In case a wheel is not present for you OS/Python versions and you lack the proper compiler setup to compile the c-extension code, then you can simply copy-paste the package code to your site-packages. In this way the python fallback code will be used instead of the compiled c-extension code.
            github: https://github.com/danielhrisca/asammdf/
            PyPI: https://pypi.org/project/asammdf/
            conda-forge: https://anaconda.org/conda-forge/asammdf

            Support

            And a nicely written tutorial on the CSS Electronics site.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • PyPI

            pip install asammdf

          • CLONE
          • HTTPS

            https://github.com/danielhrisca/asammdf.git

          • CLI

            gh repo clone danielhrisca/asammdf

          • sshUrl

            git@github.com:danielhrisca/asammdf.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular JSON Processing Libraries

            json

            by nlohmann

            fastjson

            by alibaba

            jq

            by stedolan

            gson

            by google

            normalizr

            by paularmstrong

            Try Top Libraries by danielhrisca

            cmerg

            by danielhriscaPython

            mfile

            by danielhriscaPython

            asciifolder

            by danielhriscaPython