qspec logo qspec logo

A physics toolbox for laser spectroscopy.

Static Badge Static Badge Static Badge

Static Badge Static Badge

© 2026 Patrick Müller. All rights reserved.

qspec. estimate_skewnorm  (  med ,  per_0 ,  per_1  )[source]

Estimate the parameters of a skew normal distribution from its median and 1-sigma percentiles.

Parameters:
medscalar

The median (0.5-percentile) of a random variable.

per_0scalar

The left-sided 1-sigma percentile (~0.1587-percentile) relative to med.

per_1scalar

The right-sided 1-sigma percentile (~0.8413-percentile) relative to med.

Returns:
poptndarray | None

The estimated parameters (a, loc, scale) of scipy.stats.skewnorm that match the given percentiles, or None if per_0 or per_1 is 0.

Raises:
ValueError

If the ratio between the left-(right-) and right-(left-)sided uncertainty exceeds 1.5.