I am trying to loop through a 2D array of coordinates and apply a function to them, but I am having trouble indexing both the x and y positions properly. Here is my code:
for i,j in range(330):
aperture = phot.aperture.CircularAperture((xy[i,j]),3)
photometry = phot.aperture_photometry(xy, aperture)
the xy array has a size of (330,2), and I want the function to be applied to each set of coordinates, but instead I receive the error cannot unpack non-iterable int object. How can I solve this?
for i,j in range(330)this is incorrect. You will get only one value each time.xy[i,1]andxy[i,2]?