GGmax_Curve#

class PySeismoSoil.class_curves.GGmax_Curve(data: ndarray, *, strain_unit: Literal['1', '%'] = '%', interpolate: bool = False, min_strain: float = 0.0001, max_strain: float = 10.0, n_pts: int = 50, log_scale: bool = True, check_values: bool = True)[source]#

Bases: Curve

Class implementation of a G/Gmax curve, as a function of shear strain.

Parameters:
  • data (np.ndarray) – A 2D numpy array with 2 columns. Its 0th column contains the strain array, and the 1st column contains the G/Gmax values.

  • strain_unit (Literal['1', '%']) – The unit of the strain.

  • interpolate (bool) – Whether to interpolate the input curve or not. If False, the following several parameters (min_strain, max_strain, n_pts, log_scale) have no effects.

  • min_strain (float) – Minimum strain value of the strain array. If interpolate is True, the raw data will be internally interpolated at a strain array defined by min_strain, max_strain, and n_pts.

  • max_strain (float) – Maximum strain value of the strain array. Only effective when interpolate is set to True.

  • n_pts (int) – Number of points of the desired strain array to do the interpolation. Only effective when interpolate is set to True.

  • log_scale (bool) – Whether the strain array for interpolation is in log scale (or linear scale). Only effective when interpolate is set to True.

  • check_values (bool) – Whether to automatically check the validity of the G/Gmax values (i.e., between 0 and 1).

raw_data#

The raw data that the user passed in.

Type:

np.ndarray

strain#

The strain array at which interpolation happens, a 1D numpy array of shape (n_pts, ). The unit is percent (unit conversion happens internally if applicable).

Type:

np.ndarray

GGmax#

The interpolated G/Gmax values; same shape as strain.

Type:

np.ndarray

Raises:

ValueError – When the provided G/Gmax values are not within [0, 1]

Methods Summary

plot([plot_interpolated, fig, ax, title, ...])

Plot the curve (y axis: values, x axis: strain)

Methods Documentation

plot(plot_interpolated: bool = True, fig: matplotlib.figure.Figure | None = None, ax: matplotlib.axes._axes.Axes | None = None, title: str | None = None, xlabel: str | None = 'Strain [%]', ylabel: str | None = None, figsize: tuple[float, float] = (3, 3), dpi: float = 100, **kwargs_to_matplotlib: dict[Any, Any]) tuple[matplotlib.figure.Figure, matplotlib.axes._axes.Axes]#

Plot the curve (y axis: values, x axis: strain)

Parameters:
  • plot_interpolated (bool) – Whether to plot the interpolated curve or the raw data.

  • fig (Figure | None) – Figure object. If None, a new figure will be created.

  • ax (Axes | None) – Axes object. If None, a new axes will be created.

  • title (str | None) – Title of plot.

  • xlabel (str | None) – X label of plot.

  • ylabel (str | None) – Y label of plot.

  • figsize (tuple[float, float]) – Figure size in inches, as a tuple of two numbers. The figure size of fig (if not None) will override this parameter.

  • dpi (float) – Figure resolution. The dpi of fig (if not None) will override this parameter.

  • **kwargs_to_matplotlib (dict[Any, Any]) – Keyword arguments to be passed to matplotlib.pyplot.plot().

Returns:

  • fig (Figure) – The figure object being created or being passed into this function.

  • ax (Axes) – The axes object being created or being passed into this function.