Processing the different stream of data to calculate responses of retinal cells
We have 8 angles
n_angle = 8
x = np.linspace(0, (n_angle-1)/4*np.pi, num=n_angle)
print(x)
Exponentiating those and multiplying with 0+1i will wind up the angles around the origin in imag number space
vectors = np.exp(x*1j)
print(vectors)
And so multiplying by two before exponentiation double the angle of the arrow. It gives to originally opposite vectors the same direction -> good to calculate orientation selectivity
import matplotlib.pyplot as plt
colors = plt.rcParams["axes.prop_cycle"].by_key()['color']
fig, axs = plt.subplots(1,2)
vectors = np.exp(x*1j)
for dx,dy, c in zip (vectors.real, vectors.imag, colors):
axs[0].arrow(0, 0, dx, dy, head_width=0.2, head_length=0.1,length_includes_head=True, color=c, width=.04)
axs[0].set_xlim(-1.5,1.5)
axs[0].set_ylim(-1.5,1.5)
axs[0].set_title("DS vectors")
vectors = np.exp(x*1j*2)
for i,(dx,dy,c) in enumerate(zip(vectors.real, vectors.imag, colors)):
if i>=4:
dx = dx*0.8
dy = dy*0.8
axs[1].arrow(0, 0, dx, dy, head_width=0.2, head_length=0.1, length_includes_head=True, color=c, width=.04)
axs[1].set_xlim(-1.5,1.5)
axs[1].set_ylim(-1.5,1.5)
axs[1].set_title("OS vectors")