tdms | Ruby library to read files in NI TDMS format

 by   mnaberez Ruby Version: Current License: BSD-3-Clause

kandi X-RAY | tdms Summary

kandi X-RAY | tdms Summary

tdms is a Ruby library. tdms has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

TDMS is a binary file format for measurement data. It was created by National Instruments. National Instruments software such as LabVIEW, DIAdem, and Measurement Studio support reading and writing TDMS files. NI also provides a DLL written in C for using TDMS files on Windows. TDMS for Ruby was written to provide a convenient way to work with TDMS files on Unix-like platforms.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              tdms has a low active ecosystem.
              It has 5 star(s) with 2 fork(s). There are 2 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              tdms has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of tdms is current.

            kandi-Quality Quality

              tdms has no bugs reported.

            kandi-Security Security

              tdms has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              tdms is licensed under the BSD-3-Clause License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              tdms releases are not available. You will need to build from source code and install.

            Top functions reviewed by kandi - BETA

            kandi has reviewed tdms and discovered the below as its top functions. This is intended to give you an instant insight into tdms implemented functionality, and help decide if they suit your requirements.
            • Parse the next segment data .
            • Yields each chunk of data .
            • Get the next channel .
            • The enumerator for this channel .
            • Dump the channel to a channel
            • Loads a file from this channel .
            • Read a property from the stream
            • Return the value of the data
            • Reads an integer
            • Find an object by id
            Get all kandi verified functions for this library.

            tdms Key Features

            No Key Features are available at this moment for tdms.

            tdms Examples and Code Snippets

            No Code Snippets are available at this moment for tdms.

            Community Discussions

            QUESTION

            show coordinates of an image stored in an array using mathplotlib
            Asked 2021-May-04 at 16:12
                from nptdms import TdmsFile as td  
                from matplotlib import pyplot as plt
                import numpy as np
                import skimage.color
                import skimage.filters
                import mplcursors
                from skimage.feature import corner_harris,corner_peaks
                
                file = 'sample.tdms' 
                with td.open(file) as tdms_file:
                 img = tdms_file.as_dataframe()
                cropped_list = []
                sel=cropped_list.append(img.iloc[700:1250,450:1550:])
            coords=corner_peaks(corner_harris(sel),min_distance=10,threshold_rel=0.02)
                fig, ax = plt.subplots()
                ax.imshow(sel, cmap='gray')
                plotted_points =ax.plot(coords[:, 1], coords[:, 0], color='cyan', marker='o',linestyle='None', markersize=2) 
                mplcursors.cursor(plotted_points, hover=True)
                plt.show(
            
            ...

            ANSWER

            Answered 2021-Apr-11 at 00:59

            mplcursors automatically create annotations with the x and y positions. Only when you need extra information, you'd need to write a function to change the annotation depending on the selected point.

            Here is some code, using a random image to show how it would work:

            Source https://stackoverflow.com/questions/67021006

            QUESTION

            DateTime adjustment when reading TDMS files from Python
            Asked 2021-Apr-22 at 12:23

            I have a TDMS file with a bunch of DateTime values with relevant instrumentation data.
            The issue I am having is:

            ...

            ANSWER

            Answered 2021-Apr-22 at 12:23

            So I ended up contacting the author and he was helpful enough to send a response:

            TDMS files internally store times in UTC. You don't say how you're getting the values in the "TDMS file" column but I assume this is from a program that converts times into your local timezone to display them. There is an example of how to convert UTC times from a TDMS file into your local timezone in the documentation.

            If you are storing these times in a database though, I would strongly recommend you store times in UTC rather than your local timezone as local times can be ambiguous due to daylight savings changes, and UTC is easily understood from anywhere in the world without having to know the local timezone where the data originated.

            If you still feel like making the change from UTC to EST then this should do it:

            Source https://stackoverflow.com/questions/67201336

            QUESTION

            How can I import many binary files in Dask?
            Asked 2021-Jan-07 at 19:16

            I have many binary files (.tdms format, similar to .wav) stored in S3 and I would like to read them with nptdms then process them in a distributed fashion with Dask on a cluster.

            In PySpark there is pyspark.SparkContext.binaryFiles() which produces an RDD with a bytearray for each input file which is a simple solution to this problem.

            I have not found an equivalent function in Dask - is there one? If not, how could the equivalent functionality be achieved in Dask?

            I noticed there's dask.bytes.read_bytes() if it's necessary to involve this however nptdms can't read a chunk of a file - it needs the entire file to be available and I'm not sure how to accomplish that.

            ...

            ANSWER

            Answered 2021-Jan-06 at 14:05

            dask.bytes.read_bytes() will give you whole files if you use blocksize=None, i.e., exactly one block per file. The most common use case for that is compressed files (e.g., gzip) where you can't start mid-stream, but should work for your use case too. Note that the delayed objects you get each return bytes, not open files.

            Alternatively, you can use fsspec.open_files. This returns OpenFile objects, which are safe to serialise and so you can use them in dask.delayed calls such as

            Source https://stackoverflow.com/questions/65591219

            QUESTION

            How to implement HDMI pass-through on XILINX FPGA (Artix-7)
            Asked 2020-Nov-16 at 09:15

            I want to implement my own HDMI-Passthrough on Nexys-Video Board equipped with Artix-7 FPGA and HDMI sink/source ports. My setup is: A PC HDMI port is connected to the sink port while an LED monitor is connected to the source HDMI port.

            Since there is no TDMS encoder/decoder on the board, I will also need to implement them next (I don't want to just grab one of the closed source implementations readily available on the internet). But for now, I just need to connect sink/source ports over the FPGA so I can get the video shown on the monitor. However, I could not succeed yet. No picture is shown and the monitor says 'No Signal'. I am a little bit worried about mis-using FGPA ports which could result in permanent damage to the board. Therefore, I did not try everything came to my mind. I am expecting advices to correct/complete my code.

            I connected HDMI signals as in the following code and schematic:

            ...

            ANSWER

            Answered 2020-Nov-16 at 09:15

            I got it working finally. Now my Nexys Video card passes through a Full HD video. Here are the details:

            1. Both HPA and TXEN pins must be set to '1'. In my case I assigned HPD pin of the source port to the HPA pin of the sink port. Checking the board schematic, the HPD pin is tied to an open drain MOSFET, so it must be inverted before the assignment.

            assign HDMIR_HPA = ~HDMIT_HPD;

            1. Additionally, after a thorough googling, I found that bridging DDC SCL and SDA pins of sink port to source port seems to be impossible as two bidirectional pins cannot be (simply) wired on FPGAs. So the solution to the problem is adding an EDID ROM emulator to the sink side. Then the FPGA itself behaves as a monitor to the video source device (i.e. the PC in my setup).

            I found a VHDL implementation of EDID ROM from here. It emulates a 1024 x 768 monitor, however I changed it to 1920 x 1080.

            This is the revised code for the top module:

            Source https://stackoverflow.com/questions/64636957

            QUESTION

            Unable to apply method "read" to TdmsFile from nptdms
            Asked 2020-Oct-19 at 02:31

            I have been using the nptdms module to do analysis of TDMS files without issue for several years. Recently, I got an error when trying to read a TDMS file for the first time. I import TdmsFile from nptdms:

            from nptdms import TdmsFile

            I try to read it:

            tdms_file = TdmsFile.read(path_to_my_tdms_file)

            and then get the following error:

            type object 'TdmsFile' has no attribute 'read'

            I am using python v3.6.10, with Anaconda and the nptdms v0.12.0.

            ...

            ANSWER

            Answered 2020-Sep-29 at 17:02

            The method you are referring to exists in the current documentation so it would make sense to

            1. Restart the virtual environment (close cmd line; start again; conda activate ).

            If this does not help...

            1. Reinstall the package:

              conda remove nptdms

              conda install nptdms

            (the exact commands may differ depending on your environment).

            If this does not help, create a fresh conda environment and install from scratch and check again.

            Source https://stackoverflow.com/questions/64124094

            QUESTION

            Replacing a character in only one column in multiple files (inside a folder)
            Asked 2020-Aug-24 at 11:01

            I have a folder which contains XLSX file (TDMS file converted to XLSX). I want to replace comma by dot in column A. The data in column A have the following format : 2020/06/12 16:07:12,465 I want the format to change to be like this : 2020/06/12 16:07:12.465 In order to plot the data stored in these files using software like DatPlot or KstPlot to process data faster than Excel could do.

            I used the record macro to get a working macro that does the job when I call it with a button located directly on the same sheet that I want to modify.

            ...

            ANSWER

            Answered 2020-Jul-08 at 12:19

            When you write Set wbSource = Workbooks.Open(myfile), myfile becomes the active workbook. The active worksheet will be whichever worksheet was active when the workbook was last saved.

            You next write Columns("A").Replace ... . This statement operates on the active worksheet. If the wrong worksheet is active, this statement will not have the effect you seek.

            If my guess about the cause of your problem is correct, try Worksheets("xxx").Columns("A").Replace ... where "xxx" is the name of the worksheet containing the column you wish to change.

            Edit 1

            I find it difficult to understand what is going wrong. You say the name of the worksheet is “Values” but when you try to access that worksheet you are told it does not exist. I will try to explain Workbooks, Worksheets and related terms.

            Suppose you open workbooks “A.xlsx”, “B.xlsx” and “C.xlsm”. It is possible to open “A.xlsx”, “B.xlsx” and “C.xlsm” each in their own copy (instance) of Excel.exe, but this is not easy. Normally, there will be one instance of Excel.exe “containing” three open workbooks. Workbooks is a collection or list of the open workbooks within an instance of Excel.. A macro within “C.xlsm” could contain:

            Source https://stackoverflow.com/questions/62686737

            QUESTION

            TDMS file read data in python
            Asked 2020-Jul-24 at 07:09

            During the project, I had to deal with a TDMS file. I'm asking because the file could not be read immediately.

            My Goal: Perform analysis by converting TDMS file into DataFrame format

            First attempt, -Perform TdmsFile open using npTdms package. -Converts to read_data() to execute pd.DataFrame command.

            ...

            ANSWER

            Answered 2020-Jul-24 at 06:48

            QUESTION

            How to skip or ignore empty files in python?
            Asked 2020-Jun-25 at 08:06

            How can I skip/ignore the empty tdms files (0KB) from entering my final excel file? This is the code I use, however when i opened the Excel sheet I still found out that it collected the empty files.

            Does someone has a solution for this?

            ...

            ANSWER

            Answered 2020-Jun-24 at 11:46

            You can use this code to check if a file is empty:

            Source https://stackoverflow.com/questions/62553269

            QUESTION

            Convert multiple TDMS metadata files in one Excel sheet
            Asked 2020-Jun-23 at 11:36

            I have multiple TDMS files in a source folder. I use below code to read the metadata out of those files, that works perfectly now. However, to improve my code I would like to merge all those files in 1 excel file and everytime I receive new TDMS files and run my code, the metadata will be added at the bottom of my Excel sheet.

            This is the code I have right now:

            ...

            ANSWER

            Answered 2020-Jun-23 at 11:36

            This is not using Python. But a simple batch script "type" can append all the file to txt oor csv file. Try this in command prompt pr save the code as filename.bat:

            Source https://stackoverflow.com/questions/62532951

            QUESTION

            Reading the metadata of a TDMS file in python
            Asked 2020-Jun-23 at 10:46

            I'm trying to read just the metadata of my TDMS files but my code reads the whole file. Does someone has experience with this? Thank you.

            This is my current code:

            ...

            ANSWER

            Answered 2020-Jun-23 at 09:56

            As explained in the documentation, you can read the metadata directly using nptdms.TdmsFile.read_metadata

            Source https://stackoverflow.com/questions/62530812

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install tdms

            You can download it from GitHub.
            On a UNIX-like operating system, using your system’s package manager is easiest. However, the packaged Ruby version may not be the newest one. There is also an installer for Windows. Managers help you to switch between multiple Ruby versions on your system. Installers can be used to install a specific or multiple Ruby versions. Please refer ruby-lang.org for more information.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/mnaberez/tdms.git

          • CLI

            gh repo clone mnaberez/tdms

          • sshUrl

            git@github.com:mnaberez/tdms.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link