Skip to content

Converting a large TDMS file (> 100 GB) to HDF5 #340

Answered by adamreeve
rgklager asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @rgklager, how are you currently converting TDMS to HDF5. Have you tried this and you're getting errors?

Assuming your TDMS file is split into multiple chunks, then something like this code will read the data one chunk at a time:

with nptdms.TdmsFile.open(file_path) as tdms_file:
    hdf_file = tdms_file.as_hdf(hdf_path)

I'm not very familiar with h5py though. We write to slices of a dataset at a time, and my understanding is this should write to disk without needing to keep the full array in memory:

datasets[channel.path][offset:end] = _hdf_array(channel, channel_chunk[:])

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rgklager
Comment options

Answer selected by rgklager
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants