irradiapy.utils.math

This module contains math utilities for the irradiapy package.

Functions

apply_boundary_conditions(data_atoms, x, y, z)

Apply boundary conditions to atoms.

fit_gaussian(xs, ys[, p0, asymmetry])

Fit data to a Gaussian function.

fit_linear(xs, ys[, yerrs])

Fit a linear function to the given data: y = a * x + b.

fit_lorentzian(xs, ys[, p0, asymmetry])

Fit data to a Lorentzian function.

fit_power_law(xs, ys[, yerrs])

Fit a power law to the given histogram data: y = a * x**k.

gaussian(xs, x_peak, linewidth, amplitude, ...)

Evaluate a Gaussian function.

linear(x, a, b)

Evaluate a linear function: y = a * x + b.

lorentzian(xs, x_peak, linewidth, amplitude, ...)

Evaluate a Lorentzian function.

power_law(x, a, k)

Evaluate a power law: y = a * x**k

recombine_in_radius(data_defects, radius)

Recombine defects (interstitials and vacancies) within a given radius.

repeated_prime_factors(n)

Return the prime factors of n (with repetition).