Useful functions

dropna(ds, nanval[, varname])

Drop values corrresponding to NaN (marthe convention, eg.

fillna(ds, value[, varname])

Replace real nan (np.nan) value in dataset[varname], edge case of gridmarthe.replace()

subset(ds, value[, varname])

Subset dataset based on variable name and value.

replace(ds, value, replace[, varname])

Replace a value in xr.Dataset for a variable

assign_coords(ds[, add_lay, coords, ...])

Assign coordinates from variables to dimensions

stack_coords(ds[, coords, dropna])

Transform a 3 or 4D aray into 1 or 2D array inverse of assign_coords()

read_dates_from_pastp(fpastp[, encoding])

Read simulation timesteps from a .pastp file

get_dims_from_attrs(ds)

Get Marthe grid dimensions from Dataset attributes

sel_by_coords(ds[, x, y, z, method, ...])

Filter a 1D flattened xarray Dataset by spatial (x, y) and/or z ranges.

slice_cross_section(grid[, x, y, agg_along_axis])

grid needs geom infos and to have x,y as dimension.