1. Reference

The pysampler package contains the following features:


pysampler.generate.sampler(distribution, x_min, x_max, resolution=100, size=None, scale=1.0)[source]

Distribution sampler. This function sample from any given probability distribution [1].

Parameters
  • distribution (float or int) – Probability distribution function to sample from.

  • x_min (array_like) – Lower and upper bounds for the random variable x.

  • x_max (array_like) – Lower and upper bounds for the random variable x.

  • resolution (int) – Resolution of the inverse transform sampling spline. Default is 100.

  • size (int, optional) – Output shape of samples. If size is None and scale is a scalar, a single sample is returned. If size is None and scale is an array, an array of samples is returned with the same shape as scale.

  • scale (array-like, optional) – Scale factor for the returned samples. Default is 1.

Returns

x_sample – Samples drawn from the Black Body spectrum.

Return type

array_like

References

1

Statistics notes.

pysampler.generate.statistics(realisations, nbins)[source]

Data from the Black Body distribution. This function returns the average number counts and standard deviation from different realisations sampled from the same distribution.

Parameters
  • realisations (list) – List of samples.

  • nbins (int) – Number of bins.

Returns

  • average ((nbins,) array_like) – Average sample.

  • bin_center ((nbins,) array_like) – Centers of the bins.

  • average_counts ((nbins,) array_like) – Average number counts at the bin centers.

  • std ((nbins,) array_like) – Standard deviation at the bin centers.

References

1

Averaging over realisations.