BFM Plots#

Hydrological_model_validator.Plotting.bfm_plots.Benthic_chemical_plot(var_dataframe, geo_coord, location=None, **kwargs)[source]#

Plot benthic variable maps (e.g., temperature, chlorophyll) across all years and months.

Parameters:
  • var_dataframe (dict) – Dict of years (int), each containing a list of 12 monthly 2D arrays (Y, X).

  • geo_coord (dict) – Dictionary with geolocalized coordinates, keys: - ‘lonp’ (2D array of longitudes) - ‘latp’ (2D array of latitudes)

  • location (str or None, optional) – Optional location string to include in plot titles (default is None).

Keyword Arguments:
  • bfm2plot (str, optional) – Variable name to plot (default is ‘votemper’).

  • unit (str, optional) – Unit of measurement (default is ‘°C’).

  • description (str, optional) – Variable description for plot titles (default is ‘Bottom Temperature’).

  • output_path (str or Path, optional) – Directory to save output plots (default is ‘output’).

  • epsilon (float, optional) – Coordinate offset applied to lon/lat (default is 0.06).

  • figsize (tuple of float, optional) – Size of each figure in inches (default is (10, 10)).

  • dpi (int, optional) – Resolution of saved figures (default is 150).

  • coastline_linewidth (float, optional) – Width of coastlines (default is 2).

  • border_linestyle (str, optional) – Country border linestyle (default is ‘:’).

  • gridline_color (str, optional) – Color of gridlines (default is ‘gray’).

  • gridline_linestyle (str, optional) – Gridline linestyle (default is ‘–‘).

  • title_fontsize (int, optional) – Font size for plot titles (default is 16).

  • title_fontweight (str, optional) – Font weight for titles (default is ‘bold’).

  • colorbar_position (list, optional) – Colorbar axes [left, bottom, width, height] (default is [0.175, 0.175, 0.65, 0.025]).

  • colorbar_labelsize (int, optional) – Font size for colorbar label (default is 14).

  • colorbar_tick_length (int, optional) – Length of colorbar ticks (default is 18).

  • colorbar_tick_labelsize (int, optional) – Font size for colorbar tick labels (default is 10).

Hydrological_model_validator.Plotting.bfm_plots.Benthic_depth(Bmost: ndarray, geo_coords: dict, output_path: Path, **user_opts: Any) None[source]#

Plot the benthic layer depth from a 2D bottom index array using Cartopy, with geolocalized coordinates for spatial referencing.

Parameters:
  • Bmost (np.ndarray) – 2D array with bottom layer indices.

  • geo_coords (dict) – Dictionary with geolocalized coordinates and extents, including keys: - ‘latp’, ‘lonp’ : 2D arrays of latitudes and longitudes. - ‘Epsilon’ : Float, spatial offset for plotting. - ‘MinLambda’, ‘MaxLambda’ : Longitude bounds for extent. - ‘MinPhi’, ‘MaxPhi’ : Latitude bounds for extent.

  • output_path (str or Path) – Required. Directory path where the figure PNG will be saved.

Keyword Arguments:
  • figsize (tuple of float, optional) – Size of the figure in inches (default: (10, 10)).

  • projection (str, optional) – Cartopy projection name as string (default: “PlateCarree”).

  • contour_levels (int, optional) – Number of contour levels (default: 26).

  • cmap (str or Colormap, optional) – Colormap to use for the contour plot (default: “jet”).

  • contour_extend (str, optional) – Extend option for contour (‘both’, ‘neither’, etc., default: “both”).

  • coastline_linewidth (float, optional) – Line width of coastlines (default: 1.5).

  • borders_linestyle (str, optional) – Line style for country borders (default: “:”).

  • gridline_color (str, optional) – Color of grid lines (default: “gray”).

  • gridline_linestyle (str, optional) – Line style of grid lines (default: “–“).

  • grid_draw_labels (bool, optional) – Whether to draw grid labels (default: True).

  • grid_dms (bool, optional) – Display grid labels in degrees, minutes, seconds (default: True).

  • grid_x_inline (bool, optional) – Whether x-axis grid labels are inline (default: False).

  • grid_y_inline (bool, optional) – Whether y-axis grid labels are inline (default: False).

  • colorbar_width (float, optional) – Width of the colorbar (default: 0.65).

  • colorbar_height (float, optional) – Height of the colorbar (default: 0.025).

  • colorbar_left (float or None, optional) – Left position of the colorbar axes (default: None, computed automatically).

  • colorbar_bottom (float, optional) – Bottom position of the colorbar axes (default: 0.175).

  • colorbar_label (str, optional) – Label for the colorbar (default: “[m]”).

  • colorbar_labelsize (int, optional) – Font size for colorbar label (default: 12).

  • colorbar_tick_length (int, optional) – Length of colorbar ticks (default: 18).

  • colorbar_tick_labelsize (int, optional) – Font size for colorbar tick labels (default: 10).

  • colorbar_ticks (list or None, optional) – List of ticks on colorbar (default: None, computed automatically).

  • spine_linewidth (float, optional) – Line width for plot spines (default: 2).

  • spine_edgecolor (str, optional) – Edge color for plot spines (default: “black”).

  • title (str, optional) – Title of the plot (default: “Benthic Layer Depth”).

  • title_fontsize (int, optional) – Font size of the title (default: 16).

  • title_fontweight (str, optional) – Font weight of the title (default: “bold”).

  • dpi (int, optional) – DPI resolution for saved figure (default: 150).

  • filename (str, optional) – Filename for saved plot (default: “NA - Benthic Depth.png”).

