Skip to article frontmatterSkip to article content
# Prepare Python environment
import numpy as np
import plotly.express as px
import os
import nibabel as nib
import numpy as np
from plotly.subplots import make_subplots
import plotly.graph_objects as go
import math
from sklearn.linear_model import LinearRegression
from dash import Dash, dcc, html
import pandas as pd
PI_UNICODE = "\U0001D70B"
GYRO_BAR_RATIO_H = 42.6e6  # [Hz/T]

# Taken from real brain data
phase1, phase2, phase3, phase4 = (2.9298516102709202, -0.21864564255753116, -2.2884910587688285, 2.392827225041896)
beg = 0
end = 0.015

t = np.linspace(0, 10, 1001)
a = 2
y = a * t - 10

# 
phase = np.angle(np.exp(1j*y))

fig = go.Figure()
fig.add_trace(go.Scatter(x=t, y=phase, mode='lines', name='Wrapped phase'))
fig.add_scatter(x=t, y=y, mode='lines', name='True phase')
fig.update_traces(marker=dict(size=3))
fig.update_xaxes(title_text="x")
fig.update_yaxes(title_text="rad", tickmode = 'array',
        tickvals = [-3*math.pi, -2*math.pi, -math.pi, 0, math.pi, 2*math.pi, 3*math.pi],
        ticktext = [f'-3{PI_UNICODE}', f'-2{PI_UNICODE}', f'-{PI_UNICODE}', '0', f'{PI_UNICODE}', f'2{PI_UNICODE}', f'3{PI_UNICODE}'])
fig.update_layout({"width": 800})
fig.show()
Loading...