When working with wavefront aberrations, understanding the pupil properties is important. According to Fourier Optics, the wavefront is defined in the Exit pupil system which is the Fourier Transform of the PSF. We can't perceive the pupil plane as a physical one, we have to think about it in Terms of Fourier plane.¶

The maximum frequency which the optical system can pass correspond to the smallest object a telescope can resolve and is proportional to the numerical aperture (NA) of the telescope.¶

The NA is simply the ratio of the diameter of the aperture over the focal length¶

$$
NA (rad) = \frac{D}{f}
$$

The maximum frequency is equal to $k\times NA$ with $$k = \frac{2\times \pi}{\lambda}$$¶

If we know the sampling size in the plane of the Exit pupil, we can infer the size (in pixels) of the pupil. The sampling can be inferred using Shannon sampling in FT, if the sampling in the PSF plane is $$\Delta x$$ and the size of the image is $N$ then the sampling size is $$\frac{2\times \pi}{N\times \Delta x}$$¶

Dividing the maximum frequency by the sampling size yields to:¶

$$\frac{D\times \Delta x \times N }{2\times f}$$

the factor 2 in the denominator is to compute the radius which is half of the pupil size¶

For the above equation to be in pixels, you should respect the units:¶

The diameter D and focal length f and pixel size $\Delta x$ should be in the same unit (mm for example)¶