nmrglue.process.proc_autophase.manual_ps

nmrglue.process.proc_autophase.manual_ps(data, notebook=False)[source]

Manual Phase correction using matplotlib

A matplotlib widget is used to manually correct the phase of a Fourier transformed dataset. If the dataset has more than 1 dimensions, the first trace will be picked up for phase correction. Clicking the ‘Set Phase’ button will print the current linear phase parameters to the console. A ipywidget is provided for use with Jupyter Notebook to avoid changing backends. This can be accessed with notebook=True option in this function

Note

Needs matplotlib with an interactive backend.

Parameters
datandarray

Array of NMR data.

notebookBool

True for plotting interactively in Jupyter Notebook Uses ipywidgets instead of matplotlib widgets

Returns
p0, p1float

Linear phase correction parameters. Zero and first order phase corrections in degrees calculated from pc0, pc1 and pivot displayed in the interactive window.

Examples

>>> import nmrglue as ng
>>> p0, p1 = ng.process.proc_autophase.manual_ps(data)
>>> # do manual phase correction and close window
>>> phased_data = ng.proc_base.ps(data, p0=p0, p1=p1)

If you are using a Jupyter Notebook:

In  [1] ng.process.proc_autophase.manual_ps(data)
Out [1] # do manual phase correction. p0 and p1 values will be updated
        # continuously as you do so and are printed below the plot
In  [2] phased_data = ng.proc_base.ps(data, p0=p0, p1=p1)