new introplot{

This commit is contained in:
weygoldt 2023-01-26 14:03:08 +01:00
parent c9effa2868
commit 5489061556
4 changed files with 24 additions and 24 deletions

View File

@ -262,14 +262,14 @@ class ChirpPlotBuffer:
# facecolors="none", # facecolors="none",
) )
ax0.set_ylabel("frequency [Hz]") ax0.set_ylabel("Frequency [Hz]")
ax1.set_ylabel(r"$\mu$V") ax1.set_ylabel(r"$\mu$V")
ax2.set_ylabel(r"$\mu$V") ax2.set_ylabel(r"$\mu$V")
ax3.set_ylabel("Hz") ax3.set_ylabel("Hz")
ax4.set_ylabel(r"$\mu$V") ax4.set_ylabel(r"$\mu$V")
ax5.set_ylabel(r"$\mu$V") ax5.set_ylabel(r"$\mu$V")
ax6.set_ylabel("Hz") 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)
plt.setp(ax1.get_xticklabels(), visible=False) plt.setp(ax1.get_xticklabels(), visible=False)
@ -652,16 +652,16 @@ 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) * 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
# dt = data.raw.shape[0] # dt = data.raw.shape[0]
# window_start_seconds = (23495 + ((28336-23495)/3)) * data.raw_rate # window_start_seconds = (23495 + ((28336-23495)/3)) * data.raw_rate
# window_duration_seconds = (28336 - 23495) * data.raw_rate # window_duration_seconds = (28336 - 23495) * data.raw_rate
window_start_index = 0 # window_start_index = 0
window_duration_index = data.raw.shape[0] # window_duration_index = data.raw.shape[0]
# generate starting points of rolling window # generate starting points of rolling window
window_start_indices = np.arange( window_start_indices = np.arange(
@ -675,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[3175:]): for st, window_start_index in enumerate(window_start_indices):
logger.info(f"Processing window {st+1} of {len(window_start_indices)}") logger.info(f"Processing window {st+1} of {len(window_start_indices)}")

View File

@ -33,6 +33,7 @@ def PlotStyle() -> None:
gblue1 = "#89b4fa" gblue1 = "#89b4fa"
gblue2 = "#89dceb" gblue2 = "#89dceb"
gblue3 = "#a6e3a1" gblue3 = "#a6e3a1"
g = "#76a0fa"
@classmethod @classmethod
def lims(cls, track1, track2): def lims(cls, track1, track2):
@ -112,7 +113,6 @@ def PlotStyle() -> None:
plt.setp(bp["caps"], color=white) plt.setp(bp["caps"], color=white)
plt.setp(bp["medians"], color=black) plt.setp(bp["medians"], color=black)
@classmethod @classmethod
def label_subplots(cls, labels, axes, fig): def label_subplots(cls, labels, axes, fig):
for axis, label in zip(axes, labels): for axis, label in zip(axes, labels):

View File

@ -41,10 +41,10 @@ def main():
freqtime2, freq2 = instantaneous_frequency( freqtime2, freq2 = instantaneous_frequency(
filtered2, data.raw_rate, smoothing_window=3) filtered2, data.raw_rate, smoothing_window=3)
ax.plot(freqtime1*timescaler, freq1, color=ps.red, ax.plot(freqtime1*timescaler, freq1, color=ps.g,
lw=2, label="fish 1") lw=2, label="Fish 1")
ax.plot(freqtime2*timescaler, freq2, color=ps.orange, ax.plot(freqtime2*timescaler, freq2, color=ps.gray,
lw=2, label="fish 2") lw=2, label="Fish 2")
ax.legend(bbox_to_anchor=(0, 1.02, 1, 0.2), loc="lower center", ax.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)
# ax.legend(bbox_to_anchor=(1.04, 1), borderaxespad=0) # ax.legend(bbox_to_anchor=(1.04, 1), borderaxespad=0)
@ -74,8 +74,8 @@ def main():
origin="lower", origin="lower",
interpolation="gaussian", interpolation="gaussian",
alpha=1, alpha=1,
vmin=-100, # vmin=-100,
vmax=-80, # vmax=-80,
) )
# ps.hide_xax(ax2) # ps.hide_xax(ax2)
@ -103,8 +103,8 @@ def main():
# ) # )
# # ps.hide_xax(ax3) # # ps.hide_xax(ax3)
ax.set_xlabel("time [ms]") ax.set_xlabel("Time [ms]")
ax.set_ylabel("frequency [Hz]") ax.set_ylabel("Frequency [Hz]")
# ax.set_yticks(np.arange(400, 1201, 400)) # ax.set_yticks(np.arange(400, 1201, 400))
# ax.spines.left.set_bounds((400, 1200)) # ax.spines.left.set_bounds((400, 1200))

View File

@ -287,14 +287,14 @@ def main(dataroot):
ax[i].plot(kde_time, np.median(loser_offsets_boot[-1], axis=0), ax[i].plot(kde_time, np.median(loser_offsets_boot[-1], axis=0),
color=ps.black, linewidth=2) color=ps.black, linewidth=2)
ax[i].fill_between( # ax[i].fill_between(
kde_time, # kde_time,
np.percentile(loser_offsets_jackknife, 5, axis=0), # np.percentile(loser_offsets_jackknife, 5, axis=0),
np.percentile(loser_offsets_jackknife, 95, axis=0), # np.percentile(loser_offsets_jackknife, 95, axis=0),
color=ps.blue, # color=ps.blue,
alpha=0.5) # alpha=0.5)
ax[i].plot(kde_time, np.median(loser_offsets_jackknife, axis=0), # ax[i].plot(kde_time, np.median(loser_offsets_jackknife, axis=0),
color=ps.white, linewidth=2) # color=ps.white, linewidth=2)
ax[i].set_xlim(-60, 60) ax[i].set_xlim(-60, 60)