make_pupil_grid

hcipy.field.make_pupil_grid(dims, diameter=1, xp=None)[source]

Makes a new Grid, meant for descretisation of a pupil-plane wavefront.

This grid is symmetric around the origin, and therefore has no point exactly on the origin for an even number of pixels.

Parameters:
dimstuple of ints or integer

The number of pixels per dimension. If this is an integer, this number of pixels is used for all dimensions.

diameterscalar or array_like

The diameter of the grid in each dimension.

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 diameter.

Returns:
Grid

A CartesianGrid with RegularCoords.

Raises:
ValueError

If xp cannot be inferred and using new-style Fields.