Skip to content

Commit

Permalink
Merge e4a192d into 2c1ca56
Browse files Browse the repository at this point in the history
  • Loading branch information
janscience authored Nov 11, 2018
2 parents 2c1ca56 + e4a192d commit d53f3a5
Show file tree
Hide file tree
Showing 8 changed files with 996 additions and 349 deletions.
17 changes: 17 additions & 0 deletions tests/test_eodanalysis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from nose.tools import assert_true, assert_equal, assert_almost_equal
import numpy as np
import thunderfish.fakefish as ff
import thunderfish.eodanalysis as ea


def test_pulsefish():
samplerate = 44100.0
data = ff.generate_biphasic_pulses(200.0, samplerate, 5.0, noise_std=0.02)
mean_eod, eod_times = ea.eod_waveform(data, samplerate)
mean_eod, props, peaks, power, intervals = ea.analyze_pulse(mean_eod, eod_times)

def test_wavefish():
samplerate = 44100.0
data = ff.generate_alepto(800.0, samplerate, duration=10.0, noise_std=0.01)
mean_eod, eod_times = ea.eod_waveform(data, samplerate)
mean_eod, props, power = ea.analyze_wave(mean_eod, 800.0)
395 changes: 262 additions & 133 deletions thunderfish/bestwindow.py

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions thunderfish/checkpulse.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
pass


def check_pulse_width(data, samplerate, th_factor=2.0, percentile=25.0,
def check_pulse_width(data, samplerate, th_factor=0.8, percentile=1.0,
pulse_thresh=0.1, verbose=0, plot_data_func=None, **kwargs):
"""Detects if a fish is pulse- or wave-type based on the proportion of the time distance
between a peak and its following trough, relative to the time between consecutive peaks.
Expand Down Expand Up @@ -339,7 +339,7 @@ def plot_psd_proportion(freqs, power, proportions, percentiles, pulse_fish,
ax.set_ylabel('Power [dB]', fontsize=fs)


def add_check_pulse_width_config(cfg, th_factor=2.0, percentile=25.0, pulse_thresh=0.1):
def add_check_pulse_width_config(cfg, th_factor=0.8, percentile=1.0, pulse_thresh=0.1):
""" Add parameter needed for check_pulse_width() as
a new section to a configuration.
Expand Down
Loading

0 comments on commit d53f3a5

Please sign in to comment.