PySeismoSoil.helper_generic Module#

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 (i.e., 2D numpy array, two or five columns, non-negative or positive values, etc.)

check_length_or_extend_to_array(something, ...)

Check that something is a 1D numpy array with length length, or if something is a single value, extend it to a 1D numpy array whose length is length and elements are all something.

check_numbers_valid(array)

Check the contents in array is valid (i.e., are numbers, are not infinite, are positive).

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 numpy array whose length is length and whose elements are all scalar.

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 corresponding to the value closest to the given 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 defined by x_query_min, x_query_max, and n_pts.

is_int(number)

Check that a number represents an integer value.

mean_absolute_error(y_true, y_pred)

Calculate the mean squared 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_".