make_hexagonal_grid

hcipy.field.make_hexagonal_grid(circum_diameter, n_rings, pointy_top=False, center=None, xp=None)[source]

Make a regular hexagonal grid.

Parameters:
circum_diameterscalar or array_like

The circum diameter of the hexagons in the grid.

n_ringsinteger

The number of rings in the grid.

pointy_topboolean

If the hexagons contained in the grid.

centerarray_like

The center of the grid in cartesian coordinates.

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

Returns:
Grid

A CartesianGrid with UnstructuredCoords, indicating the center of the hexagons.

Raises:
ValueError

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