def __init__(self, source_id, name, tectonic_region_type,
                 mfd, rupture_mesh_spacing,
                 magnitude_scaling_relationship, rupture_aspect_ratio,
                 # simple fault specific parameters
                 upper_seismogenic_depth, lower_seismogenic_depth,
                 fault_trace, dip, rake):
        super(SimpleFaultSource, self).__init__(
            source_id, name, tectonic_region_type, mfd, rupture_mesh_spacing,
            magnitude_scaling_relationship, rupture_aspect_ratio
        )

        NodalPlane.check_rake(rake)
        SimpleFaultSurface.check_fault_data(
            fault_trace, upper_seismogenic_depth, lower_seismogenic_depth,
            dip, rupture_mesh_spacing
        )
        self.fault_trace = fault_trace
        self.upper_seismogenic_depth = upper_seismogenic_depth
        self.lower_seismogenic_depth = lower_seismogenic_depth
        self.dip = dip
        self.rake = rake

        min_mag = self.mfd.get_min_mag()
        cols_rows = self._get_rupture_dimensions(float('inf'), float('inf'),
                                                 min_mag)
        if 1 in cols_rows:
            raise ValueError('mesh spacing %s is too low to represent '
                             'ruptures of magnitude %s' %
                             (rupture_mesh_spacing, min_mag))
    def test_upper_seismo_depth_range(self):
        self.assertRaises(ValueError, SimpleFaultSurface.check_fault_data,
                          self.fault_trace, -0.1, 10.0, 90.0, 1.0)

        SimpleFaultSurface.check_fault_data(self.fault_trace,
                                            0.0, 1.0, 90.0, 1.0)
        SimpleFaultSurface.check_fault_data(self.fault_trace,
                                            1.0, 1.1, 90.0, 1.0)
    def test_upper_seismo_depth_range(self):
        self.assertRaises(ValueError, SimpleFaultSurface.check_fault_data,
                          self.fault_trace, -0.1, 10.0, 90.0, 1.0)

        SimpleFaultSurface.check_fault_data(self.fault_trace,
                                            0.0, 1.0, 90.0, 1.0)
        SimpleFaultSurface.check_fault_data(self.fault_trace,
                                            1.0, 1.1, 90.0, 1.0)
    def test_mesh_spacing_range(self):
        SimpleFaultSurface.check_fault_data(self.fault_trace,
                                            0.0, 1.0, 90.0, 1.0)

        self.assertRaises(ValueError, SimpleFaultSurface.check_fault_data,
                          self.fault_trace, 0.0, 1.0, 90.0, 0.0)

        self.assertRaises(ValueError, SimpleFaultSurface.check_fault_data,
                          self.fault_trace, 0.0, 1.0, 90.0, -1.0)
    def test_mesh_spacing_range(self):
        SimpleFaultSurface.check_fault_data(self.fault_trace, 0.0, 1.0, 90.0,
                                            1.0)

        self.assertRaises(ValueError, SimpleFaultSurface.check_fault_data,
                          self.fault_trace, 0.0, 1.0, 90.0, 0.0)

        self.assertRaises(ValueError, SimpleFaultSurface.check_fault_data,
                          self.fault_trace, 0.0, 1.0, 90.0, -1.0)
Exemple #6
0
    def modify_set_dip(self, dip):
        """
        Modifies the dip to the specified value

        :param float dip:
            New value of dip (must still be within 0.0 to 90.0 degrees)
        """
        SimpleFaultSurface.check_fault_data(
            self.fault_trace, self.upper_seismogenic_depth,
            self.lower_seismogenic_depth, dip, self.rupture_mesh_spacing)
        self.dip = dip
    def modify_set_dip(self, dip):
        """
        Modifies the dip to the specified value

        :param float dip:
            New value of dip (must still be within 0.0 to 90.0 degrees)
        """
        SimpleFaultSurface.check_fault_data(
            self.fault_trace, self.upper_seismogenic_depth,
            self.lower_seismogenic_depth, dip, self.rupture_mesh_spacing)
        self.dip = dip
Exemple #8
0
    def modify_set_lower_seismogenic_depth(self, lsd):
        """
        Modifies the lower seismogenic depth

        :param float lsd:
            New value of the lsd [km]
        """
        SimpleFaultSurface.check_fault_data(
            self.fault_trace, self.upper_seismogenic_depth, lsd,
            self.dip, self.rupture_mesh_spacing)
        self.lower_seismogenic_depth = lsd
