import mikeio
mikeio.Grid1D(nx=3,dx=0.1)<mikeio.Grid1D>
x: [0, 0.1, 0.2] (nx=3, dx=0.1)
1d spatial grid.
The axis is increasing and equidistant
| Name | Type | Description | Default |
|---|---|---|---|
| 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 | (float, float) | 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 |
| 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. |
| Name | Description |
|---|---|
| find_index | Find nearest point. |
| get_space_axis | Get geographic space axis indices within the geometry’s dims. |
| isel | Get a subset geometry from this geometry. |
| reduce | Return reduced geometry after spatial aggregation. |
Find nearest point.
| Name | Type | Description | Default |
|---|---|---|---|
| x | float | x-coordinate of point | required |
| **kwargs | Any | Not used | {} |
| Name | Type | Description |
|---|---|---|
| int | index of nearest point |
Get geographic space axis indices within the geometry’s dims.
Returns which of the geometry’s dims represent geographic space dimensions, as opposed to spectral or other non-geographic dimensions.
This is used when axis=“space” or axis=“spatial” is specified in operations like aggregate, mean, etc.
| Name | Type | Description |
|---|---|---|
| tuple[int, …] | Space axis indices (0-indexed within geometry.dims). Returns empty tuple if there are no space dimensions (e.g., point geometries, pure spectral geometries). |
Grid2D with dims=(“y”, “x”) returns (0, 1) - both are space. GeometryFMAreaSpectrum with dims=(“element”, “direction”, “frequency”) returns (0,) - only element is space, direction/frequency are spectral. GeometryFMPointSpectrum with dims=(“frequency”,) returns () - no space.
Get a subset geometry from this geometry.
| Name | Type | Description | Default |
|---|---|---|---|
| idx | int or slice | index or slice | required |
| axis | int | Not used for Grid1D, by default None | None |
| Name | Type | Description |
|---|---|---|
| Grid1D or GeometryPoint2D or GeometryPoint3D or Geometry0D | The geometry of the selection |
Return reduced geometry after spatial aggregation.