replay_trajectory_classification.environments#

Classes for constructing discrete grids representations of spatial environments in 1D and 2D

Functions

diffuse

Calculates diffusion for a single time step given a track.

diffuse_each_bin

For each position bin in the grid, diffuse by std.

extract_bin_info_from_track_graph

For each node, find edge_id, is_bin_edge, x_position, y_position, and linear_position.

get_bin_ind

Figure out which bin a given sample falls into.

get_grid

Gets the spatial grid of bins.

get_n_bins

Get number of bins need to span a range given a bin size.

get_track_boundary

Determines the boundary of the valid interior track bins.

get_track_boundary_points

get_track_grid

Figures out 1D spatial bins given a track graph.

get_track_interior

Infers the interior bins of the track given positions.

get_track_segments_from_graph

Returns a 2D array of node positions corresponding to each edge.

make_track_graph_with_bin_centers_edges

Insert the bin center and bin edge positions as nodes in the track graph.

order_boundary

Given boundary bin centers, orders them in a way to make a continuous line.

project_points_to_segment

Finds the closet point on a track segment in terms of Euclidean distance

run_diffusion

Calculates diffusion of a single point over time up until it matches a Gaussian with standard deviation std.

Classes

Environment

Represent the spatial environment with a discrete grid.