PySeismoSoil.helper_generic Module#

Generic helper functions.

Functions#

assert_1D_numpy_array(something[, name])

Assert that something is a 1D numpy array.

assert_2D_numpy_array(something[, name])

Assert that something is a 2D numpy array.

assert_array_length(something, length[, name])

Assert that something is a 1D of length length.

check_Vs_profile_format(data)

Check that data is in a valid format as a Vs profile.

check_length_or_extend_to_array(something, ...)

Check that something is a 1D numpy array with length length.

check_numbers_valid(array)

Check the contents in array is valid.

check_two_column_format(something[, name, ...])

Check that something is a 2D numpy array with two columns.

detect_OS()

Check which operating system is currently running.

extend_scalar(scalar, length)

"Extend" a scalar (float, int, or numpy.number type) into a 1D array.

extract_from_curve_format(curves, *[, ...])

Extract G/Gmax and damping curves from a "curve formatted" 2D numpy array.

extract_from_param_format(params)

Extract soil constitutive model parameters from a 2D numpy array.

find_closest_index(array, value)

Find the index in array of the value closest to value.

get_current_time(*[, for_filename])

Get current time as a string (e.g., 2001-01-01 23:59:59).

interpolate(x_query_min, x_query_max, n_pts, ...)

Interpolate data (x_ref and y_ref) at x query points.

is_int(number)

Check that a number represents an integer value.

mean_absolute_error(y_true, y_pred)

Calculate the mean absolute error between ground truth and prediction.

merge_curve_matrices(GGmax_matrix, xi_matrix)

Merge G/Gmax curves matrix and damping curves matrix.

read_two_column_stuff(data[, delta, sep])

Process "data" into a two-columned "data_".