Пример #1
0
    def test_area_with_tgr_mfd(self):
        area_mfd = nrml_models.TGRMFD(a_val=-3.5, b_val=1.0,
                                      min_mag=5.0, max_mag=6.5)
        self.area_source_attrib['mfd'] = area_mfd

        area_source = nrml_models.AreaSource(**self.area_source_attrib)

        # Re-scaled MFD for the points
        point_mfd = nrml_models.TGRMFD(a_val=-4.1020599913279625, b_val=1.0,
                                       min_mag=5.0, max_mag=6.5)
        for exp in self.expected:
            exp.mfd = point_mfd

        actual = list(source_input.area_source_to_point_sources(area_source,
                                                                100))
        equal, err = helpers.deep_eq(self.expected, actual)
        self.assertTrue(equal, err)
Пример #2
0
    def test_area_with_incr_mfd(self):
        area_mfd = nrml_models.IncrementalMFD(min_mag=6.55,
                                              bin_width=0.1,
                                              occur_rates=[0.1, 0.2, 0.3, 0.4])
        self.area_source_attrib['mfd'] = area_mfd

        area_source = nrml_models.AreaSource(**self.area_source_attrib)

        # Re-scaled MFD for the points
        point_mfd = nrml_models.IncrementalMFD(
            min_mag=6.55, bin_width=0.1, occur_rates=[0.025, 0.05, 0.075, 0.1])

        for exp in self.expected:
            exp.mfd = point_mfd

        actual = list(
            source_input.area_source_to_point_sources(area_source, 100))
        equal, err = helpers.deep_eq(self.expected, actual)
        self.assertTrue(equal, err)
Пример #3
0
    def test_area_with_incr_mfd(self):
        area_mfd = nrml_models.IncrementalMFD(
            min_mag=6.55, bin_width=0.1, occur_rates=[0.1, 0.2, 0.3, 0.4]
        )
        self.area_source_attrib['mfd'] = area_mfd

        area_source = nrml_models.AreaSource(**self.area_source_attrib)

        # Re-scaled MFD for the points
        point_mfd = nrml_models.IncrementalMFD(
            min_mag=6.55, bin_width=0.1, occur_rates=[0.025, 0.05, 0.075, 0.1]
        )

        for exp in self.expected:
            exp.mfd = point_mfd

        actual = list(source_input.area_source_to_point_sources(area_source,
                                                                100))
        equal, err = helpers.deep_eq(self.expected, actual)
        self.assertTrue(equal, err)
Пример #4
0
    def test_area_with_tgr_mfd(self):
        area_mfd = nrml_models.TGRMFD(a_val=-3.5,
                                      b_val=1.0,
                                      min_mag=5.0,
                                      max_mag=6.5)
        self.area_source_attrib['mfd'] = area_mfd

        area_source = nrml_models.AreaSource(**self.area_source_attrib)

        # Re-scaled MFD for the points
        point_mfd = nrml_models.TGRMFD(a_val=-4.1020599913279625,
                                       b_val=1.0,
                                       min_mag=5.0,
                                       max_mag=6.5)
        for exp in self.expected:
            exp.mfd = point_mfd

        actual = list(
            source_input.area_source_to_point_sources(area_source, 100))
        equal, err = helpers.deep_eq(self.expected, actual)
        self.assertTrue(equal, err)