mooonpy.fitting.dihedral module
Dihedral angle distribution analysis and fitting tools Cite PBZ paper by Tristan Muzzy
- class mooonpy.fitting.dihedral.DihedralDist(phi_angles, bin_scale=10, name=None, function=<function multi_symmetric_gaussian>, ic=None, limits=None, density=False)[source]
Bases:
CurveFitFit and analyze the dihedral angle distributions with histograms and probability density functions. using fit_model curve fits histogram bins using fit_mle uses MLE (recommended/default)
- Parameters:
x – 1D array
y – 1D array
name – str
model – lmfit.models.Model (or None)
- default_fit_kws = {'max_nfev': 5000, 'method': 'powell'}
- default_limits = {'mu': (0, 180), 'sigma': (5, 90)}
- fit_mle()[source]
Fit using Maximum Likelihood Estimation on raw angle data Returns fitted parameters in the same format as fit_model() Note: lmfit.minimize doesn’t support expr constraints, so we normalize in post-processing
- guess_ic(guess=None)[source]
Basic guessing function. could make smart with peak detection or BIC but this is good enough for now Guess may be int 1-3 for number of peaks to use a default, or a dict of custom ICs
- mooonpy.fitting.dihedral.multi_symmetric_gaussian(x, **params)[source]
Sum of multiple symmetric Gaussian’s with periodicity
- mooonpy.fitting.dihedral.multi_symmetric_von_mises(x, **params)[source]
Sum of multiple symmetric von Mises
- mooonpy.fitting.dihedral.symmetric_gaussian_periodic(x, center, sigma, amplitude, rad=False)[source]
Symmetric Gaussian with proper periodicity handling. Creates Gaussian’s at ±center and their first periodic images for bleed-through. https://en.wikipedia.org/wiki/Wrapped_normal_distribution