Sine Bell

class nmrPype.fn.SP.SineBell(sp_off: float = 0.0, sp_end: float = 1.0, sp_pow: float = 1.0, sp_size: int = 0, sp_start: int = 1, sp_c: float = 1, sp_one: bool = False, sp_hdr: bool = False, sp_inv: bool = False, sp_df: bool = False, sp_elb: float = 0.0, sp_glb: float = 0.0, sp_goff: float = 0.0, mp_enable: bool = False, mp_proc: int = 0, mp_threads: int = 0)

Data Function object for performing a Sinusoidal Filter on the data.

Parameters:
  • sp_off (float) – PI value starting offset

  • sp_end (float) – PI value ending offset

  • sp_pow (float) – Sine function exponent

  • sp_size (int) – Span of data to apply sinusoidal filter to

  • sp_start (int) – Starting point of sinusoidal filter window

  • sp_c (float) – Scaling value for the first point of the sinusoidal filter window (e.g. scale first point by 0.5 or 2.0)

  • sp_one (bool) – Set all points outside of sinusoidal filter window to 1 instead of 0

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

  • sp_inv (bool) – Invert the sinusoidal filter window

  • sp_df (bool) – Adjust PI value starting offset and gaussian offset for Digital Oversampling.

  • sp_elb (float) – Add an exponential filter by value in Hz

  • sp_glb (float) – Add a gaussian filter by value in Hz

  • sp_goff (float) – Set gausian offset, within 0 to 1.

  • 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

applyFunc(array: ndarray, a1: float, a2: float, a3: float, fps: int, df: float, verb: tuple[int, int, str] = (0, 16, 'H')) ndarray

Apply sine bell to array

Parameters:
  • array (np.ndarray) – Target array to apply function to

  • a1 (float) – offset value

  • a2 (float) – end value

  • a3 (float) – exponential power value

  • fps (int) – first point scale to apply

  • df (float) – digital filter 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 – Array with sinusoidal filter

Return type:

np.ndarray

static clArgs(subparser, parent_parser)

Adds Sine Bell parser to the subparser, with its corresponding args Called by nmrPype.parse.parser().

Parameters:

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

initialize(data: DataFrame)
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, int, str] = (0, 16, 'H')) ndarray

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

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

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

run(data: DataFrame) int

Sine Bell’s run utilizes the generic function run but saves computation time by skipping the running step for trivial constants.

For example, a power of 0 for the sinusoidal filter will return the data unchanged.

See also

nmrPype.fn.function.DataFunction.run

Default run function

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