Esempio n. 1
0
 def test_instantiation(self):
     min_mag = 0.0
     max_mag = 7.0
     bin_width = 0.01
     b_val = 1.0
     moment_rate = 4.5e16
     mfd = TruncatedGRMFD.from_moment(min_mag, max_mag, bin_width, b_val,
                                      moment_rate)
     rates = np.array(mfd.get_annual_occurrence_rates())
     computed = np.sum(10**(1.5 * rates[:, 0] + 9.1) * rates[:, 1])
     msg = "Scalar Mo rate from MFD does not match the original one"
     self.assertAlmostEqual(moment_rate, computed, msg=msg, delta=1e14)