Skip to content

Instantly share code, notes, and snippets.

@pushkarsingh019
Created January 6, 2026 05:27
Show Gist options
  • Select an option

  • Save pushkarsingh019/963e6e0574b809a584fa9419ea0c1ff5 to your computer and use it in GitHub Desktop.

Select an option

Save pushkarsingh019/963e6e0574b809a584fa9419ea0c1ff5 to your computer and use it in GitHub Desktop.
inpts = loadmat(f'/Users/pushkar_nairlab/Documents/01_Nair_Lab/data/Pushkar_HL_0022-LR_2025_07_10_red/index{trial_index_to_investigate}_integration_features.mat', squeeze_me = True)['M']
# Define the features you want to include
feature_names = [
'angular_speed', 'angular_speed_opponent_0',
'angular_speed_opponent_1', 'angular_speed_opponent_2',
'cumulative_dist_opponent_0', 'cumulative_dist_opponent_1',
'cumulative_dist_opponent_2', 'cumulative_distance_travelled',
'distance_from_center', 'distance_from_center_opponent_0',
'distance_from_center_opponent_1',
'distance_from_center_opponent_2', 'distance_to_nearest_port',
'distance_to_opponent_0', 'distance_to_opponent_1',
'distance_to_opponent_2', 'forward_acceleration',
'forward_acceleration_opponent_0',
'forward_acceleration_opponent_1',
'forward_acceleration_opponent_2', 'forward_speed',
'forward_speed_opponent_0', 'forward_speed_opponent_1',
'forward_speed_opponent_2', 'heading_to_closest_facing_port',
'heading_to_opponent_0', 'heading_to_opponent_1',
'heading_to_opponent_2','opponent_visible_0', 'opponent_visible_1',
'opponent_visible_2'
]
# Load all feature names from the .mat file
all_feature_names = loadmat(f'/Users/pushkar_nairlab/Documents/01_Nair_Lab/data/Pushkar_HL_0022-LR_2025_07_10_red/index{trial_index_to_investigate}_integration_features.mat', squeeze_me = True)['fns']
# Find indices of the desired features
feature_indices = [list(all_feature_names).index(fn) for fn in feature_names]
# Select only the specified features
inpts = inpts[:, feature_indices]
inpts.shape
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment