gridmarthe.plot_outcrop

gridmarthe.plot_outcrop(ds_outcrop, file_out=None, engine='xr', show=False)[source]

Usefull function to plot outcrop layers of a marthe (multilayer) grid

There is two mode implementend yet, using xr.plot or gpd.plot (useful for nested grid)

if engine == ‘xr’ => ds_outcrop need to get coords before

(use gm.assign_coords(ds_outcrop, add_lay=False))

if engine == ‘gpd => ds_outcrop need to be a gpd.GeoDataframe

(use gm.to_geodataframe(ds_outcrop))

nb: The Marthe grid must have a z dimension.

Parameters:
  • ds_outcrop (xr.Dataset) – output of gm.get_surface_mask()

  • file_out (str, Optionnal.) – If not None (default), file name to write plot

  • engine (str, Optionnal.) – Engine to use for plotting (default is xr).

  • show (bool, Optionnal.) – Show result (plt.show()), default is False.

Returns:

fig, ax, ax_cbar if not show, otherwise return None