Grid math
Functions used for grids.
Added in version 2.0.0.
- nexus.IsEquidistant(grid, relative_epsilon)
Checks if the given grid is equidistant within a specified relative epsilon.
- Parameters:
grid (ndarray) – The grid to be checked for equidistance.
relative_epsilon (float) – The relative tolerance for checking equidistance. It is defined as the maximum allowed relative difference between consecutive grid spacings.
- Returns:
True if the grid is equidistant within the specified relative epsilon, False otherwise.
- Return type:
bool
- nexus.CreateEquidistant(grid)
Creates an equidistant grid based on the given grid. The new grid will have the same number of points as the original grid, but the spacing between the points will be uniform.
- Parameters:
grid (ndarray) – The original grid from which the equidistant grid will be created. The grid must be in strict ascending or descending order.
- Returns:
An equidistant grid with the same number of points as the original grid. The spacing between the points in the new grid will be uniform. Use np.array() to convert the result to a NumPy array.
- Return type:
array