I want to make a function that outputs an array of predefined size. The function is dependent on variables x, y, rx, and ry, and d. Variables x and y are directly related to the cartesian values. rx and ry are the radius of the blobs generated from the function.
I have already converted array indiies from the traditional 0, 0 on the upper left corner to the middle most pixel. This array should always be odd in herms of length and width.
The blob below gives me one array at a time. I need a stack of arrays I can add together. When I change x and y, the size of the array changes, but I need the array to be the same size or zeroed out at on the borders.
I have some code that follows:
def equation(x, y):
return 1 * np.exp(-(x**2 + y**2))
def make_matrix(xs, ys, x_min=nxs, y_min=nys): #makes cartesian values
out = [] #outputs array
for i in range(x_min, xs - center_x):
row = []
for j in range(y_min, ys - center_y):
row.append(equation(i, j))
out.append(row)
return out
blob = np.asarray(list(np.float_(make_matrix(x, y))))