gridmarthe.operasem

Functions

coarse_nested_grid(da[, varname, dx, dy])

Coarse nested grid to res of main grid only realy valid if nested grid resolution is a multiple of maingrid resolution coords needs to be assign first

get_mask(ds[, varname, nanval, fileout])

Filter dataset on non-nan values, and dissolve results to get a mask shape input ds should be the permh dataset (read from permh file, ie Horizontal hydraulic conductivity)

get_min_layer(ds[, aquif_layers])

Compute surface mask of marthe domain

get_new_coords(ds[, res])

Reset xy with a range from min to max, with res as step

interp_grid(da[, new_x, new_y, method])

Interpolate on a new grid using xarray.Dataset.interp

rescale(da[, res])

Wrapper function that uses get_new_coords() and interp_grid() together

search_zone(ds[, i, j, x, y, z])

search zone number in marthe grid, based on xy or ij (col, lig)

subset_with_coords(da[, dims, gdf, xmin, ...])

subset DataArray or Dataset with gpd.GeoDataFrame or bounds TODO: real shp clip

to_geodataframe(ds[, epsg, fmt])

Convert marthegrid.Dataset to a geodataframe fmt must be long or wide, default is long

write_raster_from_da(da[, x_dim, y_dim, ...])

Write a xr.DataArray to a raster file need xarray with rioxarray installed