Reputation: 551
I'm trying to integrate over the area of a circular aperture superimposed on an array of pixels (see image below). However, I need to determine the fraction of flux (area) inside the circular aperture, and leave out anything outside the circular aperture in each square pixel on the boundary of the circle.
How would I go about coding this in numpy/python such that I am getting an accurate measure of the flux inside the circle?
Upvotes: 2
Views: 1862
Reputation: 97641
scipy.misc.imload
, and divide the pixel values by 255 so you have a mask in 0.0...1.0
Upvotes: 0
Reputation: 33242
Calculate the proportion of each pixel that is within the circle using calculus. (Integrate the equation of your circle between the left-right boundaries of the each.)
Upvotes: 1