GOF_Scores#

class PySeismoSoil.class_gof_scores.GOF_Scores(measurement: ndarray, simulation: ndarray)[source]#

Bases: object

Class implementation of the goodness-of-fit scoring.

Parameters:
  • measurement (np.ndarray) – A 2D numpy array with 2 columns. The 0th column contains the time in seconds, and the 1st column contains an acceleration time series.

  • simulation (np.ndarray) – A 2D numpy array with 2 columns. The 0th column contains the time in seconds, and the 1st column contains an acceleration time series.

measurement#

Same as measurement parameter.

Type:

np.ndarray

simulation#

Same as simulation parameter.

Type:

np.ndarray

scores#

When calc_scores() has been run, holds the computed goodness-of-fit scores.

Type:

np.ndarray

Raises:

TypeError – When measurement and simulation time series are not the same length.

Methods Summary

calc_scores([fmin, fmax, score_arias, ...])

Calculate the goodness-of-fit scores with the given measurement and simulation time series.

get_meas()

Return two-column measurement array, where the first column is time.

get_scores()

Return entire score array, with 'None' for scores that haven't been calculated.

get_simu()

Return two-column simulation array, where the first column is time.

Methods Documentation

calc_scores(fmin: float | None = None, fmax: float | None = None, *, score_arias: bool = True, score_rms: bool = True, score_spectra: bool = True, score_cross_correlation: bool = False, baseline: bool = True, verbose: bool = False, show_fig: bool = False) ndarray[source]#

Calculate the goodness-of-fit scores with the given measurement and simulation time series.

Parameters:
  • fmin (float | None) – Minimum frequency to be considered, in units of Hz. Default is (sampling frequency)/(length of time series).

  • fmax (float | None) – Maximum frequency to be considered, in units of Hz. Default is (sampling frequency)/2.0.

  • score_arias (bool) – Whether or not to compute the arias intensity and energy integral group of scores.

  • score_rms (bool) – Whether or not to compute the RMS group of scores.

  • score_spectra (bool) – Whether or not to compute the FAS and spectral acceleration group of scores.

  • score_cross_correlation (bool) – Whether or not to compute the cross-correlation score. Only recommended if the measurement and simulation time series being compared are identical in start time.

  • baseline (bool) – Whether or not to perform baseline correction of the time series.

  • verbose (bool) – Whether or not to print output information.

  • show_fig (bool) – Whether or not to plot.

Returns:

scores – A vector containing the goodness-of-fit scores, in the following order: [d1, d2, d3, d4, d5, d6, d7, d8, d9, d10] If the score hasn’t been calculated, it will be omitted from the returned array.

Return type:

np.ndarray

Raises:

ValueError – If fmax is larger than fmin.

get_meas() ndarray[source]#

Return two-column measurement array, where the first column is time.

get_scores() ndarray[source]#

Return entire score array, with ‘None’ for scores that haven’t been calculated.

get_simu() ndarray[source]#

Return two-column simulation array, where the first column is time.