extract_from_curve_format#
- PySeismoSoil.helper_generic.extract_from_curve_format(curves: ndarray, ensure_non_negative: bool = True) tuple[list[numpy.ndarray], list[numpy.ndarray]] [source]#
Extract G/Gmax and damping curves from a “curve formatted” 2D numpy array. All G/Gmax curves are organized into a list, and all damping curves are organized into another list.
- Parameters:
curves (np.ndarray) –
A 2D numpy array that follows the following format:
strain [%]
G/Gmax
strain [%]
damping [%]
strain [%]
G/Gmax
…
…
…
…
…
…
…
…
Such an array can be constructed by hand, or by directly imported from a “curve_STATION_NAME.txt” file.
ensure_non_negative (bool) – If
True
, raise an exception if there exists at least one negative G/Gmax value or damping value in the data incurves
.
- Returns:
GGmax_curves_list (list[np.ndarray]) – The parsed G/Gmax curves. Each element in the list is a 2D numpy array with 2 columns (strain and G/Gmax). The units are shown in the above table.
damping_curves_list (list[np.ndarray]) – The parsed damping curves. Each element in the list is a 2D numpy array with 2 columns (strain and damping). The units are shown in the above table.
- Raises:
TypeError – When the input has unexpected type
ValueError – When the input has unexpected value