Physiology (.physio)#

Contains functions to analyse spirometer data, including Wasserman plots, anaerobic thresholds and aerobic thresholds.

worklab.physio.aerobic_threshold(data_spiro, power, start_spiro, muser)[source]#
Shows four plots to determine the aerobic ventilatory threshold from the maximal exercise test

Plot 1: HR vs VO2 Plot 2: time vs VE/VO2 and time vs VE/VCO2 Plot 3: time vs RER Plot 4: time vs PETO2 and time vs PETCO2

Parameters
  • data_spiro (pd.DataFrame) – dataframe containing spirometer data

  • power (pd.DataFrame) – dataframe containing the mean power output per step, showed as a continuous signal (see power_per_min)

  • start_spiro (float) – start of maximal exercise test on spirometer

  • muser (float) – mass user (kg)

Returns

  • fig (matplotlib.figure.Figure) – plots to determine vt1

  • vt1 (pd.DataFrame) – main outcomes at vt1

worklab.physio.anaerobic_threshold(data_spiro, power, start_spiro, muser)[source]#
Shows four plots to determine the anaerobic ventilatory threshold from the maximal exercise test

Plot 1: time vs VE Plot 2: time vs VE/VO2 and time vs VE/VCO2 Plot 3: time vs RER Plot 4: time vs PETO2 and time vs PETCO2

Parameters
  • data_spiro (pd.DataFrame) – dataframe containing spirometer data

  • power (pd.DataFrame) – dataframe containing the mean power output per step, showed as a continuous signal (see power_per_min)

  • start_spiro (float) – start of maximal exercise test on spirometer

  • muser (float) – mass user (kg)

Returns

  • fig (matplotlib.figure.Figure) – plots to determine vt2

  • vt1 (pd.DataFrame) – main outcomes at vt2

worklab.physio.calc_weighted_average(dataframe, weights)[source]#

Calculate the weighted average of all columns in a DataFrame.

Parameters
  • dataframe (pd.DataFrame) – input dataframe

  • weights (pd.Series, np.array) – can be any iterable of equal length

Returns

averages – the weighted averages of each column

Return type

pd.Series

worklab.physio.cut_spiro(data_spiro, start, end)[source]#

Cuts data to time of interest

Parameters
  • data_spiro (pd.dataframe) – spirometer data

  • start (float) – start time [s]

  • end (float) – end time [s]

Returns

data_spiro – data cutted to time of interest

Return type

dataframe

worklab.physio.wasserman(data_spiro, power, title=None)[source]#

Makes the 9 wasserman plot from a graded exercise test Plot 1: Ventilation & power vs time Plot 2: Heart rate & VO2/HR vs time Plot 3: VO2 & VCO2 vs time Plot 4: VE vs VCO2 Plot 5: HR & VCO2 vs VO2 Plot 6: VE/VO2 & VE/VCO2 against time Plot 7: VT (teugvolume) vs VE Plot 8: RER vs time Plot 9: PetO2 & PetCO2 vs time

Parameters
  • data_spiro (pd.DataFrame) – spirometer data

  • power (pd.DataFrame) – a dataframe containing the mean power output per step, showed as a continuous signal (use function: power_per_min)

  • title (str, optional) – title of the plot. The default is None.

Returns

  • fig (matplotlib.figure.Figure) – 9 wasserman plots

  • result_gxt (pd.DataFrame) – most important outcomes of the maximal exercise test