Exemple #9
0
    def modify_adjust_dip(self, increment):
        """
        Modifies the dip by an incremental value

        :param float increment:
            Value by which to increase or decrease the dip (the resulting
            dip must still be within 0.0 to 90.0 degrees)
        """
        SimpleFaultSurface.check_fault_data(
            self.fault_trace, self.upper_seismogenic_depth,
            self.lower_seismogenic_depth, self.dip + increment,
            self.rupture_mesh_spacing)
        self.dip += increment
    def modify_adjust_dip(self, increment):
        """
        Modifies the dip by an incremental value

        :param float increment:
            Value by which to increase or decrease the dip (the resulting
            dip must still be within 0.0 to 90.0 degrees)
        """
        SimpleFaultSurface.check_fault_data(
            self.fault_trace, self.upper_seismogenic_depth,
            self.lower_seismogenic_depth, self.dip + increment,
            self.rupture_mesh_spacing)
        self.dip += increment
    def test_dip_inside_range(self):
        self.assertRaises(ValueError, SimpleFaultSurface.check_fault_data,
                          self.fault_trace, 0.0, 1.0, 0.0, 1.0)

        self.assertRaises(ValueError, SimpleFaultSurface.check_fault_data,
                          self.fault_trace, 0.0, 1.0, -0.1, 1.0)

        self.assertRaises(ValueError, SimpleFaultSurface.check_fault_data,
                          self.fault_trace, 0.0, 1.0, 90.1, 1.0)

        SimpleFaultSurface.check_fault_data(self.fault_trace, 0.0, 1.0, 0.1,
                                            1.0)
        SimpleFaultSurface.check_fault_data(self.fault_trace, 0.0, 1.0, 90.0,
                                            1.0)
    def test_dip_inside_range(self):
        self.assertRaises(ValueError, SimpleFaultSurface.check_fault_data,
                          self.fault_trace, 0.0, 1.0, 0.0, 1.0)

        self.assertRaises(ValueError, SimpleFaultSurface.check_fault_data,
                          self.fault_trace, 0.0, 1.0, -0.1, 1.0)

        self.assertRaises(ValueError, SimpleFaultSurface.check_fault_data,
                          self.fault_trace, 0.0, 1.0, 90.1, 1.0)

        SimpleFaultSurface.check_fault_data(self.fault_trace,
                                            0.0, 1.0, 0.1, 1.0)
        SimpleFaultSurface.check_fault_data(self.fault_trace,
                                            0.0, 1.0, 90.0, 1.0)
Exemple #13
0
    def __init__(
        self,
        source_id,
        name,
        tectonic_region_type,
        mfd,
        rupture_mesh_spacing,
        magnitude_scaling_relationship,
        rupture_aspect_ratio,
        temporal_occurrence_model,
        # simple fault specific parameters
        upper_seismogenic_depth,
        lower_seismogenic_depth,
        fault_trace,
        dip,
        rake,
        hypo_list=(),
        slip_list=()):
        super(SimpleFaultSource,
              self).__init__(source_id, name, tectonic_region_type, mfd,
                             rupture_mesh_spacing,
                             magnitude_scaling_relationship,
                             rupture_aspect_ratio, temporal_occurrence_model)

        NodalPlane.check_rake(rake)
        SimpleFaultSurface.check_fault_data(fault_trace,
                                            upper_seismogenic_depth,
                                            lower_seismogenic_depth, dip,
                                            rupture_mesh_spacing)
        self.fault_trace = fault_trace
        self.upper_seismogenic_depth = upper_seismogenic_depth
        self.lower_seismogenic_depth = lower_seismogenic_depth
        self.dip = dip
        self.rake = rake

        min_mag, max_mag = self.mfd.get_min_max_mag()
        cols_rows = self._get_rupture_dimensions(float('inf'), float('inf'),
                                                 min_mag)
        self.slip_list = slip_list
        self.hypo_list = hypo_list

        if (len(self.hypo_list) and not len(self.slip_list)
                or not len(self.hypo_list) and len(self.slip_list)):
            raise ValueError('hypo_list and slip_list have to be both given '
                             'or neither given')

        if 1 in cols_rows:
            raise ValueError('mesh spacing %s is too high to represent '
                             'ruptures of magnitude %s' %
                             (rupture_mesh_spacing, min_mag))
