ocmw.core.graphics module

Functions to generate standardiszed graphics from data generated by various OCMW processes.

plotMesh

Plot an unstrcutured triangular mesh from node coordinates and elements list.

plotMeshField

Plot a 2D flow parameter defined at either the mesh nodes or element centroids as a colourised mesh field.

plot_validation_stats

Plot validation statistics as a correlation plot plus a list of metrics.

flow_class_diagram

Plot a flow ccharacterisation diagram based on the preprocessed timeseries data.

speed_bin_histograms

Plot a flow speed bin histograms for flood and ebb tides.

directional_spread_plot

Plot a flow directional spread histograms for flood and ebb tides.

plot_time_series

Overlaid plot of model and observed time series of specified parameter for WW3 model validation.

plot_correlation

Plot a WW3 validation statistics as a correlation plot plus metrics.

Regional_Weighted

Regional map of parameters at specific locations colourised by a wieghting factor.

Regional

Regional map of specific locations.

plot_1d_wave_spec

Plot of a 1-D wave frequency spectrum

plot_2d_wave_spec

Plot of a 2-D wave frequency spectrum

Functions to generate standardiszed graphics from data generated by various OCMW processes.

ocmw.core.graphics.gen_parula_cmap()[source]

Generate matlab parula Colour map for matplotlib

ocmw.core.graphics.plotMesh(x, y, elems, figsize=(9, 6), UTM=True)[source]

Plot an unstrcutured triangular mesh from node coordinates and elements list.

Parameters:
  • x (numpy.array, float) – x-coordinate of mesh nodes.

  • y (numpy.array, float) – y-coordinate of mesh nodes.

  • elems (numpy.array, integer) – triangular element corner nodes.

  • figsize (tuple, float, optional) – Figure size in inches. The default is (9,6).

  • UTM (bool, optional) – Flag for CRS of node coordinates (True=UTM or False=WGS84) . The default is True.

Returns:

figHnd (obj) – Handle to the figure object created.

ocmw.core.graphics.plotMeshField(mesh, vals, figsize=(12.0, 4.8), vmin=None, vmax=None, titleStr='', unitStr='', colormap=None, show_cbar=False, cbar_width='1.5%', sub_reg=None, ismesh=False)[source]

Plot a 2D flow parameter defined at either the mesh nodes or element centroids as a colourised mesh field.

ocmw.core.graphics.plot_validation_stats(obs, mod, metrics, paramStr, unitStr, min_val, max_val, info)[source]

Plot validation statistics as a correlation plot plus a list of metrics.

ocmw.core.graphics.flow_class_diagram(data, tec=None, velmax=None)[source]

Plot a flow ccharacterisation diagram based on the preprocessed timeseries data.

ocmw.core.graphics.speed_bin_histograms(data, tec=None, binwidth=0.2, maxfrac=0.2, maxspd=4.5, gethist=False)[source]

Plot a flow speed bin histograms for flood and ebb tides.

ocmw.core.graphics.directional_spread_plot(data)[source]

Plot a flow directional spread histograms for flood and ebb tides.

ocmw.core.graphics.plot_time_series(t_mod, v_mod, t_obs, v_obs, obsVar, obsPlatform, modVar, modfname, year, month, xlims=None, ylims=None)[source]

Overlaid plot of model and observed time series of specified parameter for WW3 model validation.

ocmw.core.graphics.plot_correlation(obs, model, obsVar, obsPlatform, modVar, modfname, year, month, metrics)[source]

Plot a WW3 validation statistics as a correlation plot plus metrics.

ocmw.core.graphics.plot_close(figHnd)[source]
ocmw.core.graphics.Regional_Weighted(lat: list, lon: list, wght: list, plot_area: list, clims: list, plotTitle: str, outpath: str, outname: str, saveplot: bool)[source]

Regional map of parameters at specific locations colourised by a wieghting factor.

ocmw.core.graphics.Regional(lat: list, lon: list, plot_area: list, lat_div: list, lon_div: list, outpath: str, outname: str, saveplot: bool)[source]

Regional map of specific locations.

ocmw.core.graphics.plot_1d_wave_spec(freq, spec1D, titleStr: str | None = None, outpath: str = './', outname: str = 'spec_1d', saveplot: bool = False)[source]

Plot of a 1-D wave frequency spectrum

ocmw.core.graphics.plot_2d_wave_spec(freq, ntheta, spec2D, fmax: float = 0.25, cmax: float = 2.0, titleStr: str | None = None)[source]

Plot of a 2-D wave frequency spectrum

ocmw.core.graphics.plot_speedbinned_velocities(magn3D, z, indices, cntrs)[source]

Plot speed binned velocity data