Giter Site home page Giter Site logo

Comments (3)

kaustubhmote avatar kaustubhmote commented on August 17, 2024

@ndbryant21 do you want to only plot the processed data, or process it from scratch and then plot it?

from nmrglue.

ndbryant21 avatar ndbryant21 commented on August 17, 2024

@kaustubhmote For now I would like to plot the processed data. Though I have been generating a few hundred 2D spectra per year and would eventually like to process from scratch.

from nmrglue.

kaustubhmote avatar kaustubhmote commented on August 17, 2024

This should work:

# read data
dic, data = ng.bruker.read_pdata("datafolder/1/pdata/1")

# read in axis ppm parameters
udic = ng.bruker.guess_udic(dic, data, strip_fake=True)
uc = {i: ng.fileiobase.uc_from_udic(udic, dim=i) for i in (0, 1)}
axis_limits = [*uc[1].ppm_limits(), *uc[0].ppm_limits()]

# contour levels
levels = [data.max() / 20 * 1.4**i for i in range(10)]  # change as needed

# plot
fig, ax = plt.subplots()
ax.contour(
    data.real, 
    levels=levels, 
    extent=axis_limits, 
    cmap=plt.cm.Greys_r, # change as per your preference 
    linewidths=0.5, # change as per your preference
)

ax.set_xlim(11.5, 6)  # change as needed
ax.set_ylim(135, 105)  # change as needed

plt.show()

I will not recommend processing multidimensional data with nmrglue if you need to apply linear prediction to the indirect dimensions as nmrglue's linear prediction functions are not very well tested. It would be better process it in nmrpipe or some other software and then use nmrglue to convert the data to numpy arrays for plotting.

from nmrglue.

Related Issues (20)

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.