fix branches
@ -102,7 +102,7 @@ class ChirpPlotBuffer:
|
|||||||
self.t0 = 0
|
self.t0 = 0
|
||||||
|
|
||||||
fig = plt.figure(
|
fig = plt.figure(
|
||||||
figsize=(14 / 2.54, 20 / 2.54)
|
figsize=(14 * ps.cm, 18 * ps.cm)
|
||||||
)
|
)
|
||||||
|
|
||||||
gs0 = gr.GridSpec(
|
gs0 = gr.GridSpec(
|
||||||
@ -133,8 +133,10 @@ class ChirpPlotBuffer:
|
|||||||
data_oi,
|
data_oi,
|
||||||
self.data.raw_rate,
|
self.data.raw_rate,
|
||||||
self.t0 - 5,
|
self.t0 - 5,
|
||||||
[np.min(self.frequency) - 100, np.max(self.frequency) + 200]
|
[np.min(self.frequency) - 300, np.max(self.frequency) + 300]
|
||||||
)
|
)
|
||||||
|
ax0.set_ylim(np.min(self.frequency) - 100,
|
||||||
|
np.max(self.frequency) + 200)
|
||||||
|
|
||||||
for track_id in self.data.ids:
|
for track_id in self.data.ids:
|
||||||
|
|
||||||
@ -157,27 +159,35 @@ class ChirpPlotBuffer:
|
|||||||
zorder=10, color=ps.gblue1)
|
zorder=10, color=ps.gblue1)
|
||||||
else:
|
else:
|
||||||
ax0.plot(t-self.t0_old, f, lw=lw,
|
ax0.plot(t-self.t0_old, f, lw=lw,
|
||||||
zorder=10, color=ps.gray, alpha=0.5)
|
zorder=10, color=ps.black)
|
||||||
|
|
||||||
ax0.fill_between(
|
# ax0.fill_between(
|
||||||
np.arange(self.t0, self.t0 + self.dt, 1 / self.data.raw_rate),
|
# np.arange(self.t0, self.t0 + self.dt, 1 / self.data.raw_rate),
|
||||||
q50 - self.config.minimal_bandwidth / 2,
|
# q50 - self.config.minimal_bandwidth / 2,
|
||||||
q50 + self.config.minimal_bandwidth / 2,
|
# q50 + self.config.minimal_bandwidth / 2,
|
||||||
color=ps.gblue1,
|
# color=ps.gblue1,
|
||||||
lw=1,
|
# lw=1,
|
||||||
ls="dashed",
|
# ls="dashed",
|
||||||
alpha=0.5,
|
# alpha=0.5,
|
||||||
)
|
# )
|
||||||
|
|
||||||
|
# ax0.fill_between(
|
||||||
|
# np.arange(self.t0, self.t0 + self.dt, 1 / self.data.raw_rate),
|
||||||
|
# search_lower,
|
||||||
|
# search_upper,
|
||||||
|
# color=ps.gblue2,
|
||||||
|
# lw=1,
|
||||||
|
# ls="dashed",
|
||||||
|
# alpha=0.5,
|
||||||
|
# )
|
||||||
|
|
||||||
|
ax0.axhline(q50 - self.config.minimal_bandwidth / 2,
|
||||||
|
color=ps.gblue1, lw=1, ls="dashed")
|
||||||
|
ax0.axhline(q50 + self.config.minimal_bandwidth / 2,
|
||||||
|
color=ps.gblue1, lw=1, ls="dashed")
|
||||||
|
ax0.axhline(search_lower, color=ps.gblue2, lw=1, ls="dashed")
|
||||||
|
ax0.axhline(search_upper, color=ps.gblue2, lw=1, ls="dashed")
|
||||||
|
|
||||||
ax0.fill_between(
|
|
||||||
np.arange(self.t0, self.t0 + self.dt, 1 / self.data.raw_rate),
|
|
||||||
search_lower,
|
|
||||||
search_upper,
|
|
||||||
color=ps.gblue2,
|
|
||||||
lw=1,
|
|
||||||
ls="dashed",
|
|
||||||
alpha=0.5,
|
|
||||||
)
|
|
||||||
# ax0.axhline(q50, spec_times[0], spec_times[-1],
|
# ax0.axhline(q50, spec_times[0], spec_times[-1],
|
||||||
# color=ps.gblue1, lw=2, ls="dashed")
|
# color=ps.gblue1, lw=2, ls="dashed")
|
||||||
# ax0.axhline(q50 + self.search_frequency,
|
# ax0.axhline(q50 + self.search_frequency,
|
||||||
@ -187,7 +197,11 @@ class ChirpPlotBuffer:
|
|||||||
if len(chirps) > 0:
|
if len(chirps) > 0:
|
||||||
for chirp in chirps:
|
for chirp in chirps:
|
||||||
ax0.scatter(
|
ax0.scatter(
|
||||||
chirp, np.median(self.frequency) + 150, c=ps.black, marker="v"
|
chirp, np.median(self.frequency), c=ps.red, marker=".",
|
||||||
|
edgecolors=ps.red,
|
||||||
|
facecolors=ps.red,
|
||||||
|
zorder=10,
|
||||||
|
s=70,
|
||||||
)
|
)
|
||||||
|
|
||||||
# plot waveform of filtered signal
|
# plot waveform of filtered signal
|
||||||
@ -207,25 +221,31 @@ class ChirpPlotBuffer:
|
|||||||
c=ps.gblue3, lw=lw, label="baseline inst. freq.")
|
c=ps.gblue3, lw=lw, label="baseline inst. freq.")
|
||||||
|
|
||||||
# plot filtered and rectified envelope
|
# plot filtered and rectified envelope
|
||||||
ax4.plot(self.time, self.baseline_envelope, c=ps.gblue1, lw=lw)
|
ax4.plot(self.time, self.baseline_envelope *
|
||||||
|
waveform_scaler, c=ps.gblue1, lw=lw)
|
||||||
ax4.scatter(
|
ax4.scatter(
|
||||||
(self.time)[self.baseline_peaks],
|
(self.time)[self.baseline_peaks],
|
||||||
self.baseline_envelope[self.baseline_peaks],
|
(self.baseline_envelope*waveform_scaler)[self.baseline_peaks],
|
||||||
edgecolors=ps.red,
|
edgecolors=ps.red,
|
||||||
|
facecolors=ps.red,
|
||||||
zorder=10,
|
zorder=10,
|
||||||
marker="o",
|
marker=".",
|
||||||
facecolors="none",
|
s=70,
|
||||||
|
# facecolors="none",
|
||||||
)
|
)
|
||||||
|
|
||||||
# plot envelope of search signal
|
# plot envelope of search signal
|
||||||
ax5.plot(self.time, self.search_envelope, c=ps.gblue2, lw=lw)
|
ax5.plot(self.time, self.search_envelope *
|
||||||
|
waveform_scaler, c=ps.gblue2, lw=lw)
|
||||||
ax5.scatter(
|
ax5.scatter(
|
||||||
(self.time)[self.search_peaks],
|
(self.time)[self.search_peaks],
|
||||||
self.search_envelope[self.search_peaks],
|
(self.search_envelope*waveform_scaler)[self.search_peaks],
|
||||||
edgecolors=ps.red,
|
edgecolors=ps.red,
|
||||||
|
facecolors=ps.red,
|
||||||
zorder=10,
|
zorder=10,
|
||||||
marker="o",
|
marker=".",
|
||||||
facecolors="none",
|
s=70,
|
||||||
|
# facecolors="none",
|
||||||
)
|
)
|
||||||
|
|
||||||
# plot filtered instantaneous frequency
|
# plot filtered instantaneous frequency
|
||||||
@ -235,16 +255,20 @@ class ChirpPlotBuffer:
|
|||||||
self.frequency_time[self.frequency_peaks],
|
self.frequency_time[self.frequency_peaks],
|
||||||
self.frequency_filtered[self.frequency_peaks],
|
self.frequency_filtered[self.frequency_peaks],
|
||||||
edgecolors=ps.red,
|
edgecolors=ps.red,
|
||||||
|
facecolors=ps.red,
|
||||||
zorder=10,
|
zorder=10,
|
||||||
marker="o",
|
marker=".",
|
||||||
facecolors="none",
|
s=70,
|
||||||
|
# facecolors="none",
|
||||||
)
|
)
|
||||||
|
|
||||||
ax0.set_ylabel("frequency [Hz]")
|
ax0.set_ylabel("frequency [Hz]")
|
||||||
ax1.set_ylabel("a.u.")
|
ax1.set_ylabel(r"$\mu$V")
|
||||||
ax2.set_ylabel("a.u.")
|
ax2.set_ylabel(r"$\mu$V")
|
||||||
ax3.set_ylabel("Hz")
|
ax3.set_ylabel("Hz")
|
||||||
ax5.set_ylabel("a.u.")
|
ax4.set_ylabel(r"$\mu$V")
|
||||||
|
ax5.set_ylabel(r"$\mu$V")
|
||||||
|
ax6.set_ylabel("Hz")
|
||||||
ax6.set_xlabel("time [s]")
|
ax6.set_xlabel("time [s]")
|
||||||
|
|
||||||
plt.setp(ax0.get_xticklabels(), visible=False)
|
plt.setp(ax0.get_xticklabels(), visible=False)
|
||||||
@ -323,7 +347,7 @@ def plot_spectrogram(
|
|||||||
aspect="auto",
|
aspect="auto",
|
||||||
origin="lower",
|
origin="lower",
|
||||||
interpolation="gaussian",
|
interpolation="gaussian",
|
||||||
alpha=0.6,
|
# alpha=0.6,
|
||||||
)
|
)
|
||||||
# axis.use_sticky_edges = False
|
# axis.use_sticky_edges = False
|
||||||
return spec_times
|
return spec_times
|
||||||
@ -628,7 +652,7 @@ def chirpdetection(datapath: str, plot: str, debug: str = 'false') -> None:
|
|||||||
raw_time = np.arange(data.raw.shape[0]) / data.raw_rate
|
raw_time = np.arange(data.raw.shape[0]) / data.raw_rate
|
||||||
|
|
||||||
# good chirp times for data: 2022-06-02-10_00
|
# good chirp times for data: 2022-06-02-10_00
|
||||||
# window_start_index = (3 * 60 * 60 + 6 * 60 + 43.5 + 5) * data.raw_rate
|
# window_start_index = (3 * 60 * 60 + 6 * 60 + 43.5) * data.raw_rate
|
||||||
# window_duration_index = 60 * data.raw_rate
|
# window_duration_index = 60 * data.raw_rate
|
||||||
|
|
||||||
# t0 = 0
|
# t0 = 0
|
||||||
@ -651,7 +675,7 @@ def chirpdetection(datapath: str, plot: str, debug: str = 'false') -> None:
|
|||||||
multiwindow_chirps = []
|
multiwindow_chirps = []
|
||||||
multiwindow_ids = []
|
multiwindow_ids = []
|
||||||
|
|
||||||
for st, window_start_index in enumerate(window_start_indices):
|
for st, window_start_index in enumerate(window_start_indices[3175:]):
|
||||||
|
|
||||||
logger.info(f"Processing window {st+1} of {len(window_start_indices)}")
|
logger.info(f"Processing window {st+1} of {len(window_start_indices)}")
|
||||||
|
|
||||||
@ -886,25 +910,25 @@ def chirpdetection(datapath: str, plot: str, debug: str = 'false') -> None:
|
|||||||
# normalize all three feature arrays to the same range to make
|
# normalize all three feature arrays to the same range to make
|
||||||
# peak detection simpler
|
# peak detection simpler
|
||||||
|
|
||||||
baseline_envelope = minmaxnorm([baseline_envelope])[0]
|
# baseline_envelope = minmaxnorm([baseline_envelope])[0]
|
||||||
search_envelope = minmaxnorm([search_envelope])[0]
|
# search_envelope = minmaxnorm([search_envelope])[0]
|
||||||
baseline_frequency_filtered = minmaxnorm(
|
# baseline_frequency_filtered = minmaxnorm(
|
||||||
[baseline_frequency_filtered]
|
# [baseline_frequency_filtered]
|
||||||
)[0]
|
# )[0]
|
||||||
|
|
||||||
# PEAK DETECTION ----------------------------------------------
|
# PEAK DETECTION ----------------------------------------------
|
||||||
|
|
||||||
# detect peaks baseline_enelope
|
# detect peaks baseline_enelope
|
||||||
baseline_peak_indices, _ = find_peaks(
|
baseline_peak_indices, _ = find_peaks(
|
||||||
baseline_envelope, prominence=config.prominence
|
baseline_envelope, prominence=config.baseline_prominence
|
||||||
)
|
)
|
||||||
# detect peaks search_envelope
|
# detect peaks search_envelope
|
||||||
search_peak_indices, _ = find_peaks(
|
search_peak_indices, _ = find_peaks(
|
||||||
search_envelope, prominence=config.prominence
|
search_envelope, prominence=config.search_prominence
|
||||||
)
|
)
|
||||||
# detect peaks inst_freq_filtered
|
# detect peaks inst_freq_filtered
|
||||||
frequency_peak_indices, _ = find_peaks(
|
frequency_peak_indices, _ = find_peaks(
|
||||||
baseline_frequency_filtered, prominence=config.prominence
|
baseline_frequency_filtered, prominence=config.frequency_prominence
|
||||||
)
|
)
|
||||||
|
|
||||||
# DETECT CHIRPS IN SEARCH WINDOW ------------------------------
|
# DETECT CHIRPS IN SEARCH WINDOW ------------------------------
|
||||||
@ -1097,4 +1121,4 @@ if __name__ == "__main__":
|
|||||||
datapath = "../data/2022-06-02-10_00/"
|
datapath = "../data/2022-06-02-10_00/"
|
||||||
# datapath = "/home/weygoldt/Data/uni/efishdata/2016-colombia/fishgrid/2016-04-09-22_25/"
|
# datapath = "/home/weygoldt/Data/uni/efishdata/2016-colombia/fishgrid/2016-04-09-22_25/"
|
||||||
# datapath = "/home/weygoldt/Data/uni/chirpdetection/GP2023_chirp_detection/data/mount_data/2020-03-13-10_00/"
|
# datapath = "/home/weygoldt/Data/uni/chirpdetection/GP2023_chirp_detection/data/mount_data/2020-03-13-10_00/"
|
||||||
chirpdetection(datapath, plot="show", debug="fish")
|
chirpdetection(datapath, plot="save", debug="false")
|
||||||
|
@ -1,47 +1,41 @@
|
|||||||
# directory setup
|
# Path setup ------------------------------------------------------------------
|
||||||
dataroot: "../data/"
|
|
||||||
outputdir: "../output/"
|
|
||||||
|
|
||||||
# Duration and overlap of the analysis window in seconds
|
dataroot: "../data/" # path to data
|
||||||
window: 5
|
outputdir: "../output/" # path to save plots to
|
||||||
overlap: 1
|
|
||||||
edge: 0.25
|
|
||||||
|
|
||||||
# Number of electrodes to go over
|
# Rolling window parameters ---------------------------------------------------
|
||||||
number_electrodes: 3
|
|
||||||
minimum_electrodes: 2
|
|
||||||
|
|
||||||
# Search window bandwidth and minimal baseline bandwidth
|
window: 5 # rolling window length in seconds
|
||||||
minimal_bandwidth: 20
|
overlap: 1 # window overlap in seconds
|
||||||
|
edge: 0.25 # window edge cufoffs to mitigate filter edge effects
|
||||||
|
|
||||||
# Instantaneous frequency smoothing usint a gaussian kernel of this width
|
# Electrode iteration parameters ----------------------------------------------
|
||||||
baseline_frequency_smoothing: 5
|
|
||||||
|
|
||||||
# Baseline processing parameters
|
number_electrodes: 2 # number of electrodes to go over
|
||||||
baseline_envelope_cutoff: 25
|
minimum_electrodes: 1 # mimumun number of electrodes a chirp must be on
|
||||||
baseline_envelope_bandpass_lowf: 2
|
|
||||||
baseline_envelope_bandpass_highf: 100
|
|
||||||
# baseline_envelope_envelope_cutoff: 4
|
|
||||||
|
|
||||||
# search envelope processing parameters
|
# Feature extraction parameters -----------------------------------------------
|
||||||
search_envelope_cutoff: 10
|
|
||||||
|
|
||||||
# Instantaneous frequency bandpass filter cutoff frequencies
|
search_df_lower: 20 # start searching this far above the baseline
|
||||||
# baseline_frequency_highpass_cutoff: 0.000005
|
search_df_upper: 100 # stop searching this far above the baseline
|
||||||
# baseline_frequency_envelope_cutoff: 0.000005
|
search_res: 1 # search window resolution
|
||||||
|
default_search_freq: 60 # search here if no need for a search frequency
|
||||||
|
minimal_bandwidth: 10 # minimal bandpass filter width for baseline
|
||||||
|
search_bandwidth: 10 # minimal bandpass filter width for search frequency
|
||||||
|
baseline_frequency_smoothing: 10 # instantaneous frequency smoothing
|
||||||
|
|
||||||
# peak detecion parameters
|
# Feature processing parameters -----------------------------------------------
|
||||||
prominence: 0.7
|
|
||||||
|
|
||||||
# search freq parameter
|
baseline_envelope_cutoff: 25 # envelope estimation cutoff
|
||||||
search_df_lower: 20
|
baseline_envelope_bandpass_lowf: 2 # envelope badpass lower cutoff
|
||||||
search_df_upper: 100
|
baseline_envelope_bandpass_highf: 100 # envelope bandbass higher cutoff
|
||||||
search_res: 1
|
search_envelope_cutoff: 10 # search envelope estimation cufoff
|
||||||
search_bandwidth: 20
|
|
||||||
default_search_freq: 60
|
|
||||||
|
|
||||||
# Classify events as chirps if they are less than this time apart
|
|
||||||
chirp_window_threshold: 0.015
|
|
||||||
|
|
||||||
|
# Peak detecion parameters ----------------------------------------------------
|
||||||
|
baseline_prominence: 0.00005 # peak prominence threshold for baseline envelope
|
||||||
|
search_prominence: 0.000004 # peak prominence threshold for search envelope
|
||||||
|
frequency_prominence: 2 # peak prominence threshold for baseline freq
|
||||||
|
|
||||||
|
# Classify events as chirps if they are less than this time apart
|
||||||
|
chirp_window_threshold: 0.02
|
||||||
|
|
||||||
|
@ -4,11 +4,13 @@ import numpy as np
|
|||||||
from chirpdetection import chirpdetection
|
from chirpdetection import chirpdetection
|
||||||
from IPython import embed
|
from IPython import embed
|
||||||
|
|
||||||
|
# check rec ../data/mount_data/2020-03-25-10_00/ starting at 3175
|
||||||
|
|
||||||
|
|
||||||
def main(datapaths):
|
def main(datapaths):
|
||||||
|
|
||||||
for path in datapaths:
|
for path in datapaths:
|
||||||
chirpdetection(path, plot='show', debug='electrode')
|
chirpdetection(path, plot='show')
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
@ -43,6 +45,7 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
recs = pd.DataFrame(columns=['recording'], data=valid_datasets)
|
recs = pd.DataFrame(columns=['recording'], data=valid_datasets)
|
||||||
recs.to_csv('../recs.csv', index=False)
|
recs.to_csv('../recs.csv', index=False)
|
||||||
# main(datapaths)
|
datapaths = ['../data/mount_data/2020-03-25-10_00/']
|
||||||
|
main(datapaths)
|
||||||
|
|
||||||
# window 1524 + 244 in dataset index 4 is nice example
|
# window 1524 + 244 in dataset index 4 is nice example
|
||||||
|
99
code/modules/behaviour_handling.py
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
import numpy as np
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
from IPython import embed
|
||||||
|
|
||||||
|
|
||||||
|
from pandas import read_csv
|
||||||
|
from modules.logger import makeLogger
|
||||||
|
|
||||||
|
|
||||||
|
logger = makeLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
class Behavior:
|
||||||
|
"""Load behavior data from csv file as class attributes
|
||||||
|
Attributes
|
||||||
|
----------
|
||||||
|
behavior: 0: chasing onset, 1: chasing offset, 2: physical contact
|
||||||
|
behavior_type:
|
||||||
|
behavioral_category:
|
||||||
|
comment_start:
|
||||||
|
comment_stop:
|
||||||
|
dataframe: pandas dataframe with all the data
|
||||||
|
duration_s:
|
||||||
|
media_file:
|
||||||
|
observation_date:
|
||||||
|
observation_id:
|
||||||
|
start_s: start time of the event in seconds
|
||||||
|
stop_s: stop time of the event in seconds
|
||||||
|
total_length:
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(self, folder_path: str) -> None:
|
||||||
|
|
||||||
|
LED_on_time_BORIS = np.load(os.path.join(folder_path, 'LED_on_time.npy'), allow_pickle=True)
|
||||||
|
|
||||||
|
csv_filename = [f for f in os.listdir(folder_path) if f.endswith('.csv')][0]
|
||||||
|
logger.info(f'CSV file: {csv_filename}')
|
||||||
|
self.dataframe = read_csv(os.path.join(folder_path, csv_filename))
|
||||||
|
|
||||||
|
self.chirps = np.load(os.path.join(folder_path, 'chirps.npy'), allow_pickle=True)
|
||||||
|
self.chirps_ids = np.load(os.path.join(folder_path, 'chirp_ids.npy'), allow_pickle=True)
|
||||||
|
|
||||||
|
self.ident = np.load(os.path.join(folder_path, 'ident_v.npy'), allow_pickle=True)
|
||||||
|
self.idx = np.load(os.path.join(folder_path, 'idx_v.npy'), allow_pickle=True)
|
||||||
|
self.freq = np.load(os.path.join(folder_path, 'fund_v.npy'), allow_pickle=True)
|
||||||
|
self.time = np.load(os.path.join(folder_path, "times.npy"), allow_pickle=True)
|
||||||
|
self.spec = np.load(os.path.join(folder_path, "spec.npy"), allow_pickle=True)
|
||||||
|
|
||||||
|
for k, key in enumerate(self.dataframe.keys()):
|
||||||
|
key = key.lower()
|
||||||
|
if ' ' in key:
|
||||||
|
key = key.replace(' ', '_')
|
||||||
|
if '(' in key:
|
||||||
|
key = key.replace('(', '')
|
||||||
|
key = key.replace(')', '')
|
||||||
|
setattr(self, key, np.array(self.dataframe[self.dataframe.keys()[k]]))
|
||||||
|
|
||||||
|
last_LED_t_BORIS = LED_on_time_BORIS[-1]
|
||||||
|
real_time_range = self.time[-1] - self.time[0]
|
||||||
|
factor = 1.034141
|
||||||
|
shift = last_LED_t_BORIS - real_time_range * factor
|
||||||
|
self.start_s = (self.start_s - shift) / factor
|
||||||
|
self.stop_s = (self.stop_s - shift) / factor
|
||||||
|
|
||||||
|
|
||||||
|
def correct_chasing_events(
|
||||||
|
category: np.ndarray,
|
||||||
|
timestamps: np.ndarray
|
||||||
|
) -> tuple[np.ndarray, np.ndarray]:
|
||||||
|
|
||||||
|
onset_ids = np.arange(
|
||||||
|
len(category))[category == 0]
|
||||||
|
offset_ids = np.arange(
|
||||||
|
len(category))[category == 1]
|
||||||
|
|
||||||
|
woring_bh = np.arange(len(category))[category!=2][:-1][np.diff(category[category!=2])==0]
|
||||||
|
if onset_ids[0] > offset_ids[0]:
|
||||||
|
offset_ids = np.delete(offset_ids, 0)
|
||||||
|
help_index = offset_ids[0]
|
||||||
|
woring_bh = np.append(woring_bh, help_index)
|
||||||
|
|
||||||
|
category = np.delete(category, woring_bh)
|
||||||
|
timestamps = np.delete(timestamps, woring_bh)
|
||||||
|
|
||||||
|
# Check whether on- or offset is longer and calculate length difference
|
||||||
|
if len(onset_ids) > len(offset_ids):
|
||||||
|
len_diff = len(onset_ids) - len(offset_ids)
|
||||||
|
logger.info(f'Onsets are greater than offsets by {len_diff}')
|
||||||
|
elif len(onset_ids) < len(offset_ids):
|
||||||
|
len_diff = len(offset_ids) - len(onset_ids)
|
||||||
|
logger.info(f'Offsets are greater than onsets by {len_diff}')
|
||||||
|
elif len(onset_ids) == len(offset_ids):
|
||||||
|
logger.info('Chasing events are equal')
|
||||||
|
|
||||||
|
|
||||||
|
return category, timestamps
|
@ -3,6 +3,7 @@ import os
|
|||||||
import yaml
|
import yaml
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from thunderfish.dataloader import DataLoader
|
from thunderfish.dataloader import DataLoader
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
|
||||||
|
|
||||||
class ConfLoader:
|
class ConfLoader:
|
||||||
|
@ -23,16 +23,16 @@ def PlotStyle() -> None:
|
|||||||
sky = "#89dceb"
|
sky = "#89dceb"
|
||||||
teal = "#94e2d5"
|
teal = "#94e2d5"
|
||||||
green = "#a6e3a1"
|
green = "#a6e3a1"
|
||||||
yellow = "#f9e2af"
|
yellow = "#f9d67f"
|
||||||
orange = "#fab387"
|
orange = "#faa472"
|
||||||
maroon = "#eba0ac"
|
maroon = "#eb8486"
|
||||||
red = "#f38ba8"
|
red = "#f37588"
|
||||||
purple = "#cba6f7"
|
purple = "#d89bf7"
|
||||||
pink = "#f5c2e7"
|
pink = "#f59edb"
|
||||||
lavender = "#b4befe"
|
lavender = "#b4befe"
|
||||||
gblue1 = "#8cb8ff"
|
gblue1 = "#89b4fa"
|
||||||
gblue2 = "#7cdcdc"
|
gblue2 = "#89dceb"
|
||||||
gblue3 = "#82e896"
|
gblue3 = "#a6e3a1"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def lims(cls, track1, track2):
|
def lims(cls, track1, track2):
|
||||||
@ -229,7 +229,7 @@ def PlotStyle() -> None:
|
|||||||
plt.rc("legend", fontsize=SMALL_SIZE) # legend fontsize
|
plt.rc("legend", fontsize=SMALL_SIZE) # legend fontsize
|
||||||
plt.rc("figure", titlesize=BIGGER_SIZE) # fontsize of the figure title
|
plt.rc("figure", titlesize=BIGGER_SIZE) # fontsize of the figure title
|
||||||
|
|
||||||
plt.rcParams["image.cmap"] = 'cmo.haline'
|
plt.rcParams["image.cmap"] = "cmo.haline"
|
||||||
plt.rcParams["axes.xmargin"] = 0.05
|
plt.rcParams["axes.xmargin"] = 0.05
|
||||||
plt.rcParams["axes.ymargin"] = 0.1
|
plt.rcParams["axes.ymargin"] = 0.1
|
||||||
plt.rcParams["axes.titlelocation"] = "left"
|
plt.rcParams["axes.titlelocation"] = "left"
|
||||||
@ -261,31 +261,33 @@ def PlotStyle() -> None:
|
|||||||
# plt.rcParams["axes.grid"] = True # display grid or not
|
# plt.rcParams["axes.grid"] = True # display grid or not
|
||||||
# plt.rcParams["axes.grid.axis"] = "y" # which axis the grid is applied to
|
# plt.rcParams["axes.grid.axis"] = "y" # which axis the grid is applied to
|
||||||
plt.rcParams["axes.labelcolor"] = white
|
plt.rcParams["axes.labelcolor"] = white
|
||||||
plt.rcParams["axes.axisbelow"] = True # draw axis gridlines and ticks:
|
plt.rcParams["axes.axisbelow"] = True # draw axis gridlines and ticks:
|
||||||
plt.rcParams["axes.spines.left"] = True # display axis spines
|
plt.rcParams["axes.spines.left"] = True # display axis spines
|
||||||
plt.rcParams["axes.spines.bottom"] = True
|
plt.rcParams["axes.spines.bottom"] = True
|
||||||
plt.rcParams["axes.spines.top"] = False
|
plt.rcParams["axes.spines.top"] = False
|
||||||
plt.rcParams["axes.spines.right"] = False
|
plt.rcParams["axes.spines.right"] = False
|
||||||
plt.rcParams["axes.prop_cycle"] = cycler(
|
plt.rcParams["axes.prop_cycle"] = cycler(
|
||||||
'color', [
|
"color",
|
||||||
'#b4befe',
|
[
|
||||||
'#89b4fa',
|
"#b4befe",
|
||||||
'#74c7ec',
|
"#89b4fa",
|
||||||
'#89dceb',
|
"#74c7ec",
|
||||||
'#94e2d5',
|
"#89dceb",
|
||||||
'#a6e3a1',
|
"#94e2d5",
|
||||||
'#f9e2af',
|
"#a6e3a1",
|
||||||
'#fab387',
|
"#f9e2af",
|
||||||
'#eba0ac',
|
"#fab387",
|
||||||
'#f38ba8',
|
"#eba0ac",
|
||||||
'#cba6f7',
|
"#f38ba8",
|
||||||
'#f5c2e7',
|
"#cba6f7",
|
||||||
])
|
"#f5c2e7",
|
||||||
|
],
|
||||||
|
)
|
||||||
plt.rcParams["xtick.color"] = gray # color of the ticks
|
plt.rcParams["xtick.color"] = gray # color of the ticks
|
||||||
plt.rcParams["ytick.color"] = gray # color of the ticks
|
plt.rcParams["ytick.color"] = gray # color of the ticks
|
||||||
plt.rcParams["grid.color"] = dark_gray # grid color
|
plt.rcParams["grid.color"] = dark_gray # grid color
|
||||||
plt.rcParams["figure.facecolor"] = black # figure face color
|
plt.rcParams["figure.facecolor"] = black # figure face color
|
||||||
plt.rcParams["figure.edgecolor"] = black # figure edge color
|
plt.rcParams["figure.edgecolor"] = black # figure edge color
|
||||||
plt.rcParams["savefig.facecolor"] = black # figure face color when saving
|
plt.rcParams["savefig.facecolor"] = black # figure face color when saving
|
||||||
|
|
||||||
return style
|
return style
|
||||||
@ -295,12 +297,11 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
s = PlotStyle()
|
s = PlotStyle()
|
||||||
|
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.cbook as cbook
|
||||||
import matplotlib.cm as cm
|
import matplotlib.cm as cm
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
import matplotlib.cbook as cbook
|
|
||||||
from matplotlib.path import Path
|
|
||||||
from matplotlib.patches import PathPatch
|
from matplotlib.patches import PathPatch
|
||||||
|
from matplotlib.path import Path
|
||||||
|
|
||||||
# Fixing random state for reproducibility
|
# Fixing random state for reproducibility
|
||||||
np.random.seed(19680801)
|
np.random.seed(19680801)
|
||||||
@ -308,14 +309,20 @@ if __name__ == "__main__":
|
|||||||
delta = 0.025
|
delta = 0.025
|
||||||
x = y = np.arange(-3.0, 3.0, delta)
|
x = y = np.arange(-3.0, 3.0, delta)
|
||||||
X, Y = np.meshgrid(x, y)
|
X, Y = np.meshgrid(x, y)
|
||||||
Z1 = np.exp(-X**2 - Y**2)
|
Z1 = np.exp(-(X**2) - Y**2)
|
||||||
Z2 = np.exp(-(X - 1)**2 - (Y - 1)**2)
|
Z2 = np.exp(-((X - 1) ** 2) - (Y - 1) ** 2)
|
||||||
Z = (Z1 - Z2) * 2
|
Z = (Z1 - Z2) * 2
|
||||||
|
|
||||||
fig1, ax = plt.subplots()
|
fig1, ax = plt.subplots()
|
||||||
im = ax.imshow(Z, interpolation='bilinear', cmap=cm.RdYlGn,
|
im = ax.imshow(
|
||||||
origin='lower', extent=[-3, 3, -3, 3],
|
Z,
|
||||||
vmax=abs(Z).max(), vmin=-abs(Z).max())
|
interpolation="bilinear",
|
||||||
|
cmap=cm.RdYlGn,
|
||||||
|
origin="lower",
|
||||||
|
extent=[-3, 3, -3, 3],
|
||||||
|
vmax=abs(Z).max(),
|
||||||
|
vmin=-abs(Z).max(),
|
||||||
|
)
|
||||||
|
|
||||||
plt.show()
|
plt.show()
|
||||||
|
|
||||||
@ -328,22 +335,21 @@ if __name__ == "__main__":
|
|||||||
all_data = [np.random.normal(0, std, 100) for std in range(6, 10)]
|
all_data = [np.random.normal(0, std, 100) for std in range(6, 10)]
|
||||||
|
|
||||||
# plot violin plot
|
# plot violin plot
|
||||||
axs[0].violinplot(all_data,
|
axs[0].violinplot(all_data, showmeans=False, showmedians=True)
|
||||||
showmeans=False,
|
axs[0].set_title("Violin plot")
|
||||||
showmedians=True)
|
|
||||||
axs[0].set_title('Violin plot')
|
|
||||||
|
|
||||||
# plot box plot
|
# plot box plot
|
||||||
axs[1].boxplot(all_data)
|
axs[1].boxplot(all_data)
|
||||||
axs[1].set_title('Box plot')
|
axs[1].set_title("Box plot")
|
||||||
|
|
||||||
# adding horizontal grid lines
|
# adding horizontal grid lines
|
||||||
for ax in axs:
|
for ax in axs:
|
||||||
ax.yaxis.grid(True)
|
ax.yaxis.grid(True)
|
||||||
ax.set_xticks([y + 1 for y in range(len(all_data))],
|
ax.set_xticks(
|
||||||
labels=['x1', 'x2', 'x3', 'x4'])
|
[y + 1 for y in range(len(all_data))], labels=["x1", "x2", "x3", "x4"]
|
||||||
ax.set_xlabel('Four separate samples')
|
)
|
||||||
ax.set_ylabel('Observed values')
|
ax.set_xlabel("Four separate samples")
|
||||||
|
ax.set_ylabel("Observed values")
|
||||||
|
|
||||||
plt.show()
|
plt.show()
|
||||||
|
|
||||||
@ -355,24 +361,42 @@ if __name__ == "__main__":
|
|||||||
theta = np.linspace(0.0, 2 * np.pi, N, endpoint=False)
|
theta = np.linspace(0.0, 2 * np.pi, N, endpoint=False)
|
||||||
radii = 10 * np.random.rand(N)
|
radii = 10 * np.random.rand(N)
|
||||||
width = np.pi / 4 * np.random.rand(N)
|
width = np.pi / 4 * np.random.rand(N)
|
||||||
colors = cmo.cm.haline(radii / 10.)
|
colors = cmo.cm.haline(radii / 10.0)
|
||||||
|
|
||||||
ax = plt.subplot(projection='polar')
|
ax = plt.subplot(projection="polar")
|
||||||
ax.bar(theta, radii, width=width, bottom=0.0, color=colors, alpha=0.5)
|
ax.bar(theta, radii, width=width, bottom=0.0, color=colors, alpha=0.5)
|
||||||
|
|
||||||
plt.show()
|
plt.show()
|
||||||
|
|
||||||
methods = [None, 'none', 'nearest', 'bilinear', 'bicubic', 'spline16',
|
methods = [
|
||||||
'spline36', 'hanning', 'hamming', 'hermite', 'kaiser', 'quadric',
|
None,
|
||||||
'catrom', 'gaussian', 'bessel', 'mitchell', 'sinc', 'lanczos']
|
"none",
|
||||||
|
"nearest",
|
||||||
|
"bilinear",
|
||||||
|
"bicubic",
|
||||||
|
"spline16",
|
||||||
|
"spline36",
|
||||||
|
"hanning",
|
||||||
|
"hamming",
|
||||||
|
"hermite",
|
||||||
|
"kaiser",
|
||||||
|
"quadric",
|
||||||
|
"catrom",
|
||||||
|
"gaussian",
|
||||||
|
"bessel",
|
||||||
|
"mitchell",
|
||||||
|
"sinc",
|
||||||
|
"lanczos",
|
||||||
|
]
|
||||||
|
|
||||||
# Fixing random state for reproducibility
|
# Fixing random state for reproducibility
|
||||||
np.random.seed(19680801)
|
np.random.seed(19680801)
|
||||||
|
|
||||||
grid = np.random.rand(4, 4)
|
grid = np.random.rand(4, 4)
|
||||||
|
|
||||||
fig, axs = plt.subplots(nrows=3, ncols=6, figsize=(9, 6),
|
fig, axs = plt.subplots(
|
||||||
subplot_kw={'xticks': [], 'yticks': []})
|
nrows=3, ncols=6, figsize=(9, 6), subplot_kw={"xticks": [], "yticks": []}
|
||||||
|
)
|
||||||
|
|
||||||
for ax, interp_method in zip(axs.flat, methods):
|
for ax, interp_method in zip(axs.flat, methods):
|
||||||
ax.imshow(grid, interpolation=interp_method)
|
ax.imshow(grid, interpolation=interp_method)
|
||||||
|
160
code/plot_chirp_bodylegth.py
Normal file
@ -0,0 +1,160 @@
|
|||||||
|
import numpy as np
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
from thunderfish.powerspectrum import decibel
|
||||||
|
|
||||||
|
from IPython import embed
|
||||||
|
from pandas import read_csv
|
||||||
|
from modules.logger import makeLogger
|
||||||
|
from modules.plotstyle import PlotStyle
|
||||||
|
from modules.behaviour_handling import Behavior, correct_chasing_events
|
||||||
|
|
||||||
|
ps = PlotStyle()
|
||||||
|
|
||||||
|
logger = makeLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
def main(datapath: str):
|
||||||
|
|
||||||
|
foldernames = [
|
||||||
|
datapath + x + '/' for x in os.listdir(datapath) if os.path.isdir(datapath+x)]
|
||||||
|
path_order_meta = (
|
||||||
|
'/').join(foldernames[0].split('/')[:-2]) + '/order_meta.csv'
|
||||||
|
order_meta_df = read_csv(path_order_meta)
|
||||||
|
order_meta_df['recording'] = order_meta_df['recording'].str[1:-1]
|
||||||
|
path_id_meta = (
|
||||||
|
'/').join(foldernames[0].split('/')[:-2]) + '/id_meta.csv'
|
||||||
|
id_meta_df = read_csv(path_id_meta)
|
||||||
|
|
||||||
|
chirps_winner = []
|
||||||
|
size_diff = []
|
||||||
|
chirps_diff = []
|
||||||
|
chirps_loser = []
|
||||||
|
freq_diff = []
|
||||||
|
|
||||||
|
|
||||||
|
for foldername in foldernames:
|
||||||
|
# behabvior is pandas dataframe with all the data
|
||||||
|
if foldername == '../data/mount_data/2020-05-12-10_00/':
|
||||||
|
continue
|
||||||
|
bh = Behavior(foldername)
|
||||||
|
# chirps are not sorted in time (presumably due to prior groupings)
|
||||||
|
# get and sort chirps and corresponding fish_ids of the chirps
|
||||||
|
category = bh.behavior
|
||||||
|
timestamps = bh.start_s
|
||||||
|
# Correct for doubles in chasing on- and offsets to get the right on-/offset pairs
|
||||||
|
# Get rid of tracking faults (two onsets or two offsets after another)
|
||||||
|
category, timestamps = correct_chasing_events(category, timestamps)
|
||||||
|
|
||||||
|
folder_name = foldername.split('/')[-2]
|
||||||
|
winner_row = order_meta_df[order_meta_df['recording'] == folder_name]
|
||||||
|
winner = winner_row['winner'].values[0].astype(int)
|
||||||
|
winner_fish1 = winner_row['fish1'].values[0].astype(int)
|
||||||
|
winner_fish2 = winner_row['fish2'].values[0].astype(int)
|
||||||
|
|
||||||
|
groub = winner_row['group'].values[0].astype(int)
|
||||||
|
size_rows = id_meta_df[id_meta_df['group'] == groub]
|
||||||
|
|
||||||
|
|
||||||
|
if winner == winner_fish1:
|
||||||
|
winner_fish_id = winner_row['rec_id1'].values[0]
|
||||||
|
loser_fish_id = winner_row['rec_id2'].values[0]
|
||||||
|
|
||||||
|
size_winners = []
|
||||||
|
for l in ['l1', 'l2', 'l3']:
|
||||||
|
size_winner = size_rows[size_rows['fish']== winner_fish1][l].values[0]
|
||||||
|
size_winners.append(size_winner)
|
||||||
|
mean_size_winner = np.nanmean(size_winners)
|
||||||
|
|
||||||
|
|
||||||
|
size_losers = []
|
||||||
|
for l in ['l1', 'l2', 'l3']:
|
||||||
|
size_loser = size_rows[size_rows['fish']== winner_fish2][l].values[0]
|
||||||
|
size_losers.append(size_loser)
|
||||||
|
mean_size_loser = np.nanmean(size_losers)
|
||||||
|
|
||||||
|
size_diff.append(mean_size_winner - mean_size_loser)
|
||||||
|
|
||||||
|
elif winner == winner_fish2:
|
||||||
|
winner_fish_id = winner_row['rec_id2'].values[0]
|
||||||
|
loser_fish_id = winner_row['rec_id1'].values[0]
|
||||||
|
|
||||||
|
size_winners = []
|
||||||
|
for l in ['l1', 'l2', 'l3']:
|
||||||
|
size_winner = size_rows[size_rows['fish']== winner_fish2][l].values[0]
|
||||||
|
size_winners.append(size_winner)
|
||||||
|
mean_size_winner = np.nanmean(size_winners)
|
||||||
|
|
||||||
|
size_losers = []
|
||||||
|
for l in ['l1', 'l2', 'l3']:
|
||||||
|
size_loser = size_rows[size_rows['fish']== winner_fish1][l].values[0]
|
||||||
|
size_losers.append(size_loser)
|
||||||
|
mean_size_loser = np.nanmean(size_losers)
|
||||||
|
|
||||||
|
size_diff.append(mean_size_winner - mean_size_loser)
|
||||||
|
else:
|
||||||
|
continue
|
||||||
|
|
||||||
|
print(foldername)
|
||||||
|
all_fish_ids = np.unique(bh.chirps_ids)
|
||||||
|
chirp_winner = len(bh.chirps[bh.chirps_ids == winner_fish_id])
|
||||||
|
chirp_loser = len(bh.chirps[bh.chirps_ids == loser_fish_id])
|
||||||
|
|
||||||
|
freq_winner = np.nanmedian(bh.freq[bh.ident==winner_fish_id])
|
||||||
|
freq_loser = np.nanmedian(bh.freq[bh.ident==loser_fish_id])
|
||||||
|
|
||||||
|
|
||||||
|
chirps_winner.append(chirp_winner)
|
||||||
|
chirps_loser.append(chirp_loser)
|
||||||
|
|
||||||
|
chirps_diff.append(chirp_winner - chirp_loser)
|
||||||
|
freq_diff.append(freq_winner - freq_loser)
|
||||||
|
|
||||||
|
fish1_id = all_fish_ids[0]
|
||||||
|
fish2_id = all_fish_ids[1]
|
||||||
|
print(winner_fish_id)
|
||||||
|
print(all_fish_ids)
|
||||||
|
|
||||||
|
fig, (ax1, ax2, ax3) = plt.subplots(1,3, figsize=(10,5))
|
||||||
|
scatterwinner = 1.15
|
||||||
|
scatterloser = 1.85
|
||||||
|
bplot1 = ax1.boxplot(chirps_winner, positions=[
|
||||||
|
1], showfliers=False, patch_artist=True)
|
||||||
|
bplot2 = ax1.boxplot(chirps_loser, positions=[
|
||||||
|
2], showfliers=False, patch_artist=True)
|
||||||
|
ax1.scatter(np.ones(len(chirps_winner))*scatterwinner, chirps_winner, color='r')
|
||||||
|
ax1.scatter(np.ones(len(chirps_loser))*scatterloser, chirps_loser, color='r')
|
||||||
|
ax1.set_xticklabels(['winner', 'loser'])
|
||||||
|
ax1.text(0.9, 0.9, f'n = {len(chirps_winner)}', transform=ax1.transAxes, color= ps.white)
|
||||||
|
|
||||||
|
for w, l in zip(chirps_winner, chirps_loser):
|
||||||
|
ax1.plot([scatterwinner, scatterloser], [w, l], color='r', alpha=0.5, linewidth=0.5)
|
||||||
|
|
||||||
|
colors1 = ps.red
|
||||||
|
ps.set_boxplot_color(bplot1, colors1)
|
||||||
|
colors1 = ps.orange
|
||||||
|
ps.set_boxplot_color(bplot2, colors1)
|
||||||
|
ax1.set_ylabel('Chirpscounts [n]')
|
||||||
|
|
||||||
|
ax2.scatter(size_diff, chirps_diff, color='r')
|
||||||
|
ax2.set_xlabel('Size difference [mm]')
|
||||||
|
ax2.set_ylabel('Chirps difference [n]')
|
||||||
|
|
||||||
|
ax3.scatter(freq_diff, chirps_diff, color='r')
|
||||||
|
ax3.set_xlabel('Frequency difference [Hz]')
|
||||||
|
ax3.set_yticklabels([])
|
||||||
|
ax3.set
|
||||||
|
|
||||||
|
plt.savefig('../poster/figs/chirps_winner_loser.pdf')
|
||||||
|
plt.show()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
|
||||||
|
# Path to the data
|
||||||
|
datapath = '../data/mount_data/'
|
||||||
|
|
||||||
|
main(datapath)
|
@ -10,194 +10,102 @@ from IPython import embed
|
|||||||
from pandas import read_csv
|
from pandas import read_csv
|
||||||
from modules.logger import makeLogger
|
from modules.logger import makeLogger
|
||||||
from modules.plotstyle import PlotStyle
|
from modules.plotstyle import PlotStyle
|
||||||
|
from modules.behaviour_handling import Behavior, correct_chasing_events
|
||||||
|
|
||||||
ps = PlotStyle()
|
ps = PlotStyle()
|
||||||
|
|
||||||
logger = makeLogger(__name__)
|
logger = makeLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class Behavior:
|
|
||||||
"""Load behavior data from csv file as class attributes
|
|
||||||
Attributes
|
|
||||||
----------
|
|
||||||
behavior: 0: chasing onset, 1: chasing offset, 2: physical contact
|
|
||||||
behavior_type:
|
|
||||||
behavioral_category:
|
|
||||||
comment_start:
|
|
||||||
comment_stop:
|
|
||||||
dataframe: pandas dataframe with all the data
|
|
||||||
duration_s:
|
|
||||||
media_file:
|
|
||||||
observation_date:
|
|
||||||
observation_id:
|
|
||||||
start_s: start time of the event in seconds
|
|
||||||
stop_s: stop time of the event in seconds
|
|
||||||
total_length:
|
|
||||||
"""
|
|
||||||
|
|
||||||
def __init__(self, folder_path: str) -> None:
|
|
||||||
|
|
||||||
|
|
||||||
LED_on_time_BORIS = np.load(os.path.join(folder_path, 'LED_on_time.npy'), allow_pickle=True)
|
|
||||||
|
|
||||||
csv_filename = [f for f in os.listdir(folder_path) if f.endswith('.csv')][0]
|
|
||||||
logger.info(f'CSV file: {csv_filename}')
|
|
||||||
self.dataframe = read_csv(os.path.join(folder_path, csv_filename))
|
|
||||||
|
|
||||||
self.chirps = np.load(os.path.join(folder_path, 'chirps.npy'), allow_pickle=True)
|
|
||||||
self.chirps_ids = np.load(os.path.join(folder_path, 'chirps_ids.npy'), allow_pickle=True)
|
|
||||||
|
|
||||||
self.ident = np.load(os.path.join(folder_path, 'ident_v.npy'), allow_pickle=True)
|
|
||||||
self.idx = np.load(os.path.join(folder_path, 'idx_v.npy'), allow_pickle=True)
|
|
||||||
self.freq = np.load(os.path.join(folder_path, 'fund_v.npy'), allow_pickle=True)
|
|
||||||
self.time = np.load(os.path.join(folder_path, "times.npy"), allow_pickle=True)
|
|
||||||
self.spec = np.load(os.path.join(folder_path, "spec.npy"), allow_pickle=True)
|
|
||||||
|
|
||||||
for k, key in enumerate(self.dataframe.keys()):
|
|
||||||
key = key.lower()
|
|
||||||
if ' ' in key:
|
|
||||||
key = key.replace(' ', '_')
|
|
||||||
if '(' in key:
|
|
||||||
key = key.replace('(', '')
|
|
||||||
key = key.replace(')', '')
|
|
||||||
setattr(self, key, np.array(self.dataframe[self.dataframe.keys()[k]]))
|
|
||||||
|
|
||||||
last_LED_t_BORIS = LED_on_time_BORIS[-1]
|
|
||||||
real_time_range = self.time[-1] - self.time[0]
|
|
||||||
factor = 1.034141
|
|
||||||
shift = last_LED_t_BORIS - real_time_range * factor
|
|
||||||
self.start_s = (self.start_s - shift) / factor
|
|
||||||
self.stop_s = (self.stop_s - shift) / factor
|
|
||||||
|
|
||||||
def correct_chasing_events(
|
|
||||||
category: np.ndarray,
|
|
||||||
timestamps: np.ndarray
|
|
||||||
) -> tuple[np.ndarray, np.ndarray]:
|
|
||||||
|
|
||||||
onset_ids = np.arange(
|
|
||||||
len(category))[category == 0]
|
|
||||||
offset_ids = np.arange(
|
|
||||||
len(category))[category == 1]
|
|
||||||
|
|
||||||
# Check whether on- or offset is longer and calculate length difference
|
|
||||||
if len(onset_ids) > len(offset_ids):
|
|
||||||
len_diff = len(onset_ids) - len(offset_ids)
|
|
||||||
longer_array = onset_ids
|
|
||||||
shorter_array = offset_ids
|
|
||||||
logger.info(f'Onsets are greater than offsets by {len_diff}')
|
|
||||||
elif len(onset_ids) < len(offset_ids):
|
|
||||||
len_diff = len(offset_ids) - len(onset_ids)
|
|
||||||
longer_array = offset_ids
|
|
||||||
shorter_array = onset_ids
|
|
||||||
logger.info(f'Offsets are greater than offsets by {len_diff}')
|
|
||||||
elif len(onset_ids) == len(offset_ids):
|
|
||||||
logger.info('Chasing events are equal')
|
|
||||||
return category, timestamps
|
|
||||||
|
|
||||||
|
|
||||||
# Correct the wrong chasing events; delete double events
|
|
||||||
wrong_ids = []
|
|
||||||
for i in range(len(longer_array)-(len_diff+1)):
|
|
||||||
if (shorter_array[i] > longer_array[i]) & (shorter_array[i] < longer_array[i+1]):
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
wrong_ids.append(longer_array[i])
|
|
||||||
longer_array = np.delete(longer_array, i)
|
|
||||||
|
|
||||||
category = np.delete(
|
|
||||||
category, wrong_ids)
|
|
||||||
timestamps = np.delete(
|
|
||||||
timestamps, wrong_ids)
|
|
||||||
return category, timestamps
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def main(datapath: str):
|
def main(datapath: str):
|
||||||
# behabvior is pandas dataframe with all the data
|
|
||||||
bh = Behavior(datapath)
|
foldernames = [datapath + x + '/' for x in os.listdir(datapath) if os.path.isdir(datapath+x)]
|
||||||
# chirps are not sorted in time (presumably due to prior groupings)
|
for foldername in foldernames:
|
||||||
# get and sort chirps and corresponding fish_ids of the chirps
|
if foldername == '../data/mount_data/2020-05-12-10_00/':
|
||||||
chirps = bh.chirps[np.argsort(bh.chirps)]
|
continue
|
||||||
chirps_fish_ids = bh.chirps_ids[np.argsort(bh.chirps)]
|
# behabvior is pandas dataframe with all the data
|
||||||
category = bh.behavior
|
bh = Behavior(foldername)
|
||||||
timestamps = bh.start_s
|
|
||||||
# Correct for doubles in chasing on- and offsets to get the right on-/offset pairs
|
category = bh.behavior
|
||||||
# Get rid of tracking faults (two onsets or two offsets after another)
|
timestamps = bh.start_s
|
||||||
category, timestamps = correct_chasing_events(category, timestamps)
|
# Correct for doubles in chasing on- and offsets to get the right on-/offset pairs
|
||||||
|
# Get rid of tracking faults (two onsets or two offsets after another)
|
||||||
# split categories
|
category, timestamps = correct_chasing_events(category, timestamps)
|
||||||
chasing_onset = (timestamps[category == 0]/ 60) /60
|
|
||||||
chasing_offset = (timestamps[category == 1]/ 60) /60
|
# split categories
|
||||||
physical_contact = (timestamps[category == 2] / 60) /60
|
chasing_onset = (timestamps[category == 0]/ 60) /60
|
||||||
|
chasing_offset = (timestamps[category == 1]/ 60) /60
|
||||||
all_fish_ids = np.unique(chirps_fish_ids)
|
physical_contact = (timestamps[category == 2] / 60) /60
|
||||||
fish1_id = all_fish_ids[0]
|
|
||||||
fish2_id = all_fish_ids[1]
|
all_fish_ids = np.unique(bh.chirps_ids)
|
||||||
# Associate chirps to inidividual fish
|
fish1_id = all_fish_ids[0]
|
||||||
fish1 = (chirps[chirps_fish_ids == fish1_id] / 60) /60
|
fish2_id = all_fish_ids[1]
|
||||||
fish2 = (chirps[chirps_fish_ids == fish2_id] / 60) /60
|
# Associate chirps to inidividual fish
|
||||||
fish1_color = ps.red
|
fish1 = (bh.chirps[bh.chirps_ids == fish1_id] / 60) /60
|
||||||
fish2_color = ps.orange
|
fish2 = (bh.chirps[bh.chirps_ids == fish2_id] / 60) /60
|
||||||
|
fish1_color = ps.red
|
||||||
fig, ax = plt.subplots(4, 1, figsize=(10, 5), height_ratios=[0.5, 0.5, 0.5, 6], sharex=True)
|
fish2_color = ps.orange
|
||||||
# marker size
|
|
||||||
s = 200
|
fig, ax = plt.subplots(4, 1, figsize=(10, 5), height_ratios=[0.5, 0.5, 0.5, 6], sharex=True)
|
||||||
ax[0].scatter(physical_contact, np.ones(len(physical_contact)), color='firebrick', marker='|', s=s)
|
# marker size
|
||||||
ax[1].scatter(chasing_onset, np.ones(len(chasing_onset)), color='green', marker='|', s=s )
|
s = 200
|
||||||
ax[2].scatter(fish1, np.ones(len(fish1))-0.25, color=fish1_color, marker='|', s=s)
|
ax[0].scatter(physical_contact, np.ones(len(physical_contact)), color='firebrick', marker='|', s=s)
|
||||||
ax[2].scatter(fish2, np.zeros(len(fish2))+0.25, color=fish2_color, marker='|', s=s)
|
ax[1].scatter(chasing_onset, np.ones(len(chasing_onset)), color='green', marker='|', s=s )
|
||||||
|
ax[2].scatter(fish1, np.ones(len(fish1))-0.25, color=fish1_color, marker='|', s=s)
|
||||||
|
ax[2].scatter(fish2, np.zeros(len(fish2))+0.25, color=fish2_color, marker='|', s=s)
|
||||||
freq_temp = bh.freq[bh.ident==fish1_id]
|
|
||||||
time_temp = bh.time[bh.idx[bh.ident==fish1_id]]
|
|
||||||
ax[3].plot((time_temp/ 60) /60, freq_temp, color=fish1_color)
|
freq_temp = bh.freq[bh.ident==fish1_id]
|
||||||
|
time_temp = bh.time[bh.idx[bh.ident==fish1_id]]
|
||||||
freq_temp = bh.freq[bh.ident==fish2_id]
|
ax[3].plot((time_temp/ 60) /60, freq_temp, color=fish1_color)
|
||||||
time_temp = bh.time[bh.idx[bh.ident==fish2_id]]
|
|
||||||
ax[3].plot((time_temp/ 60) /60, freq_temp, color=fish2_color)
|
freq_temp = bh.freq[bh.ident==fish2_id]
|
||||||
|
time_temp = bh.time[bh.idx[bh.ident==fish2_id]]
|
||||||
#ax[3].imshow(decibel(bh.spec), extent=[bh.time[0]/60/60, bh.time[-1]/60/60, 0, 2000], aspect='auto', origin='lower')
|
ax[3].plot((time_temp/ 60) /60, freq_temp, color=fish2_color)
|
||||||
|
|
||||||
# Hide grid lines
|
#ax[3].imshow(decibel(bh.spec), extent=[bh.time[0]/60/60, bh.time[-1]/60/60, 0, 2000], aspect='auto', origin='lower')
|
||||||
ax[0].grid(False)
|
|
||||||
ax[0].set_frame_on(False)
|
# Hide grid lines
|
||||||
ax[0].set_xticks([])
|
ax[0].grid(False)
|
||||||
ax[0].set_yticks([])
|
ax[0].set_frame_on(False)
|
||||||
ps.hide_ax(ax[0])
|
ax[0].set_xticks([])
|
||||||
|
ax[0].set_yticks([])
|
||||||
|
ps.hide_ax(ax[0])
|
||||||
ax[1].grid(False)
|
|
||||||
ax[1].set_frame_on(False)
|
|
||||||
ax[1].set_xticks([])
|
ax[1].grid(False)
|
||||||
ax[1].set_yticks([])
|
ax[1].set_frame_on(False)
|
||||||
ps.hide_ax(ax[1])
|
ax[1].set_xticks([])
|
||||||
|
ax[1].set_yticks([])
|
||||||
ax[2].grid(False)
|
ps.hide_ax(ax[1])
|
||||||
ax[2].set_frame_on(False)
|
|
||||||
ax[2].set_yticks([])
|
ax[2].grid(False)
|
||||||
ax[2].set_xticks([])
|
ax[2].set_frame_on(False)
|
||||||
ps.hide_ax(ax[2])
|
ax[2].set_yticks([])
|
||||||
|
ax[2].set_xticks([])
|
||||||
|
ps.hide_ax(ax[2])
|
||||||
|
|
||||||
ax[3].axvspan(0, 3, 0, 5, facecolor='grey', alpha=0.5)
|
|
||||||
ax[3].set_xticks(np.arange(0, 6.1, 0.5))
|
|
||||||
|
ax[3].axvspan(3, 6, 0, 5, facecolor='grey', alpha=0.5)
|
||||||
labelpad = 40
|
ax[3].set_xticks(np.arange(0, 6.1, 0.5))
|
||||||
ax[0].set_ylabel('Physical contact', rotation=0, labelpad=labelpad)
|
|
||||||
ax[1].set_ylabel('Chasing events', rotation=0, labelpad=labelpad)
|
labelpad = 40
|
||||||
ax[2].set_ylabel('Chirps', rotation=0, labelpad=labelpad)
|
ax[0].set_ylabel('Physical contact', rotation=0, labelpad=labelpad)
|
||||||
ax[3].set_ylabel('EODf')
|
ax[1].set_ylabel('Chasing events', rotation=0, labelpad=labelpad)
|
||||||
|
ax[2].set_ylabel('Chirps', rotation=0, labelpad=labelpad)
|
||||||
ax[3].set_xlabel('Time [h]')
|
ax[3].set_ylabel('EODf')
|
||||||
|
|
||||||
plt.show()
|
ax[3].set_xlabel('Time [h]')
|
||||||
embed()
|
ax[0].set_title(foldername.split('/')[-2])
|
||||||
|
# 2020-03-31-9_59
|
||||||
|
plt.show()
|
||||||
|
embed()
|
||||||
|
|
||||||
# plot chirps
|
# plot chirps
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# Path to the data
|
# Path to the data
|
||||||
datapath = '../data/mount_data/2020-05-13-10_00/'
|
datapath = '../data/mount_data/'
|
||||||
main(datapath)
|
main(datapath)
|
||||||
|
@ -41,9 +41,9 @@ def main():
|
|||||||
freqtime2, freq2 = instantaneous_frequency(
|
freqtime2, freq2 = instantaneous_frequency(
|
||||||
filtered2, data.raw_rate, smoothing_window=3)
|
filtered2, data.raw_rate, smoothing_window=3)
|
||||||
|
|
||||||
ax1.plot(freqtime1*timescaler, freq1, color=ps.gblue1,
|
ax1.plot(freqtime1*timescaler, freq1, color=ps.red,
|
||||||
lw=2, label=f"fish 1, {np.median(freq1):.0f} Hz")
|
lw=2, label=f"fish 1, {np.median(freq1):.0f} Hz")
|
||||||
ax1.plot(freqtime2*timescaler, freq2, color=ps.gblue3,
|
ax1.plot(freqtime2*timescaler, freq2, color=ps.orange,
|
||||||
lw=2, label=f"fish 2, {np.median(freq2):.0f} Hz")
|
lw=2, label=f"fish 2, {np.median(freq2):.0f} Hz")
|
||||||
ax1.legend(bbox_to_anchor=(0, 1.02, 1, 0.2), loc="lower center",
|
ax1.legend(bbox_to_anchor=(0, 1.02, 1, 0.2), loc="lower center",
|
||||||
mode="normal", borderaxespad=0, ncol=2)
|
mode="normal", borderaxespad=0, ncol=2)
|
||||||
|
BIN
poster/figs/chirps_winner_loser.pdf
Normal file
529
poster/figs/logo_all.pdf
Normal file
BIN
poster/main.pdf
141
poster/main.tex
@ -1,4 +1,4 @@
|
|||||||
\documentclass[25pt, a0paper, landscape, margin=0mm, innermargin=20mm,
|
\documentclass[25pt, a0paper, portrait, margin=0mm, innermargin=20mm,
|
||||||
blockverticalspace=2mm, colspace=20mm, subcolspace=0mm]{tikzposter} %Default values for poster format options.
|
blockverticalspace=2mm, colspace=20mm, subcolspace=0mm]{tikzposter} %Default values for poster format options.
|
||||||
|
|
||||||
\input{packages}
|
\input{packages}
|
||||||
@ -7,113 +7,84 @@ blockverticalspace=2mm, colspace=20mm, subcolspace=0mm]{tikzposter} %Default val
|
|||||||
\begin{document}
|
\begin{document}
|
||||||
|
|
||||||
\renewcommand{\baselinestretch}{1}
|
\renewcommand{\baselinestretch}{1}
|
||||||
\title{\parbox{1900pt}{Pushing the limits of time-frequency uncertainty in the
|
\title{\parbox{1500pt}{Detection of transient communication signals in weakly electric fish}}
|
||||||
detection of transient communication signals in weakly electric fish}}
|
\author{Sina Prause, Alexander Wendt, and Patrick Weygoldt}
|
||||||
\author{Sina Prause, Alexander Wendt, Patrick Weygoldt}
|
\institute{Supervised by Till Raab \& Jan Benda, Neuroethology Lab, University of Tuebingen}
|
||||||
\institute{Supervised by Till Raab \& Jan Benda, Neurothology Group,
|
|
||||||
University of Tübingen}
|
|
||||||
\usetitlestyle[]{sampletitle}
|
\usetitlestyle[]{sampletitle}
|
||||||
\maketitle
|
\maketitle
|
||||||
\renewcommand{\baselinestretch}{1.4}
|
\renewcommand{\baselinestretch}{1.4}
|
||||||
|
|
||||||
\begin{columns}
|
\begin{columns}
|
||||||
\column{0.5}
|
\column{0.4}
|
||||||
\myblock[TranspBlock]{Introduction}{
|
\myblock[TranspBlock]{Introduction}{
|
||||||
\begin{minipage}[t]{0.55\linewidth}
|
The time-frequency tradeoff makes reliable signal detecion and simultaneous
|
||||||
The time-frequency tradeoff makes reliable signal detecion and simultaneous
|
sender identification of freely interacting individuals impossible.
|
||||||
sender identification of freely interacting individuals impossible.
|
This profoundly limits our current understanding of chirps to experiments
|
||||||
This profoundly limits our current understanding of chirps to experiments
|
with single - or physically separated - individuals.
|
||||||
with single - or physically separated - individuals.
|
% \begin{tikzfigure}[]
|
||||||
\end{minipage} \hfill
|
% \label{griddrawing}
|
||||||
\begin{minipage}[t]{0.40\linewidth}
|
% \includegraphics[width=1\linewidth]{figs/introplot}
|
||||||
\vspace{-1.5cm}
|
% \end{tikzfigure}
|
||||||
\begin{tikzfigure}[]
|
|
||||||
\label{tradeoff}
|
|
||||||
\includegraphics[width=\linewidth]{figs/introplot}
|
|
||||||
\end{tikzfigure}
|
|
||||||
\end{minipage}
|
|
||||||
}
|
|
||||||
|
|
||||||
\myblock[TranspBlock]{A chirp detection algorithm}{
|
|
||||||
\begin{tikzfigure}[]
|
|
||||||
\label{modulations}
|
|
||||||
\includegraphics[width=\linewidth]{figs/algorithm}
|
|
||||||
\end{tikzfigure}
|
|
||||||
}
|
}
|
||||||
|
\myblock[TranspBlock]{Chirp detection}{
|
||||||
\column{0.5}
|
|
||||||
\myblock[TranspBlock]{Chirps and diadic competitions}{
|
|
||||||
\begin{minipage}[t]{0.7\linewidth}
|
|
||||||
\begin{tikzfigure}[]
|
\begin{tikzfigure}[]
|
||||||
\label{modulations}
|
\label{fig:example_a}
|
||||||
\includegraphics[width=\linewidth]{figs/placeholder1}
|
\includegraphics[width=1\linewidth]{figs/algorithm}
|
||||||
\end{tikzfigure}
|
\end{tikzfigure}
|
||||||
\end{minipage} \hfill
|
\vspace{0cm}
|
||||||
\begin{minipage}[t]{0.25\linewidth}
|
}
|
||||||
\lipsum[3][1-3]
|
|
||||||
\end{minipage}
|
|
||||||
|
|
||||||
\begin{minipage}[t]{0.7\linewidth}
|
\column{0.6}
|
||||||
|
\myblock[TranspBlock]{Chirps during competition}{
|
||||||
\begin{tikzfigure}[]
|
\begin{tikzfigure}[]
|
||||||
\label{modulations}
|
\label{fig:example_b}
|
||||||
\includegraphics[width=\linewidth]{figs/placeholder1}
|
\includegraphics[width=0.5\linewidth]{example-image-b}
|
||||||
\end{tikzfigure}
|
\end{tikzfigure}
|
||||||
\end{minipage} \hfill
|
\noindent
|
||||||
\begin{minipage}[t]{0.25\linewidth}
|
}
|
||||||
\lipsum[3][1-3]
|
|
||||||
\end{minipage}
|
|
||||||
|
|
||||||
\begin{minipage}[t]{0.7\linewidth}
|
\myblock[TranspBlock]{Interactions at modulations}{
|
||||||
|
\vspace{-1.2cm}
|
||||||
\begin{tikzfigure}[]
|
\begin{tikzfigure}[]
|
||||||
\label{modulations}
|
\label{fig:example_c}
|
||||||
\includegraphics[width=\linewidth]{figs/placeholder1}
|
\includegraphics[width=0.5\linewidth]{example-image-c}
|
||||||
\end{tikzfigure}
|
\end{tikzfigure}
|
||||||
\end{minipage} \hfill
|
|
||||||
\begin{minipage}[t]{0.25\linewidth}
|
|
||||||
\lipsum[3][1-3]
|
|
||||||
\end{minipage}
|
|
||||||
|
|
||||||
|
\begin{multicols}{2}
|
||||||
}
|
\begin{itemize}
|
||||||
|
\setlength\itemsep{0.5em}
|
||||||
\myblock[TranspBlock]{Conclusion}{
|
\item $\Delta$EOD$f$ does not appear to decrease during synchronous modulations ().
|
||||||
\lipsum[3][1-9]
|
\item Individuals that rise their EOD$f$ first appear to rise their frequency higher compared to reactors (\textbf{B}).
|
||||||
|
\vfill
|
||||||
|
\null
|
||||||
|
\columnbreak
|
||||||
|
\item Synchronized fish keep distances below 1 m (\textbf{C}) but distances over 3 m also occur (see \textbf{movie}).
|
||||||
|
\item Spatial interactions increase \textbf{after} the start of a synchronous modulation (\textbf{D}).
|
||||||
|
\end{itemize}
|
||||||
|
\end{multicols}
|
||||||
|
\vspace{-1cm}
|
||||||
}
|
}
|
||||||
|
|
||||||
% \column{0.3}
|
\myblock[GrayBlock]{Conclusion}{
|
||||||
% \myblock[TranspBlock]{More Results}{
|
\begin{itemize}
|
||||||
% \begin{tikzfigure}[]
|
\setlength\itemsep{0.5em}
|
||||||
% \label{results}
|
\item Our analysis is the first to indicate that \textit{A. leptorhynchus} uses long, diffuse and synchronized EOD$f$ signals to communicate in addition to chirps and rises.
|
||||||
% \includegraphics[width=\linewidth]{example-image-a}
|
\item The recorded fish do not exhibit jamming avoidance behavior while close during synchronous modulations.
|
||||||
% \end{tikzfigure}
|
\item Synchronous signals \textbf{initiate} spatio-temporal interactions.
|
||||||
|
\end{itemize}
|
||||||
% \begin{multicols}{2}
|
\vspace{0.2cm}
|
||||||
% \lipsum[5][1-8]
|
}
|
||||||
% \end{multicols}
|
\end{columns}
|
||||||
% \vspace{-1cm}
|
|
||||||
% }
|
\node [above right,
|
||||||
|
|
||||||
% \myblock[TranspBlock]{Conclusion}{
|
|
||||||
% \begin{itemize}
|
|
||||||
% \setlength\itemsep{0.5em}
|
|
||||||
% \item \lipsum[1][1]
|
|
||||||
% \item \lipsum[1][1]
|
|
||||||
% \item \lipsum[1][1]
|
|
||||||
% \end{itemize}
|
|
||||||
% \vspace{0.2cm}
|
|
||||||
% }
|
|
||||||
\end{columns}
|
|
||||||
|
|
||||||
\node[
|
|
||||||
above right,
|
|
||||||
text=white,
|
text=white,
|
||||||
outer sep=45pt,
|
outer sep=45pt,
|
||||||
minimum width=\paperwidth,
|
minimum width=\paperwidth,
|
||||||
align=center,
|
align=center,
|
||||||
draw,
|
draw,
|
||||||
fill=boxes,
|
fill=boxes,
|
||||||
color=boxes,
|
color=boxes] at (-43.6,-61) {
|
||||||
] at (-0.51\paperwidth,-43.5) {
|
\textcolor{white}{
|
||||||
\textcolor{text}{\normalsize Contact: \{name\}.\{surname\}@student.uni-tuebingen.de}};
|
\normalsize Contact: \{name\}.\{surname\}@student.uni-tuebingen.de}};
|
||||||
|
|
||||||
\end{document}
|
\end{document}
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
\usepackage[utf8]{inputenc}
|
\usepackage[utf8]{inputenc}
|
||||||
\usepackage[scaled]{helvet}
|
\usepackage[scaled]{helvet}
|
||||||
\renewcommand\familydefault{\sfdefault}
|
\renewcommand\familydefault{\sfdefault}
|
||||||
\usepackage[T1]{fontenc}
|
\usepackage[T1]{fontenc}
|
||||||
\usepackage{wrapfig}
|
\usepackage{wrapfig}
|
||||||
\usepackage{setspace}
|
\usepackage{setspace}
|
||||||
\usepackage{multicol}
|
\usepackage{multicol}
|
||||||
\setlength{\columnsep}{1.5cm}
|
\setlength{\columnsep}{1.5cm}
|
||||||
\usepackage{xspace}
|
\usepackage{xspace}
|
||||||
\usepackage{tikz}
|
\usepackage{tikz}
|
||||||
\usepackage{lipsum}
|
|
@ -16,10 +16,11 @@
|
|||||||
\colorlet{notefgcolor}{background}
|
\colorlet{notefgcolor}{background}
|
||||||
\colorlet{notebgcolor}{background}
|
\colorlet{notebgcolor}{background}
|
||||||
|
|
||||||
|
|
||||||
% Title setup
|
% Title setup
|
||||||
\settitle{
|
\settitle{
|
||||||
% Rearrange the order of the minipages to e.g. center the title between the logos
|
% Rearrange the order of the minipages to e.g. center the title between the logos
|
||||||
\begin{minipage}[c]{0.6\paperwidth}
|
\begin{minipage}[c]{0.8\paperwidth}
|
||||||
% \centering
|
% \centering
|
||||||
\vspace{2.5cm}\hspace{1.5cm}
|
\vspace{2.5cm}\hspace{1.5cm}
|
||||||
\color{text}{\Huge{\textbf{\@title}} \par}
|
\color{text}{\Huge{\textbf{\@title}} \par}
|
||||||
@ -30,26 +31,28 @@
|
|||||||
\vspace{2.5cm}
|
\vspace{2.5cm}
|
||||||
\end{minipage}
|
\end{minipage}
|
||||||
\begin{minipage}[c]{0.2\paperwidth}
|
\begin{minipage}[c]{0.2\paperwidth}
|
||||||
% \centering
|
|
||||||
\vspace{1cm}\hspace{1cm}
|
|
||||||
\includegraphics[scale=1]{example-image-a}
|
|
||||||
\end{minipage}
|
|
||||||
\begin{minipage}[c]{0.2\paperwidth}
|
|
||||||
% \vspace{1cm}\hspace{1cm}
|
|
||||||
\centering
|
\centering
|
||||||
\includegraphics[scale=1]{example-image-a}
|
% \vspace{1cm}
|
||||||
|
\hspace{-10cm}
|
||||||
|
\includegraphics[width=\linewidth]{example-image-a}
|
||||||
\end{minipage}}
|
\end{minipage}}
|
||||||
|
% \begin{minipage}[c]{0.2\paperwidth}
|
||||||
|
% \vspace{1cm}\hspace{1cm}
|
||||||
|
% \centering
|
||||||
|
% \includegraphics[width=\linewidth]{example-image-a}
|
||||||
|
% \end{minipage}}
|
||||||
|
|
||||||
% definie title style with background box
|
% define title style with background box (currently white)
|
||||||
\definetitlestyle{sampletitle}{
|
\definetitlestyle{sampletitle}{
|
||||||
width=1189mm,
|
width=841mm,
|
||||||
roundedcorners=0,
|
roundedcorners=0,
|
||||||
linewidth=0pt,
|
linewidth=0pt,
|
||||||
innersep=15pt,
|
innersep=15pt,
|
||||||
titletotopverticalspace=0mm,
|
titletotopverticalspace=0mm,
|
||||||
titletoblockverticalspace=5pt
|
titletoblockverticalspace=5pt
|
||||||
}{
|
}{
|
||||||
\begin{scope}[line width=\titlelinewidth, rounded corners=\titleroundedcorners]
|
\begin{scope}[line width=\titlelinewidth,
|
||||||
|
rounded corners=\titleroundedcorners]
|
||||||
\draw[fill=text, color=boxes]
|
\draw[fill=text, color=boxes]
|
||||||
(\titleposleft,\titleposbottom)
|
(\titleposleft,\titleposbottom)
|
||||||
rectangle
|
rectangle
|
||||||
|
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 116 KiB |
BIN
poster_old/figs/algorithm.pdf
Normal file
BIN
poster_old/figs/introplot.pdf
Normal file
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 84 KiB |
Before Width: | Height: | Size: 157 KiB After Width: | Height: | Size: 157 KiB |
BIN
poster_old/main.pdf
Normal file
119
poster_old/main.tex
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
\documentclass[25pt, a0paper, landscape, margin=0mm, innermargin=20mm,
|
||||||
|
blockverticalspace=2mm, colspace=20mm, subcolspace=0mm]{tikzposter} %Default values for poster format options.
|
||||||
|
|
||||||
|
\input{packages}
|
||||||
|
\input{style}
|
||||||
|
|
||||||
|
\begin{document}
|
||||||
|
|
||||||
|
\renewcommand{\baselinestretch}{1}
|
||||||
|
\title{\parbox{1900pt}{Pushing the limits of time-frequency uncertainty in the
|
||||||
|
detection of transient communication signals in weakly electric fish}}
|
||||||
|
\author{Sina Prause, Alexander Wendt, Patrick Weygoldt}
|
||||||
|
\institute{Supervised by Till Raab \& Jan Benda, Neurothology Group,
|
||||||
|
University of Tübingen}
|
||||||
|
\usetitlestyle[]{sampletitle}
|
||||||
|
\maketitle
|
||||||
|
\renewcommand{\baselinestretch}{1.4}
|
||||||
|
|
||||||
|
\begin{columns}
|
||||||
|
\column{0.5}
|
||||||
|
\myblock[TranspBlock]{Introduction}{
|
||||||
|
\begin{minipage}[t]{0.55\linewidth}
|
||||||
|
The time-frequency tradeoff makes reliable signal detecion and simultaneous
|
||||||
|
sender identification of freely interacting individuals impossible.
|
||||||
|
This profoundly limits our current understanding of chirps to experiments
|
||||||
|
with single - or physically separated - individuals.
|
||||||
|
\end{minipage} \hfill
|
||||||
|
\begin{minipage}[t]{0.40\linewidth}
|
||||||
|
\vspace{-1.5cm}
|
||||||
|
\begin{tikzfigure}[]
|
||||||
|
\label{tradeoff}
|
||||||
|
\includegraphics[width=\linewidth]{figs/introplot}
|
||||||
|
\end{tikzfigure}
|
||||||
|
\end{minipage}
|
||||||
|
}
|
||||||
|
|
||||||
|
\myblock[TranspBlock]{A chirp detection algorithm}{
|
||||||
|
\begin{tikzfigure}[]
|
||||||
|
\label{modulations}
|
||||||
|
\includegraphics[width=\linewidth]{figs/algorithm}
|
||||||
|
\end{tikzfigure}
|
||||||
|
}
|
||||||
|
|
||||||
|
\column{0.5}
|
||||||
|
\myblock[TranspBlock]{Chirps and diadic competitions}{
|
||||||
|
\begin{minipage}[t]{0.7\linewidth}
|
||||||
|
\begin{tikzfigure}[]
|
||||||
|
\label{modulations}
|
||||||
|
\includegraphics[width=\linewidth]{figs/placeholder1}
|
||||||
|
\end{tikzfigure}
|
||||||
|
\end{minipage} \hfill
|
||||||
|
\begin{minipage}[t]{0.25\linewidth}
|
||||||
|
\lipsum[3][1-3]
|
||||||
|
\end{minipage}
|
||||||
|
|
||||||
|
\begin{minipage}[t]{0.7\linewidth}
|
||||||
|
\begin{tikzfigure}[]
|
||||||
|
\label{modulations}
|
||||||
|
\includegraphics[width=\linewidth]{figs/placeholder1}
|
||||||
|
\end{tikzfigure}
|
||||||
|
\end{minipage} \hfill
|
||||||
|
\begin{minipage}[t]{0.25\linewidth}
|
||||||
|
\lipsum[3][1-3]
|
||||||
|
\end{minipage}
|
||||||
|
|
||||||
|
\begin{minipage}[t]{0.7\linewidth}
|
||||||
|
\begin{tikzfigure}[]
|
||||||
|
\label{modulations}
|
||||||
|
\includegraphics[width=\linewidth]{figs/placeholder1}
|
||||||
|
\end{tikzfigure}
|
||||||
|
\end{minipage} \hfill
|
||||||
|
\begin{minipage}[t]{0.25\linewidth}
|
||||||
|
\lipsum[3][1-3]
|
||||||
|
\end{minipage}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
\myblock[TranspBlock]{Conclusion}{
|
||||||
|
\lipsum[3][1-9]
|
||||||
|
}
|
||||||
|
|
||||||
|
% \column{0.3}
|
||||||
|
% \myblock[TranspBlock]{More Results}{
|
||||||
|
% \begin{tikzfigure}[]
|
||||||
|
% \label{results}
|
||||||
|
% \includegraphics[width=\linewidth]{example-image-a}
|
||||||
|
% \end{tikzfigure}
|
||||||
|
|
||||||
|
% \begin{multicols}{2}
|
||||||
|
% \lipsum[5][1-8]
|
||||||
|
% \end{multicols}
|
||||||
|
% \vspace{-1cm}
|
||||||
|
% }
|
||||||
|
|
||||||
|
% \myblock[TranspBlock]{Conclusion}{
|
||||||
|
% \begin{itemize}
|
||||||
|
% \setlength\itemsep{0.5em}
|
||||||
|
% \item \lipsum[1][1]
|
||||||
|
% \item \lipsum[1][1]
|
||||||
|
% \item \lipsum[1][1]
|
||||||
|
% \end{itemize}
|
||||||
|
% \vspace{0.2cm}
|
||||||
|
% }
|
||||||
|
\end{columns}
|
||||||
|
|
||||||
|
\node[
|
||||||
|
above right,
|
||||||
|
text=white,
|
||||||
|
outer sep=45pt,
|
||||||
|
minimum width=\paperwidth,
|
||||||
|
align=center,
|
||||||
|
draw,
|
||||||
|
fill=boxes,
|
||||||
|
color=boxes,
|
||||||
|
] at (-0.51\paperwidth,-43.5) {
|
||||||
|
\textcolor{text}{\normalsize Contact: \{name\}.\{surname\}@student.uni-tuebingen.de}};
|
||||||
|
|
||||||
|
\end{document}
|
11
poster_old/packages.tex
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
\usepackage[utf8]{inputenc}
|
||||||
|
\usepackage[scaled]{helvet}
|
||||||
|
\renewcommand\familydefault{\sfdefault}
|
||||||
|
\usepackage[T1]{fontenc}
|
||||||
|
\usepackage{wrapfig}
|
||||||
|
\usepackage{setspace}
|
||||||
|
\usepackage{multicol}
|
||||||
|
\setlength{\columnsep}{1.5cm}
|
||||||
|
\usepackage{xspace}
|
||||||
|
\usepackage{tikz}
|
||||||
|
\usepackage{lipsum}
|
119
poster_old/style.tex
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
\tikzposterlatexaffectionproofoff
|
||||||
|
\usetheme{Default}
|
||||||
|
|
||||||
|
\definecolor{text}{HTML}{e0e4f7}
|
||||||
|
\definecolor{background}{HTML}{111116}
|
||||||
|
\definecolor{boxes}{HTML}{2a2a32}
|
||||||
|
\definecolor{unired}{HTML}{a51e37}
|
||||||
|
|
||||||
|
\colorlet{blocktitlefgcolor}{text}
|
||||||
|
\colorlet{backgroundcolor}{background}
|
||||||
|
\colorlet{blocktitlebgcolor}{background}
|
||||||
|
\colorlet{blockbodyfgcolor}{text}
|
||||||
|
\colorlet{innerblocktitlebgcolor}{background}
|
||||||
|
\colorlet{innerblocktitlefgcolor}{text}
|
||||||
|
\colorlet{notefrcolor}{text}
|
||||||
|
\colorlet{notefgcolor}{background}
|
||||||
|
\colorlet{notebgcolor}{background}
|
||||||
|
|
||||||
|
% Title setup
|
||||||
|
\settitle{
|
||||||
|
% Rearrange the order of the minipages to e.g. center the title between the logos
|
||||||
|
\begin{minipage}[c]{0.6\paperwidth}
|
||||||
|
% \centering
|
||||||
|
\vspace{2.5cm}\hspace{1.5cm}
|
||||||
|
\color{text}{\Huge{\textbf{\@title}} \par}
|
||||||
|
\vspace*{2em}\hspace{1.5cm}
|
||||||
|
\color{text}{\LARGE \@author \par}
|
||||||
|
\vspace*{2em}\hspace{1.5cm}
|
||||||
|
\color{text}{\Large \@institute}
|
||||||
|
\vspace{2.5cm}
|
||||||
|
\end{minipage}
|
||||||
|
\begin{minipage}[c]{0.2\paperwidth}
|
||||||
|
% \centering
|
||||||
|
\vspace{1cm}\hspace{1cm}
|
||||||
|
\includegraphics[scale=1]{example-image-a}
|
||||||
|
\end{minipage}
|
||||||
|
\begin{minipage}[c]{0.2\paperwidth}
|
||||||
|
% \vspace{1cm}\hspace{1cm}
|
||||||
|
\centering
|
||||||
|
\includegraphics[scale=1]{example-image-a}
|
||||||
|
\end{minipage}}
|
||||||
|
|
||||||
|
% definie title style with background box
|
||||||
|
\definetitlestyle{sampletitle}{
|
||||||
|
width=1189mm,
|
||||||
|
roundedcorners=0,
|
||||||
|
linewidth=0pt,
|
||||||
|
innersep=15pt,
|
||||||
|
titletotopverticalspace=0mm,
|
||||||
|
titletoblockverticalspace=5pt
|
||||||
|
}{
|
||||||
|
\begin{scope}[line width=\titlelinewidth, rounded corners=\titleroundedcorners]
|
||||||
|
\draw[fill=text, color=boxes]
|
||||||
|
(\titleposleft,\titleposbottom)
|
||||||
|
rectangle
|
||||||
|
(\titleposright,\titlepostop);
|
||||||
|
\end{scope}
|
||||||
|
}
|
||||||
|
|
||||||
|
% define coustom block style for visible blocks
|
||||||
|
\defineblockstyle{GrayBlock}{
|
||||||
|
titlewidthscale=1,
|
||||||
|
bodywidthscale=1,
|
||||||
|
% titlecenter,
|
||||||
|
titleleft,
|
||||||
|
titleoffsetx=0pt,
|
||||||
|
titleoffsety=-30pt,
|
||||||
|
bodyoffsetx=0pt,
|
||||||
|
bodyoffsety=-40pt,
|
||||||
|
bodyverticalshift=0mm,
|
||||||
|
roundedcorners=25,
|
||||||
|
linewidth=1pt,
|
||||||
|
titleinnersep=20pt,
|
||||||
|
bodyinnersep=38pt
|
||||||
|
}{
|
||||||
|
\draw[rounded corners=\blockroundedcorners, inner sep=\blockbodyinnersep,
|
||||||
|
line width=\blocklinewidth, color=background,
|
||||||
|
top color=boxes, bottom color=boxes,
|
||||||
|
]
|
||||||
|
(blockbody.south west) rectangle (blockbody.north east); %
|
||||||
|
\ifBlockHasTitle%
|
||||||
|
\draw[rounded corners=\blockroundedcorners, inner sep=\blocktitleinnersep,
|
||||||
|
top color=background, bottom color=background,
|
||||||
|
line width=2, color=background, %fill=blocktitlebgcolor
|
||||||
|
]
|
||||||
|
(blocktitle.south west) rectangle (blocktitle.north east); %
|
||||||
|
\fi%
|
||||||
|
}
|
||||||
|
\newcommand\myblock[3][GrayBlock]{\useblockstyle{#1}\block{#2}{#3}\useblockstyle{Default}}
|
||||||
|
|
||||||
|
% Define blockstyle for tranparent block
|
||||||
|
\defineblockstyle{TranspBlock}{
|
||||||
|
titlewidthscale=0.99,
|
||||||
|
bodywidthscale=0.99,
|
||||||
|
titleleft,
|
||||||
|
titleoffsetx=15pt,
|
||||||
|
titleoffsety=-40pt,
|
||||||
|
bodyoffsetx=0pt,
|
||||||
|
bodyoffsety=-40pt,
|
||||||
|
bodyverticalshift=0mm,
|
||||||
|
roundedcorners=25,
|
||||||
|
linewidth=1pt,
|
||||||
|
titleinnersep=20pt,
|
||||||
|
bodyinnersep=38pt
|
||||||
|
}{
|
||||||
|
\draw[rounded corners=\blockroundedcorners, inner sep=\blockbodyinnersep,
|
||||||
|
line width=\blocklinewidth, color=background,
|
||||||
|
top color=background, bottom color=background,
|
||||||
|
]
|
||||||
|
(blockbody.south west) rectangle (blockbody.north east); %
|
||||||
|
\ifBlockHasTitle%
|
||||||
|
\draw[rounded corners=\blockroundedcorners, inner sep=\blocktitleinnersep,
|
||||||
|
top color=background, bottom color=background,
|
||||||
|
line width=2, color=background, %fill=blocktitlebgcolor
|
||||||
|
]
|
||||||
|
(blocktitle.south west) rectangle (blocktitle.north east); %
|
||||||
|
\fi%
|
||||||
|
}
|
||||||
|
\renewcommand\myblock[3][TranspBlock]{\useblockstyle{#1}\block{#2}{#3}\useblockstyle{Default}}
|