Exemple #14
0
 def modify_set_geometry(self, fault_trace, upper_seismogenic_depth,
                         lower_seismogenic_depth, dip, spacing):
     """
     Modifies the current source geometry including trace, seismogenic
     depths and dip
     """
     # Check the new geometries are valid
     SimpleFaultSurface.check_fault_data(fault_trace,
                                         upper_seismogenic_depth,
                                         lower_seismogenic_depth, dip,
                                         spacing)
     self.fault_trace = fault_trace
     self.upper_seismogenic_depth = upper_seismogenic_depth
     self.lower_seismogenic_depth = lower_seismogenic_depth
     self.dip = dip
     self.rupture_mesh_spacing = spacing
 def modify_set_geometry(self, fault_trace, upper_seismogenic_depth,
                         lower_seismogenic_depth, dip, spacing):
     """
     Modifies the current source geometry including trace, seismogenic
     depths and dip
     """
     # Check the new geometries are valid
     SimpleFaultSurface.check_fault_data(
         fault_trace, upper_seismogenic_depth, lower_seismogenic_depth,
         dip, spacing
     )
     self.fault_trace = fault_trace
     self.upper_seismogenic_depth = upper_seismogenic_depth
     self.lower_seismogenic_depth = lower_seismogenic_depth
     self.dip = dip
     self.rupture_mesh_spacing = spacing
    def __init__(self, source_id, name, tectonic_region_type,
                 mfd, rupture_mesh_spacing,
                 magnitude_scaling_relationship, rupture_aspect_ratio,
                 temporal_occurrence_model,
                 # simple fault specific parameters
                 upper_seismogenic_depth, lower_seismogenic_depth,
                 fault_trace, dip, rake, hypo_list=(), slip_list=()):
        super(SimpleFaultSource, self).__init__(
            source_id, name, tectonic_region_type, mfd, rupture_mesh_spacing,
            magnitude_scaling_relationship, rupture_aspect_ratio,
            temporal_occurrence_model
        )

        NodalPlane.check_rake(rake)
        SimpleFaultSurface.check_fault_data(
            fault_trace, upper_seismogenic_depth, lower_seismogenic_depth,
            dip, rupture_mesh_spacing
        )
        self.fault_trace = fault_trace
        self.upper_seismogenic_depth = upper_seismogenic_depth
        self.lower_seismogenic_depth = lower_seismogenic_depth
        self.dip = dip
        self.rake = rake

        min_mag, max_mag = self.mfd.get_min_max_mag()
        cols_rows = self._get_rupture_dimensions(float('inf'), float('inf'),
                                                 min_mag)
        self.slip_list = slip_list
        self.hypo_list = hypo_list

        if (len(self.hypo_list) and not len(self.slip_list) or
           not len(self.hypo_list) and len(self.slip_list)):
            raise ValueError('hypo_list and slip_list have to be both given '
                             'or neither given')

        if 1 in cols_rows:
            raise ValueError('mesh spacing %s is too high to represent '
                             'ruptures of magnitude %s' %
                             (rupture_mesh_spacing, min_mag))
Exemple #17
0
    def __init__(
            self,
            source_id,
            name,
            tectonic_region_type,
            mfd,
            rupture_mesh_spacing,
            magnitude_scaling_relationship,
            rupture_aspect_ratio,
            # simple fault specific parameters
            upper_seismogenic_depth,
            lower_seismogenic_depth,
            fault_trace,
            dip,
            rake):
        super(SimpleFaultSource,
              self).__init__(source_id, name, tectonic_region_type, mfd,
                             rupture_mesh_spacing,
                             magnitude_scaling_relationship,
                             rupture_aspect_ratio)

        NodalPlane.check_rake(rake)
        SimpleFaultSurface.check_fault_data(fault_trace,
                                            upper_seismogenic_depth,
                                            lower_seismogenic_depth, dip,
                                            rupture_mesh_spacing)
        self.fault_trace = fault_trace
        self.upper_seismogenic_depth = upper_seismogenic_depth
        self.lower_seismogenic_depth = lower_seismogenic_depth
        self.dip = dip
        self.rake = rake

        min_mag = self.mfd.get_min_mag()
        cols_rows = self._get_rupture_dimensions(float('inf'), float('inf'),
                                                 min_mag)
        if 1 in cols_rows:
            raise ValueError('mesh spacing %s is too low to represent '
                             'ruptures of magnitude %s' %
                             (rupture_mesh_spacing, min_mag))
Exemple #18
0
 def test_upper_seismo_depth_range(self):
     SimpleFaultSurface.check_fault_data(self.fault_trace,
                                         0.0, 1.0, 90.0, 1.0)
     SimpleFaultSurface.check_fault_data(self.fault_trace,
                                         1.0, 1.1, 90.0, 1.0)
 def test_upper_seismo_depth_range(self):
     SimpleFaultSurface.check_fault_data(self.fault_trace, 0.0, 1.0, 90.0,
                                         1.0)
     SimpleFaultSurface.check_fault_data(self.fault_trace, 1.0, 1.1, 90.0,
                                         1.0)