Phase Correction

class nmrPype.fn.PS.PhaseCorrection(ps_p0: float = 0, ps_p1: float = 0, ps_inv: bool = False, ps_hdr: bool = False, ps_noup: bool = False, ps_df: bool = False, ps_ht: bool = False, ps_zf: bool = False, mp_enable: bool = False, mp_proc: int = 0, mp_threads: int = 0)

Data Function object for performing a Phase Correction on the data.

Parameters:
  • ps_p0 (float) – Zero-order phase value in degrees

  • ps_p1 (float) – First-order phase value in degrees

  • ps_inv (bool) – Perform an inverse phase correction on the data

  • ps_hdr (bool) – Use constant values from the header

  • ps_noup (bool) – Don’t update the header with the used constants

  • ps_df (bool) – Adjust the p1 value for digital oversampling

  • ps_ht (bool) – Reconstruct Imaginaries via Hilbert Transform

  • ps_zf (bool) – Use Temporary Zero Fill for the Hilbert Transform.

  • mp_enable (bool) – Enable multiprocessing

  • mp_proc (int) – Number of processors to utilize for multiprocessing

  • mp_threads (int) – Number of threads to utilize per process

static clArgs(subparser, parent_parser)

Adds Phase Correction parser to the subparser, with its corresponding default args Called by nmrPype.parse.parser().

Parameters:

subparser (_SubParsersAction[ArgumentParser]) – Subparser object that will receive function and its arguments

initialize(data: DataFrame)

fn initialize

Initialization follows the following steps:
  • Handle function specific arguments

  • Update any header values before any calculations occur that are independent of the data, such as flags and parameter storage

Parameters:

data (DataFrame) – target data to manipulate

parallelize(array: ndarray, verb: tuple[int, str] = (16, 'H')) ndarray

Multiprocessing implementation for function to properly optimize for hardware

Parameters:
  • array (ndarray) – Target data array to process with function

  • ndQuad (int) – NDQUADFLAG header value

  • verb (tuple[int,int,str], optional)

  • print (Tuple containing elements for verbose) –

    • Verbosity level

    • Verbosity Increment

    • Direct Dimension Label

  • (0 (by default) –

    • Verbosity level

    • Verbosity Increment

    • Direct Dimension Label

  • 16

    • Verbosity level

    • Verbosity Increment

    • Direct Dimension Label

  • 'H')

    • Verbosity level

    • Verbosity Increment

    • Direct Dimension Label

Returns:

new_array – Updated array after function operation

Return type:

ndarray

phaseCorrect(array: ndarray) ndarray

Phase correction helper function for multiprocessing

Parameters:

array (ndarray) – Target data array to phase correct

Returns:

new_array – Updated array after function operation

Return type:

ndarray

process(array: ndarray, verb: tuple[int, int, str] = (0, 16, 'H')) ndarray

See nmrPype.fn.function.DataFunction.process() for documentation

updateHeader(data: DataFrame)

Update the header following the main function’s calculations. Typically this includes header fields that relate to data size.

Parameters:

data (DataFrame) – Target data frame containing header to update