make_focal_grid
- hcipy.field.make_focal_grid(q, num_airy, spatial_resolution=None, pupil_diameter=None, focal_length=None, f_number=None, reference_wavelength=None, xp=None)[source]
Make a grid for a focal plane.
This grid will be a CartesianGrid with RegularCoords, and supports different resolutions, samplings, or extent in x and y. If spatial_resolution is 1, then the grid will be returned in normalized (ie. homogenized) coordinates. Otherwise, it will be in physical units. The spatial resolution is defined by:
\[\Delta x = \lambda f / D = \lambda F\]where \(\lambda\) is the wavelength, \(f\) is the effective focal length before the focal plane, \(D\) is the diameter of the pupil, and \(F\) is the F-number of the incoming light beam. You can supply either the spatial resolution or a set of focal length, reference wavelength and pupil diameter, or a set of F-number and reference wavelength. If none are supplied, a spatial resolution of 1 will be assumed, meaning normalized units.
The grid will always contain the origin (0, 0) point.
- Parameters:
- qscalar or array_like
The number of pixels per resolution element (= lambda f / D).
- num_airyscalar or array_like
The spatial extent of the grid in radius in resolution elements (= lambda f / D).
- spatial_resolutionscalar or array_like
The physical size of a resolution element (= lambda f / D).
- pupil_diameterscalar or array_like
The diameter of the pupil.
- focal_lengthscalar or array_like
The focal length used for calculating the spatial resolution at the focal plane.
- f_numberscalar or array_like
The F number, also known as focal ratio, at the focal plane.
- reference_wavelengthscalar
The reference wavelength used for calculating the spatial resolution at the focal plane.
- xpmodule, optional
The array namespace to use. If you’re using old-style Fields, this must be Numpy. If you’re using new-style Fields and don’t provide this, it will be attempted to be inferred from input arrays.
- Returns:
- Grid
A Grid describing the sampling for a focal plane.
- Raises:
- ValueError
If both no spatial resolution and no complete set of (focal length, reference wavelength and pupil diameter) was supplied.
- ValueError
If xp cannot be inferred and using new-style Fields.