I was asked to make the figure of the image bellow, using a grid (100,100) with the np.meshgrid and np.angle() and my only problem is that when i want to make the final boolean grid, python says: ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all().
from PIL import Image
import numpy as np
XX = np.arange(0,101)
YY = np.arange(0,101)
x, y = np.meshgrid(XX, YY)
x = x-50
y = y-50
z = x+ y*-1j
print z
a = np.angle(z,deg=True)
grid = (a>=0 and a<20) or (a>=40 and a<60) or (a>=80 and a<100) or (a>=120 and a<140) or++ (a<=-20 and a>-40) or (a<=-60 and a>-80) or (a<=-100 and a>-120) or (a<=-140 and a>-160)
grid = grid.astype('uint8') * 255
new_img = Image.fromarray(grid ,'L')
new_img.save("grid .bmp")