gerg_plotting.data_classes.bathy#
Module Contents#
- class gerg_plotting.data_classes.bathy.Bathy#
Bathy class for handling bathymetry data and visualization.
Attributes#
- latIterable | Variable | None
Latitude values or Variable object containing latitude data
- lonIterable | Variable | None
Longitude values or Variable object containing longitude data
- depthIterable | Variable | None
Depth values or Variable object containing depth data
- timeIterable | Variable | None
Time values or Variable object containing temporal data
- boundsBounds
Object containing spatial and vertical boundaries for the dataset.
- resolution_levelfloat or int, optional
Degree resolution for coarsening the dataset, default is 5.
- contour_levelsint, optional
Number of contour levels for visualization, default is 50.
- land_colorlist
RGBA color values for representing land, default is [231/255, 194/255, 139/255, 1].
- vminfloat or int, optional
Minimum value for the colormap, default is 0.
- cmapColormap
Colormap for bathymetry visualization, default is ‘Blues’.
- cbar_showbool
Whether to display a colorbar, default is True.
- cbarmatplotlib.colorbar.Colorbar
Colorbar for the bathymetry visualization.
- cbar_nbinsint
Number of bins for colorbar ticks, default is 5.
- cbar_kwargsdict
Additional keyword arguments for the colorbar.
- center_of_masstuple
Center of mass of the bathymetry data (longitude, latitude, depth).
- labelstr
Label for the bathymetry data, default is ‘Bathymetry’.
- add_colorbar(fig: matplotlib.figure.Figure, divider, mappable: matplotlib.axes.Axes, nrows: int) None#
Add a colorbar to the figure.
Parameters#
- figmatplotlib.figure.Figure
The figure to which the colorbar is added.
- dividerAxesDivider
Divider to place the colorbar appropriately.
- mappablematplotlib.axes.Axes
The mappable object (e.g., image or contour plot).
- nrowsint
Number of rows in the figure layout.
Returns#
- matplotlib.colorbar.Colorbar
The created colorbar instance.
- adjust_cmap() None#
Adjust the colormap by cropping and adding land color.
- cbar: matplotlib.colorbar.Colorbar#
- cbar_kwargs: dict#
- cbar_nbins: int#
- cbar_show: bool#
- property center_of_mass#
Property to compute and return center of mass.
- property cmap#
Property to return adjusted colormap.
- contour_levels: int#
- copy()#
Creates a deep copy of the instrument object.
- property depth#
Property to handle scaled depth values.
- get_bathy() tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]#
Load and process bathymetry data.
Returns#
- tuple of np.ndarray
Longitude, latitude, and depth values.
Raises#
- ValueError
If the bounds attribute is not provided.
- get_vars() list#
Gets a list of all available variables.
- property label#
Property to handle label with units.
- land_color: list#
- property lat#
Property to handle latitude values.
- property lon#
Property to handle longitude values.
- resolution_level: float | int | None#
- vmin: int | float#