Cells¶
glofas_ewds.cells ¶
Which GloFAS cell a point reads, and where that cell is in a file.
Pure: nothing here does I/O.
GloFAS 4 is a regular grid of 0.05° (about 5 km) cells. Along a river two neighbouring cells can differ by an order of magnitude: one holds the main channel, the next a side valley. Picking the wrong one is the most expensive mistake you can make with this data, and nothing raises when you make it.
Two facts, both measured on 11 October 2026 on 28 real nodes in Italy:
- Open-Meteo picks the cell for a point in float32, rounding away from zero from an origin at -59.975 / -180.025. On the edge between two cells this goes up for some points and down for others.
- The values Open-Meteo returns for that cell are the ones the EWDS labels one step east. With the shift, 28 nodes out of 28 match the EWDS (consolidated history and forecast alike); without it, 0 out of 28. On the Toce that is 2 m³/s against 22. Comparing the coordinates Open-Meteo declares does not show it.
:func:open_meteo_cell gives the EWDS cell whose numbers Open-Meteo serves for
a point, so a reference computed from the EWDS and a forecast read from
Open-Meteo talk about the same water.
declared_cell ¶
declared_cell(longitude: float, latitude: float) -> Node
The cell Open-Meteo declares in its answer for a point.
This is not the cell whose values it returns: see :func:open_meteo_cell.
open_meteo_cell ¶
open_meteo_cell(longitude: float, latitude: float) -> Node
The EWDS cell (lon, lat) whose values Open-Meteo returns for a point.
The declared cell moved one step east.
cell_indices ¶
cell_indices(latitudes: ArrayLike, longitudes: ArrayLike, cells: Sequence[Node], *, step: float = GRID_STEP) -> tuple[npt.NDArray[np.intp], npt.NDArray[np.intp], npt.NDArray[np.bool_]]
Row, column and "inside the file" for each cell, on a file's axes.
Outside the area you downloaded the nearest point is the edge, which is
not the cell: those come back with inside False.