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')
1D grid (node-based) axis is increasing and equidistant
Parameters
x |
array_like |
node coordinates |
None |
x0 |
float |
first node coordinate |
0.0 |
dx |
float |
grid spacing |
None |
nx |
int |
number of nodes |
None |
projection |
str |
projection string |
'NON-UTM' |
origin |
tuple |
not commonly used |
(0.0, 0.0) |
orientation |
float |
not commonly used |
0.0 |
node_coordinates |
array_like |
coordinates of nodes in 2D or 3D space |
None |
axis_name |
str |
name of axis, by default “x” |
'x' |
Examples
import mikeio
mikeio.Grid1D(nx=3,dx=0.1)
<mikeio.Grid1D>
x: [0, 0.1, 0.2] (nx=3, dx=0.1)
mikeio.Grid1D(x=[0.1, 0.5, 0.9])
<mikeio.Grid1D>
x: [0.1, 0.5, 0.9] (nx=3, dx=0.4)
Methods
find_index |
Find nearest point |
isel |
Get a subset geometry from this geometry |
find_index
Grid1D.find_index(x, **kwargs)
Find nearest point
Parameters
x |
float |
x-coordinate of point |
required |
Returns
int |
index of nearest point |
typing.Any |
Not used |
isel
Grid1D.isel(idx, axis=None)
Get a subset geometry from this geometry
Parameters
idx |
int or slice |
index or slice |
required |
axis |
int |
Not used for Grid1D, by default None |
None |
Returns
mikeio.spatial._geometry.GeometryPoint2D or mikeio.spatial._geometry.GeometryPoint3D or mikeio.spatial._geometry.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)
<mikeio.Grid1D>
x: [0.1, 0.2] (nx=2, dx=0.1)