circular_aperture

colibri.optics.functional.circular_aperture(M, N, radius, pixel_size)[source]

Create a circular aperture mask of a given radius and pixel_size of size (M, N).

\[\begin{split}A(x, y) = \begin{cases} 1 & \text{if } \pm \sqrt{(x^2 + y^2)} \leq \text{radius} \\ 0 & \text{otherwise} \end{cases}\end{split}\]

where: \((x, y)\) are the coordinates of each pixel, normalized by the pixel size, \(\text{radius}\) is the radius of the aperture

Parameters:
  • M (int) – Resolution at Y axis in pixels.

  • N (int) – Resolution at X axis in pixels.

  • radius (float) – Radius of the circular aperture in meters.

  • pixel_size (float) – Pixel size in meters.

Returns:

A binary mask with 1’s inside the radius and 0’s outside.

Return type:

torch.Tensor