nmrglue.process.proc_autophase.autops

nmrglue.process.proc_autophase.autops(data, fn, p0=0.0, p1=0.0, return_phases=False, peak_width=100, **kwargs)[source]

Automatic linear phase correction

Parameters
datandarray

Array of NMR data.

fnstr or function

Algorithm to use for phase scoring. Built in functions can be specified by one of the following strings: “acme”, “peak_minima”

p0float

Initial zero order phase in degrees.

p1float

Initial first order phase in degrees.

peak_widthint

Width of the ROI for peak_minima optimization (number of surrounding indexes)

return_phasesBool

returns a list of optimized values of phases [p0, p1] in addition to the phased data

kwargsadditional key-word arguments to be passed to the solver

The are documented at the following link: https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.fmin.html Some of the more useful ones for this use case:

  • dispBool

    Turns on or off the printing of convergence messeges By default, this is set to True.

  • ftolfloat

    Absolute error in fn between iterations that is acceptable for convergence. The default is 1e-4.

Returns
ndatandarray

Phased NMR data.