Added some cmap functions.

Selected species-specific  colors.
Quite some progress on fig_invariance_thresh_lp_species.pdf.
This commit is contained in:
j-hartling
2026-03-26 17:26:30 +01:00
parent 1a29b95782
commit 92ee4eda6f
11 changed files with 737 additions and 132 deletions

View File

@@ -8,14 +8,14 @@ from thunderhopper.model import convolve_kernels
from IPython import embed
# GENERAL SETTINGS:
target = ['Omocestus_rufipes', '*'][0]
data_paths = search_files(target, dir='../data/processed/')
target = ['Omocestus_rufipes', '*'][1]
data_paths = search_files(target, excl='noise', dir='../data/processed/')
noise_path = '../data/processed/white_noise_sd-1.npz'
save_path = '../data/inv/thresh_lp/'
# ANALYSIS SETTINGS:
add_noise = True
save_snippets = add_noise and True
save_snippets = add_noise and (target == 'Omocestus_rufipes')
plot_results = False
example_scales = np.array([0, 1, 10, 30, 100])
scales = np.geomspace(0.01, 10000, 100)
@@ -50,11 +50,11 @@ for data_path, name in zip(data_paths, crop_paths(data_paths)):
config['k_specs'] = config['k_specs'][kern_inds, :]
config['k_props'] = [config['k_props'][i] for i in kern_inds]
# Normalize song component:
song /= song[segment].std()
# Get normalized noise component:
noise = pure_noise[:song.shape[0]]
# Normalize both components:
song /= song[segment].std()
noise /= noise[segment].std()
# Define kernel-specific threshold values based on pure-noise response SD: