Code Monkey home page Code Monkey logo

tdms-parser's Introduction

TDMS.Parser

Build Status Coverage Status Hex Version Hex Docs License

Parser for NI TDMS files written in Elixir. The TDMS file parser is implemented natively in elixir and comes with zero-dependencies.

You can see the API documentation here.

Installation

The package can be installed by adding tdms_parser to your list of dependencies in mix.exs:

defp deps do
  [
    {:tdms_parser, "~> 0.0"}
  ]
end

Usage

The following command parses the given file and returns a TDMS.File structure.

iex> TDMS.Parser.parse(File.read!("test/data/basic.tdms"))

TDMS File Format

The single, most important feature to understand about the internal format of the TDMS file structure is its inherent hierarchical organization. The TDMS file format is structured using three levels of hierarchy: file, group, and channel. The file level can contain groups, and each group can contain multiple channels.

The high-level description of the TDMS file format can be found at The NI TDMS File Format.

For a detailed description of all fields, their data types and byte representations see TDMS File Format Internal Structure.

Data Structures

%TDMS.File{
  path: "/",
  properties: [
    %TDMS.Property{
      data_type: :string,
      name: "name",
      value: "ni-crio-9068-190fdf5_20190609_235850.tdms"
    }
  ],
  groups: [
    %TDMS.Group{
      name: "Temperature",
      path: "/'Temperature'",
      properties: [
        %TDMS.Property{data_type: :string, name: "name", value: "Temperature"}
      ]
      channels: [
        %TDMS.Channel{
          data: [24.172693869632123, 24.238202284912816, 24.22418907461031, ...],
          data_count: 201,
          data_type: :double,
          name: "ai.0",
          path: "/'Temperature'/'ai.0'",
          properties: [
            %TDMS.Property{data_type: :string, name: "name", value: "ai.0"},
            %TDMS.Property{
              data_type: :string,
              name: "datatype",
              value: "DT_DOUBLE"
            },
            ...
          ]
        },
        %TDMS.Channel{
          data: [24.07053512461277, 24.136787008557807, 24.128304594848682, ...],
          data_count: 201,
          data_type: :double,
          name: "ai.1",
          path: "/'Temperature'/'ai.1'",
          properties: [
            %TDMS.Property{data_type: :string, name: "name", value: "ai.1"},
            %TDMS.Property{
              data_type: :string,
              name: "datatype",
              value: "DT_DOUBLE"
            },
            ...
          ]
        },
        ...
      ]
    }
  ]
}

Build and Test

Build:

mix compile

Run the unit tests:

mix test --only unittest

Run the integration tests:

mix test --only integration

tdms-parser's People

Contributors

tschmittni avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.