New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Time track incorrect do to failure to read offset #41
Comments
Would you have an example file (as small as possible) that we can look into? |
I uploaded the file to https://github.com/boiler42/npTDMS My code is: b should lag a by 3 seconds. Absolute time is correct. Relative time is not correct |
I think it's best that @adamreeve looks at this. My knowledge of TDMS files is kinda bad :-) |
Your file has offsets of zero for each channel but has different absolute start times. The output from tdmsinfo looks like:
So when you want to plot the data you could plot each channel against an absolute time or calculate the offset based on the absolute times. If you want to get a time track with absolute times for your channel you can set |
Understood. For the real work, I am getting absolute time for each channel and then relativizing them by subtracting the min across all channels. I think your current code is correct and this is more of a peculiarity of the file I am using. It would be nice to print a warning if you get relative times from channels with unequal "true start times", which I am considering to be equal to wf_start_time + wf_start_offset. It would be even better if the extra functionality I described above were built in, basically a third option for time which would be something like "global_relative". Thanks for the quick replies and the helpful library! I am a python guy but where I work all test data is NI/TDMS so nptdms is perfect. |
Hmm so re-reading NI's documentation on So this is probably always zero for time-series data. It's just that the I will update the documentation to clarify what these parameters mean, and note that |
I have a tdms file which I know has a time offset for some channels because I can view it in LabView. However when I get the time with the below it returns an incorrect time.
tdms_obj = tdms_file.object(GROUP, channel)
t = tdms_obj.time_track()
When I looked into it deeper, tdms_obj.property('wf_start_offset') = 0 for all channels, which is incorrect. Since some of the channels have an offset, when you plot all of the data things don't line up as they should. I am using relative times throughout.
The text was updated successfully, but these errors were encountered: