LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading Metadata from TDSM file in Python

Hello, 

 

I am very new to working with TDSM files. I am trying to access the metadata (units, etc.) from python. I have tried the npTDMS and pytdms packages with no success. Has anyone figured out how to access the metadata in python? 

 

Thanks!

0 Kudos
Message 1 of 2
(2,896 Views)

I find npTDMS to be a little confusing to work with. You can read TDMS properties with npTDMS like this:

from nptdms import TdmsFile
tdms = TdmsFile(path)
group_names=tdms.groups()
g0=tdms.group_channels(group_names[0])
ch0=g0[0]
dt=ch0.property('wf_increment')

# or on one line dt=tdms.group_channels(tdms.groups()[0])[0].property('wf_increment')
0 Kudos
Message 2 of 2
(2,816 Views)