openpathsampling.analysis.PathHistogram

class openpathsampling.analysis.PathHistogram(left_bin_edges, bin_widths, interpolate=True, per_traj=True)[source]

N-dim sparse histogram for trajectories.

This allows features like interpolating between bins and normalizing the histogram to the number of trajectories.

Parameters:
  • left_bin_edges (array-like) – lesser side of the bin (for each direction)

  • bin_widths (array-like) – bin (voxel) size

  • interpolate (bool or callable) – how to interpolate missing bin visits. Default True gives “subdivide” method, False gives no interpolation. Arbitrary callable should take old_pt and new_pt, and return the list of bins that were visited, excluding the bin for old_pt.

  • per_traj (bool) – whether to normalize per trajectory (instead of per-snapshot)

__init__(left_bin_edges, bin_widths, interpolate=True, per_traj=True)[source]

Methods

__init__(left_bin_edges, bin_widths[, ...])

add_data_to_histogram(trajectories[, weights])

Adds data to the internal histogram counter.

add_trajectory(trajectory[, weight])

Add a single trajectory to internal counter, with given weight

compare_parameters(other)

Test whether the other histogram has the same parameters.

empty_copy()

Returns a new histogram with the same bin shape, but empty

histogram([data, weights])

Build the histogram.

map_to_bins(data)

map_to_float_bins(trajectory)

normalized([raw_probability, bin_edge])

Callable normalized version of the sparse histogram.

single_trajectory_counter(trajectory)

Calculate the counter (local histogram) for an unweighted trajectory

sum_histograms(hists)

xvals(bin_edge_type)

Position values for the bin

Attributes

progress