serialize_params_to_array#
- PySeismoSoil.helper_mkz_model.serialize_params_to_array(param: dict[str, float], *, to_files: bool = False) ndarray[source]#
Convert the MKZ parameters from a dictionary to an array.
The order is: gamma_ref, s, beta, Gmax.
- Parameters:
param (dict[str, float]) – A dictionary containing the parameters of the MKZ model.
to_files (bool, default=False) – Whether the result is for writing to files. If so, the last parameter, Gmax, is removed, and a dummy parameter, b, which is always 0, is inserted between gamma_ref and s. This is for historical reasons: the text files recognizable by MATLAB and Fortran functions have the convention of “gamma_ref, 0.0, s, beta”. If Gmax is not 1.0, a
UserWarningis issued, because the files cannot store it (it is read back as 1.0).
- Returns:
param_array – A numpy array of shape (4,) containing the parameters of the MKZ model in the order specified above.
- Return type:
np.ndarray