osl_dynamics.utils.topoplots
#
Classes and functions to make topoplots.
Module Contents#
Classes#
Topology class. |
Functions#
|
|
|
- class osl_dynamics.utils.topoplots.Topology(layout)[source]#
Topology class.
- Parameters:
layout (str) – Path to layout file.
- read_lay(filename)[source]#
Read .lay topology files
Every line in a .lay file represents a sensor. The data is delimited by whitespace. The columns are: channel ID, X, Y, width, height, name.
- Parameters:
filename (str) – The location of a .lout file
- keep_channels(channel_names)[source]#
Remove channels which aren’t present in channel_names
Remove any channels which don’t correspond to on in the names provided. This is probably a strong case for using Pandas for data storage.
- Parameters:
channel_names (list of str) – A list of channel names which are present in the data. All others are removed.
- plot_data(data, plot_boxes=False, show_names=False, title=None, show_deleted_sensors=False, colorbar=True, axis=None, cmap='plasma', n_contours=10)[source]#
Interpolate the data in sensor-space and plot it.
Given a data vector which corresponds to each sensor in the topology, resample the data by interpolating over a grid. Use this data to create a contour plot. Also display the sensor locations and head shape.
- Parameters:
data (numpy.array or list) – A vector with data corresponding to each sensor.
plot_boxes (bool, optional) – Plot boxes to display the height and width of sensors, rather than just the centers.
show_names (bool, optional) – Display channel names.
title (str, optional) – Title for plot.
show_deleted_sensors (bool, optional) – Plot the sensors which have been deleted, in red.
colorbar (bool, optional) – Display colorbar
axis (matplotlib.pyplot.Axes, optional) – matplotlib axis to plot on.
cmap (str, optional) – Colourmap to use in plot. Defaults to matplotlib’s plasma.
n_contours (int, optional) – Number of contours to use in plot.
- Returns:
fig – Figure.
- Return type:
matplotlib.figure