title: Take data from a circle in python
body: <p>I am looking into how the intensity of a ring changes depending on angle. Here is an example of an image:</p>
  
  <p><a href="https://i.stack.imgur.com/O1GVd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/O1GVd.png" alt="enter image description here"></a></p>
  
  <p>What I would like to do is take a circle of values from within the center of that doughnut and plot them vs angle. What I'm currently doing is using scipy.ndimage.interpolation.rotate and taking slices radially through the ring, and extracting the maximum of the two peaks and plotting those vs angle.</p>
  
  <pre><code>    crop = np.ones((width,width)) #this is my image
      slices = np.arange(0,width,1)
      stack = np.zeros((2*width,len(slices)))
      angles = np.linspace(0,2*np.pi,len(crop2))
  
      for j in range(len(slices2)): # take slices
             stack[:,j] = rotate(crop,slices[j],reshape=False)[:,width]
  </code></pre>
  
  <p>However I don't think this is doing what I'm actually looking for. I'm mostly struggling with how to extract the data I want. I have also tried applying a mask which looks like this;</p>
  
  <p><a href="https://i.stack.imgur.com/xsOBo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xsOBo.png" alt="enter image description here"></a></p>
  
  <p>to the image, but then I don't know how to get the values within that mask in the correct order (ie. in order of increasing angle 0 - 2pi)</p>
  
  <p>Any other ideas would be of great help!</p>