roms_tools.TidalForcing.plot

roms_tools.TidalForcing.plot#

TidalForcing.plot(var_name: str, ntides: int = 0, save_path: str | None = None) None#

Plot the specified tidal forcing variable for a given tidal constituent.

Parameters:
  • var_name (str) –

    The tidal forcing variable to plot. Options include:

    • ”ssh_Re”: Real part of tidal elevation.

    • ”ssh_Im”: Imaginary part of tidal elevation.

    • ”pot_Re”: Real part of tidal potential.

    • ”pot_Im”: Imaginary part of tidal potential.

    • ”u_Re”: Real part of tidal velocity in the x-direction.

    • ”u_Im”: Imaginary part of tidal velocity in the x-direction.

    • ”v_Re”: Real part of tidal velocity in the y-direction.

    • ”v_Im”: Imaginary part of tidal velocity in the y-direction.

  • ntides (int, optional) – The index of the tidal constituent to plot. Default is 0, which corresponds to the first constituent.

  • 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 field is not one of the valid options.

Examples

>>> tidal_forcing = TidalForcing(grid)
>>> tidal_forcing.plot("ssh_Re", ntides=0)