Base module#

Vectors#

Vector(x, y, z)

Class representing a single vector.

VectorArray(vectors)

Class representing an array of vectors.

asvector(input)

Convert Vector-like input to a Vector.

asvectorarray(input)

Convert VectorArray-like input to a VectorArray.

Coordinate Systems#

CoordinateSystem(vector_1, vector_2[, vector_3])

Class representing a single coordinate system.

CoordinateSystemArray(vectors_1, vectors_2)

Class representing a collection of coordinate systems.

Data#

DataXY(x, y[, title, xlabel, ylabel])

A class representing xy-data.

Histograms#

Hist1d(values, edges[, title, xlabel, ylabel])

A histogram class providing basic histogram methods.

Hist2d(values, xedges, yedges[, title, ...])

A histogram class providing basic 2D-histogram methods.

Miscellaenous#

get_all_dividers(n)

Find all dividers of n.

centers_to_edges(centers[, lower, upper])

Work out bin edges from bin centers.

edges_to_centers(edges)

Calculate centers from edges.

convert_cosine_to_angles(cos_angles, y_data)

Convert data given as a cosine to radians.

for_pcolormesh_from_txt(fname, *[, ...])

Load 2D data from a text file such that it can be plotted with matplotlib.pyplot.pcolormesh().

for_pcolormesh_from_root(fname, hname)

Load data from a ROOT file to plot it with matplotlib.pyplot.pcolormesh().

sample_distribution(edges, values, size)

Sample a distribution described by edges and values.

sample_distribution_func(f, size, xlimits, ...)

Sample a distribution described by f.

sample_distribution_discrete(values, ...)

Sample a discrete distribution of values, where the probability is given by probabilities.

gauss(x[, scale, mu, sigma])

Gaussian function.

crop(x, y[, lower, upper])

Return x,y data where lower <= x < upper.