Grid#

Summary#

Create grid objects based on the length of the grid, step size, and origin. The supported Grid types are

Example Usage#

Create the grid object given the values:

grid = Grid(shape=[21, 11, 101], step=[20.0, 4.0, 20.0], origin=[0.0, 0.0, 0.0])

The resulting grid is rectangular with shape of (21, 11, 101), the distance between two corner points in each direction is (200, 40, 2000) nm, and the effective grid size is 220 x 44 x 2020 :math: nm^3. The returned grid points are numpy “ogrid” points: np.ogrid.

Print out a summary of the RectGrid properties

print(grid)

grid module#

Defines the grid objects. Performance wise it is faster to start a grid based on a cuboid shape, the RectGrid can be used directly or inherited for additional functions.

class mrfmsim_marohn.component.grid.Grid(shape, step, origin=[0, 0, 0])[source]#

Bases: mrfmsim.component.ComponentBase

Instantiate a rectangular grid with length, step and origin. The resulting grid has equal spacing in each dimension.

extend_grid_method(ext_pts)[source]#

Extend the grid by the number of points in the x, y, z direction (one side).

Parameters

ext_pts (int) – points to extend along x direction (cantilever motion direction).

property grid_array#

Generate an open mesh-grid of the given grid dimensions.

The benefit of the property is that it cannot be modified, therefore, it is not included when using vars() to obtain the object dictionary. It also generates at runtime.

static grid_extents(length, origin)[source]#

Calculate grid extents based on the grid length and origin.

The result is column stacked into a dimension of (3, 2)