roms_tools.InitialConditionsSource.plot

roms_tools.InitialConditionsSource.plot#

InitialConditionsSource.plot(var_name: str, s: int | None = None, eta: int | None = None, xi: int | None = None, depth_contours: bool = False, layer_contours: bool = False, ax: Axes | None = None, save_path: str | None = None) None#

Plot the initial conditions field for a given eta-, xi-, or s_rho- slice.

Parameters:
  • var_name (str) –

    The name of the initial conditions field to plot. Format:

    ”{base_var_name}_{direction}” ,

    where {base_var_name} is a physical, BGC, or other boundary tracer name, and {direction} is one of [“south”, “east”, “north”, “west”].

  • s (int, optional) – The index of the vertical layer (s_rho) to plot. If not specified, the plot will represent a horizontal slice (eta- or xi- plane). Default is None.

  • eta (int, optional) – The eta-index to plot. Used for vertical sections or horizontal slices. Default is None.

  • xi (int, optional) – The xi-index to plot. Used for vertical sections or horizontal slices. Default is None.

  • depth_contours (bool, optional) – If True, depth contours will be overlaid on the plot, showing lines of constant depth. This is typically used for plots that show a single vertical layer. Default is False.

  • layer_contours (bool, optional) – If True, contour lines representing the boundaries between vertical layers will be added to the plot. This is particularly useful in vertical sections to visualize the layering of the water column. For clarity, the number of layer contours displayed is limited to a maximum of 10. Default is False.

  • ax (matplotlib.axes.Axes, optional) – The axes to plot on. If None, a new figure is created. Note that this argument is ignored for 2D horizontal plots. Default is None.

  • save_path (str, optional) – Path to save the generated plot. If None, the plot is shown interactively. Default is None.

Returns:

None – This method does not return any value. It generates and displays a plot.

Raises:

ValueError – If the specified var_name is not one of the valid options. If the field specified by var_name is 3D and none of s, eta, or xi are specified. If the field specified by var_name is 2D and both eta and xi are specified.