Modflow 6: Well package object should have x and y coordinates as input
Currently our Well package object takes rows and columns as input, this requires the user to do the selection of rows and cols based on x and y's himself, which is inconvenient. The Well package should do this for the user, based on the grid specified in the Discretization.
For regular grids, the method could look like:
def _set_rows_and_columns(self, idomain):
grid_cols = xr.full_like(idomain.x, 1).astype(np.int32).cumsum()
grid_rows = xr.full_like(idomain.y, 1).astype(np.int32).cumsum()
self.dataset["column"] = grid_cols.sel(x=self.dataset["x"], method="nearest")
self.dataset["row"] = grid_rows.sel(y=self.dataset["y"], method="nearest")
We should keep in mind that this selection might reverse the y axis to monotonically increasing (instead of monotonically decreasing)
Update:
We could also use the GeoDataframe as the data model for this package, with a shapely POINT
geometry. Makes it easier to do all kinds of spatial processing internally as well. We currently already have a geopandas dependency anyways, might as well utilize it better.
Edited by Joeri van Engelen