Giter Site home page Giter Site logo

nmr-inte-great's Introduction

nmr-inte-great

Tkinter GUI that performs trapezoidal sum on Nuclear Magnetic Resonance peak list data (ASC) to get the area between a given range. This is a personal project created to learn more about tkinter.

Purpose:

This program parses the chemical shift and real intensity values of NMR data (.asc format) into two separate lists. It then calculates the integral on the desired interval based on the trapezoidal sum.

Data Format and Parsing: Each line of data is formatted as the following: "chemicalShift\trealValue\timaginaryValue\n". I split each line of data into a list based on the \t separator. Therefore, an individual instance of this line list may look like the following: ["12.31", "0.008", "-0.007\n"]. I have the program start making the chemical shift and peak list when the first chemical shift within the specified bounds is encountered. For example, the program begins to construct the alkenyl chemical shift and peak list when the chemical shift is 5.9 ppm and then it stops constructing this list when the chemical shift is less than 5.4 ppm. It then constructs the ferrocene chemical shift and peak list in the same way.

Mathematics: After parsing the data and creating the appropriate lists the trapezoidal sum formula is used. Tn = Δx/2 [f(x0)+ 2f(x1) + 2f(x2) + ... + 2f(xn−1) +f(xn)]. Delta x is the average of delta x over all x values within the specified interval. I constructed a list of delta x's as follows: [x0 - x1, x1 - x2, (xn - 1) - xn] then summed that list and took the average to define delta x in the formula Tn. The sum from 2f(x1) + 2f(x2) + ... + 2f(xn−1) is calculated independently and then plugged into the trapezoidal sum formula.

Considerations:

  • How to organize toplevel widgets e.g. self.analysis_window in MainWindow and self.plot_options_window in AnalysisWindow Possibly rename to toplevel1, toplevel2 etc.
  • The organization for this is just not good at this point too many method calls to keep track of things. What would be a good way to organize this? Draw diagrams and see how information is shared
  • May be worth splitting all classes into separate files for readability purposes. Currently it's quite a lot of scrolling to navigate.... unsure on this one.
  • Display whole plot might be useful. A scroll wheel for determining integration range would be nice.

Documentation:

Tkinter:

Matplotlib

Questions:

On class structure

Get temp matplotlib figure:

kwargs and class:

tkinter frames:

git:

misc gui:

misc:

nmr-inte-great's People

Contributors

jfdev001 avatar

Watchers

 avatar

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.