Code Monkey home page Code Monkey logo

lecroyparser's People

Contributors

bennomeier avatar fiorotto8 avatar jeroenvo avatar thormund-nus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

lecroyparser's Issues

Pickling error

Hi, @bennomeier
I use your library to process pulsed oscillograms, so I need to use baseline correction. It is a slow operation, so I tried to save processing results of many files (up to 5000) to reusing it later, but pickle can not dump them because of ScopeData.file is a file handle and can not be pickled.
So, I must do

delattr(scopedata, " file")

before saving.
Can you fix it in your library?
I think, this can be helpful in the future.

read raw input

Next to reading files, it would be nice to send raw binary data directly to the script. This can easily be done by splitting the function for parsing from the file reading.
My use case is a waveform retrieved using VXI11 with https://github.com/python-ivi/python-vxi11
What i did now is:

a=scope.ask_raw(str('C1:WF?').encode('utf-8'))
with open('test.bin', 'wb') as f:
    f.write(a)
    f.flush()
d=lecroyparser.ScopeData('test.bin')

But i'd like to skip the file writing/reading.

data.x is a vector and data.y is a matrix

this code can be improved having the same shape for data.x and data.y.
If I have to plot I have to refer the 2 vector differently

    import matplotlib as mpl
    import matplotlib.pyplot as plt

    import scipy.signal as sig
    
    path = "./C2Trace00020.trc"
    data = ScopeData(path, parseAll = True)
    print(data)
    x_plot = sig.decimate(data.x, 1000, n=None, ftype='fir', axis=-1, zero_phase=True)
    y_plot = sig.decimate(data.y, 1000, n=None, ftype='fir', axis=-1, zero_phase=True)
    plt.plot(x_plot)
    plt.plot(y_plot[0,:])
    plt.show()    

decode("ascii",'replace')

Hello

Is it possible to improve the LeCroy parser so it can also load the following attached LeCroyFiles?
I tested you LeCroy Parser in python Jupyter it works for the first attached file C1pfn00087.trc

When I test it with the second file it throws an error.
What do you think, to add the following: .decode with a property ‘ignore’ if the decode finds Bytes with decode error it ignores it?

#convert the first 50 bytes to a string to find position of substring WAVEDESC
    self.posWAVEDESC = fileContent[:50].decode("ascii",'ignore').index("WAVEDESC")

The ignore was incorrect to solve the problem, and did generate a shift of 1

Now the Code works the next error seems to be
self.verticalCoupling = verticalCouplingList[self.parseInt16(326)]

I attached the three LeCroy Files i did use for testing.
It would be great to improve you Code so we can load many different LeCroy Files.

The .trc was a LeCroy 44MX
The STA.
are from a older LeCroy 9374TM scope.

LeCroy.zip

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.