Skip to main content

Reading and writing TDM and TDMS files

Project description

############
Introduction
############

**cTDMS** is a Python package to read or write TDMS or TDM files.

TDMS or TDM are file formats developed by National Instruments and are the main file formats
for data storage in LabView from National Instruments.

**cTDMS** is using the NILIBDDC library from National Instruments, which is accessed by the help of the Python ``ctypes`` package.

Version 0.91 for 32bit and 64bit system


=============================
1. Reading TDMS or TDM files
=============================

To read a TDMS or TDM file you simply have to call: ::

from cTDMS.cTDMS import TDM_File

tdm=TDM_File("Data4.tdm")
tdm.open()

or: ::

from __future__ import with_statement
from cTDMS.cTDMS import TDM_File

with TDM_File("Data4.tdm") as tdm:
...
...
======================================
Accessing groups in a TDMS or TDM file
======================================

The tdm file object is organized like a dictionary. The groups contained in the TDM file can be acces by: ::

for groupname in tdm:
print "Group %s ------------"%( groupname)
group=tdm[groupname]

====================
Creating a new group
====================

A new group in the TDM file can be created with following command: ::

if "newgroupname" is not in tdm:
new_group=tdm.add_Group("newgroupname", "Description of the group")

Before creating a new group, it has to be checked, that this group is not already existing.

=========================
Getting data from a group
=========================

Measuring data are store in channels of a group. the can be easily accessed by getting the channels from the group: ::

for groupname in tdm:
print "Group %s ------------"%( groupname)
group=tdm[groupname]

for channelname in group:
print "Channel %s ------------"%(channelname)
channel=group[channelname]
print "Channel Properties -----"
for property in channel.attrs:
print property, channel.attrs[property]
# get some data
d=channel[5]
d=channel[-5]
d=channel[:]
d=channel[0:]
d=channel[10:-1]

t=type(d)
print "data type: %s, length: %d"%(str(type(d)), len(d))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cTDMS-0.91.zip (107.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cTDMS-0.91.win32.exe (303.8 kB view details)

Uploaded Source

File details

Details for the file cTDMS-0.91.zip.

File metadata

  • Download URL: cTDMS-0.91.zip
  • Upload date:
  • Size: 107.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cTDMS-0.91.zip
Algorithm Hash digest
SHA256 ed0ed0aa582d096387f01e98cf7e642d8ab9b876510285cedf1114373545477f
MD5 9b35d8a680a8ed1dc05c2087207b9375
BLAKE2b-256 9ac2644c5d4c543569f139a5a7bfe7266019789c483fae869dbe34275c1923d1

See more details on using hashes here.

File details

Details for the file cTDMS-0.91.win32.exe.

File metadata

  • Download URL: cTDMS-0.91.win32.exe
  • Upload date:
  • Size: 303.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cTDMS-0.91.win32.exe
Algorithm Hash digest
SHA256 fa5ed241d4038ac3a0f43f22fb485837ed9aa1582d763a3bdeda575d5358e15b
MD5 f928c86cea9ca66a95247f9b23a25740
BLAKE2b-256 2b56ab29659c42ba771c22a3d6e8e577e7b8c20ab8297d0067f5a3f0ee29b444

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page