df = pd.read_csv("../data/mmpcurve.csv")
pdc = PDC(df['Secs'], df['Watts'])PDC-Utils
Utilities to manage power duration curves
Fitting algorithm for running or cycling power data with support for Garmin FIT files
Install
pip install PDC_UtilsHow to use
Uses a MMP curve based on best power efforts. You can load data from CSV files or directly from Garmin FIT files.
Using CSV data
An example of CSV input is in the data directory:
result = pdc.fit()
result.best_values['ftp']247.97104270072407
Using FIT files
You can also load data directly from Garmin FIT files:
# Load a FIT file and create a PDC object
pdc_from_fit_file = pdc_from_fit('path/to/your/activity.fit')
# Or create an MMP object
mmp_from_fit_file = mmp_from_fit('path/to/your/activity.fit')
# You can also work with the raw FIT data
fit_loader = load_fit_file('path/to/your/activity.fit')
power_data = fit_loader.extract_power_data()
durations, mmp_powers = fit_loader.compute_mmp_curve()