Grid1D

Grid1D(
    self,
    x=None,
    *,
    x0=0.0,
    dx=None,
    nx=None,
    projection='NON-UTM',
    origin=(0.0, 0.0),
    orientation=0.0,
    node_coordinates=None,
    axis_name='x',
)

Attributes

Name Description
dx Grid spacing.
is_geo Are coordinates geographical (LONG/LAT)?
is_local_coordinates Are coordinates relative (NON-UTM)?
nx Number of grid points.
projection The projection.
projection_string The projection string.
x Array of node coordinates.

Methods

Name Description
find_index Find nearest point.
isel Get a subset geometry from this geometry.

find_index

Grid1D.find_index(x, **kwargs)

Find nearest point.

Parameters

Name Type Description Default
x float x-coordinate of point required
**kwargs Any Not used {}

Returns

Name Type Description
int index of nearest point

See Also

mikeio.Dataset.sel

isel

Grid1D.isel(idx, axis=None)

Get a subset geometry from this geometry.

Parameters

Name Type Description Default
idx int or slice index or slice required
axis int Not used for Grid1D, by default None None

Returns

Name Type Description
GeometryPoint2D or GeometryPoint3D or GeometryUndefined The geometry of the selected point

Examples

import mikeio
g = mikeio.Grid1D(nx=3,dx=0.1)
g
<mikeio.Grid1D>
x: [0, 0.1, 0.2] (nx=3, dx=0.1)
g.isel([1,2])
<mikeio.Grid1D>
x: [0.1, 0.2] (nx=2, dx=0.1)
g.isel(1)
GeometryUndefined()