[formatting]

This commit is contained in:
wendtalexander 2025-10-21 11:54:11 +02:00
parent 335a83414b
commit 3da1a323c2

View File

@ -20,17 +20,17 @@ Lets look at the calibration and the first trial of the recording.
import pathlib import pathlib
import rlxnix as rlx
import plotly.graph_objects as go
import numpy as np import numpy as np
import plotly.graph_objects as go
import rlxnix as rlx
import scipy.signal as signal import scipy.signal as signal
from plotly.subplots import make_subplots from plotly.subplots import make_subplots
from util import plot_line_comparision, trial_plot
from util import trial_plot, plot_line_comparision
dataset_path = pathlib.Path("../oephys2nix/test/Test1/2025-10-08-aa-invivo-2-recording.nix") dataset_path = pathlib.Path("../oephys2nix/test/Test1/2025-10-08-aa-invivo-2-recording.nix")
relacs_path = pathlib.Path("../oephys2nix/test/Test1/2025-10-08-aa-invivo-2_relacs/2025-10-08-aa-invivo-2.nix") relacs_path = pathlib.Path(
"../oephys2nix/test/Test1/2025-10-08-aa-invivo-2_relacs/2025-10-08-aa-invivo-2.nix"
)
dataset = rlx.Dataset(str(dataset_path)) dataset = rlx.Dataset(str(dataset_path))
relacs = rlx.Dataset(str(relacs_path)) relacs = rlx.Dataset(str(relacs_path))
@ -68,7 +68,6 @@ print(f"Duration of the dataset {repro_d.duration}")
print(f"Duration of the relacs {repro_r.duration}") print(f"Duration of the relacs {repro_r.duration}")
# Resample the open-ephys data # Resample the open-ephys data
sinus_resampled = signal.resample(sinus, len(sinus_r)) sinus_resampled = signal.resample(sinus, len(sinus_r))
``` ```
```{python} ```{python}
@ -83,7 +82,9 @@ oephys_lanes = [sinus, local_eod_oe, global_eod_oe, stimulus_oe]
relacs_lanes = [sinus_r, local_eod_re, global_eod_re, stimulus_re] relacs_lanes = [sinus_r, local_eod_re, global_eod_re, stimulus_re]
names_lanes = ["sinus", "local-eod", "global-eod", "stimulus"] names_lanes = ["sinus", "local-eod", "global-eod", "stimulus"]
lags_lanes = [] lags_lanes = []
for oephys_lane, relacs_lane, names_lane in zip(oephys_lanes, relacs_lanes, names_lanes, strict=True): for oephys_lane, relacs_lane, names_lane in zip(
oephys_lanes, relacs_lanes, names_lanes, strict=True
):
print(oephys_lane.shape) print(oephys_lane.shape)
print(relacs_lane.shape) print(relacs_lane.shape)
oephys_lane_resampled = signal.resample(oephys_lane, len(relacs_lane)) oephys_lane_resampled = signal.resample(oephys_lane, len(relacs_lane))
@ -96,6 +97,12 @@ for oephys_lane, relacs_lane, names_lane in zip(oephys_lanes, relacs_lanes, name
```{python} ```{python}
# | echo: False # | echo: False
fig = plot_line_comparision(t_r, t_r, np.roll(sinus_r, lags_lanes[0]),sinus_resampled, ["sinus-relacs", "sinus-resampled-openepyhs"]) fig = plot_line_comparision(
t_r,
t_r,
np.roll(sinus_r, lags_lanes[0]),
sinus_resampled,
["sinus-relacs", "sinus-resampled-openepyhs"],
)
fig.show() fig.show()
``` ```