deserialize_array_to_params#

PySeismoSoil.helper_mkz_model.deserialize_array_to_params(array: ndarray, from_files: bool = False) dict[str, float][source]#

Reconstruct a MKZ model parameter dictionary from an array of values.

The users need to ensure the order of values in array are in this order:

gamma_ref, s, beta, Gmax (if from_files is False)

or:

gamma_ref, b, s, beta (if from_files is True)

(b is always 0, for historical reasons)

Parameters:
  • array (np.ndarray) –

    A 1D numpy array of MKZ parameter values in this order:

    gamma_ref, s, beta, Gmax

  • from_files (bool) – Whether the array was directly imported from a “H4_x_SITE_NAME.txt” file. If so, the 1st (0-based indexing) element, “b”, which is always 0, is neglected, and a dummy Gmax value (1.0) is padded at the end. The presence of “b” is due to historical reasons.

Returns:

param – The dictionary with parameter name as keys and values as values.

Return type:

dict[str, float]