Added multi-thresh simulation to "full" and "short" (currently running).

Added complete "rect-lp" analysis except figure.
Added multiple appendix figs.
Overhauled normalization options across all condense scripts.

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
j-hartling
2026-04-24 16:50:14 +02:00
parent 1a586848e8
commit 5411a309f7
48 changed files with 1549 additions and 300 deletions

View File

@@ -0,0 +1,42 @@
import numpy as np
from thunderhopper.filetools import search_files
from thunderhopper.model import process_signal
from thunderhopper.modeltools import load_data
from IPython import embed
## SETTINGS:
# General:
stages = ['raw', 'filt', 'env', 'log', 'inv', 'conv', 'feat']
noise_path = search_files('merged_noise', dir='../data/field/processed/noise/')[0]
save_path = '../data/inv/field/ref_measures.npz'
channels = np.array([0, 1, 2, 3, 4, 5, 6, 7])
# PROCESSING:
# Load pure-noise starter representation:
noise_data, config = load_data(noise_path, stages[0])
# Accumulate channels in time-major order:
starter = noise_data[stages[0]][:, channels].ravel(order='F')
# Get song segment to be analyzed:
time = np.arange(starter.shape[0]) / config['rate']
start, end = noise_data['songs_0'].ravel()
segment = (time >= start) & (time <= end)
# Run pipeline:
data = process_signal(config, stages, signal=starter, rate=config['rate'])[0]
# Get measures:
measures = {}
for stage in stages:
if stage == 'feat':
measures[stage] = data[stage][segment, :].mean(axis=0)
else:
measures[stage] = data[stage][segment, ...].std(axis=0)
# Save results:
np.savez(save_path, **measures)
print('Done.')
embed()