Protomix.internal_referencingΒΆ

internal_referencing(spectra_df: DataFrame, ppm_min: float = -0.2, ppm_max: float = 0.2) DataFrame[source]

Reference a DataFrame of NMR spectra by shifting the spectrum values to align the TSP peak to 0 ppm.

This function adjusts the chemical shift values in the provided NMR spectra so that the TSP (trimethylsilyl propionate) peak is set to 0 ppm. The adjustment is performed within a specified ppm range.

Parameters:
  • spectra_df (pd.DataFrame) – A DataFrame where each row represents a complex NMR spectrum, and columns correspond to ppm (parts per million) values.

  • ppm_min (float, optional) – The minimum ppm value for the search range to locate the TSP peak. Default is -0.2.

  • ppm_max (float, optional) – The maximum ppm value for the search range to locate the TSP peak. Default is 0.2.

Returns:

A DataFrame with spectra shifted so that the TSP peak is aligned at 0 ppm, with the original ppm values as column names.

Return type:

pd.DataFrame