Hydrological_model_validator.Plotting.bfm_plots.Benthic_physical_plot(var_dataframe: dict, geo_coord: dict, **kwargs) None[source]#

Plot monthly benthic physical variable maps (e.g., temperature, salinity) across years.

Parameters:
  • var_dataframe (dict) – Dictionary with years as keys (int), each containing a list of 12 monthly 2D arrays (shape: [Y, X]).

  • geo_coord (dict) – Dictionary with 2D coordinate arrays: - ‘lonp’ : 2D array of longitudes. - ‘latp’ : 2D array of latitudes.

Keyword Arguments:
  • bfm2plot (str, optional) – Variable name to plot (default is ‘votemper’).

  • unit (str, optional) – Unit of measurement (default is ‘°C’).

  • description (str, optional) – Variable description for plot title (default is ‘Bottom Temperature’).

  • output_path (str or Path, optional) – Directory to save output plots (default is ‘output’).

  • figsize (tuple of float, optional) – Size of each figure in inches (default is (10, 10)).

  • dpi (int, optional) – Resolution of saved figures (default is 150).

  • coastline_linewidth (float, optional) – Width of coastlines (default is 2).

  • border_linestyle (str, optional) – Country border linestyle (default is ‘:’).

  • gridline_color (str, optional) – Color of gridlines (default is ‘gray’).

  • gridline_linestyle (str, optional) – Gridline linestyle (default is ‘–‘).

  • title_fontsize (int, optional) – Font size for plot title (default is 16).

  • title_fontweight (str, optional) – Font weight for title (default is ‘bold’).

  • colorbar_position (list, optional) – Colorbar axes [left, bottom, width, height] (default is [0.175, 0.175, 0.65, 0.025]).

  • colorbar_labelsize (int, optional) – Label font size for colorbar (default is 14).

  • colorbar_tick_length (int, optional) – Tick length for colorbar (default is 18).

  • colorbar_tick_labelsize (int, optional) – Font size of tick labels (default is 10).

Hydrological_model_validator.Plotting.bfm_plots.dense_water_timeseries(data_lists: Dict[str, List[dict]], title: str = 'Dense Water Volume Time Series', xlabel: str = 'Time', ylabel: str = 'Dense Water Volume (km³)', figsize: tuple = (14, 6), legend_loc: str = 'best', date_format: str = '%Y-%m', output_path=None)[source]#

Plots a time series of dense water volumes for multiple data series.

Parameters:
  • data_lists (dict) – Dictionary with keys as series labels and values as lists of dicts with ‘date’ and ‘volume_m3’.

  • title (str) – Plot title.

  • xlabel (str) – X-axis label (date).

  • ylabel (str) – Y-axis label (km³).

  • figsize (tuple) – Figure size.

  • legend_loc (str) – Location of legend.

  • date_format (str) – Date format for x-axis labels.

Hydrological_model_validator.Plotting.bfm_plots.plot_benthic_3d_mesh(Bmost, geo_coords, layer_thickness=2, plot_type='surface', save_path=None)[source]#

Plot a 3D surface or mesh of benthic depth with interactive rotation.

Parameters:
  • Bmost (np.ndarray (2D)) – Array of bottom layer indices.

  • geo_coords (dict) – Dictionary containing: - ‘latp’ : 2D array of latitudes. - ‘lonp’ : 2D array of longitudes.

  • layer_thickness (float, optional) – Thickness of each depth layer in meters (default: 2).

  • plot_type (str, optional) – Type of 3D plot: ‘surface’ or ‘mesh3d’ (default: ‘surface’).

  • save_path (str or Path, optional) – Directory path where the interactive HTML plot will be saved.