def read_fault_geometry(self, geo_dict, mesh_spacing=1.0):
        '''
        Creates the fault geometry from the parameters specified in the
        dictionary.

        :param dict geo_dict:
            Sub-dictionary of main fault dictionary containing only
            the geometry attributes
        :param float mesh_spacing:
            Fault mesh spacing (km)
        :returns:
            Instance of SimpleFaultGeometry or ComplexFaultGeometry, depending
            on typology
        '''
        if geo_dict['Fault_Typology'] == 'Simple':
            # Simple fault geometry
            raw_trace = geo_dict['Fault_Trace']
            trace = Line([Point(raw_trace[ival], raw_trace[ival + 1])
                          for ival in range(0, len(raw_trace), 2)])
            geometry = SimpleFaultGeometry(trace,
                                           geo_dict['Dip'],
                                           geo_dict['Upper_Depth'],
                                           geo_dict['Lower_Depth'],
                                           mesh_spacing)

        elif geo_dict['Fault_Typology'] == 'Complex':
            # Complex Fault Typology
            trace = []
            for raw_trace in geo_dict['Fault_Trace']:
                fault_edge = Line(
                    [Point(raw_trace[ival], raw_trace[ival + 1],
                           raw_trace[ival + 2]) for ival in range(0, len(raw_trace),
                                                                  3)])
                trace.append(fault_edge)
            geometry = ComplexFaultGeometry(trace, mesh_spacing)
        else:
            raise ValueError('Unrecognised or unsupported fault geometry!')
        return geometry
def read_fault_geometry ( self , geo_dict , mesh_spacing = 1.0 ) : if geo_dict [ 'Fault_Typology' ] == 'Simple' : raw_trace = geo_dict [ 'Fault_Trace' ] trace = Line ( [ Point ( raw_trace [ ival ] , raw_trace [ ival + 1 ] ) for ival in range ( 0 , len ( raw_trace ) , 2 ) ] ) geometry = SimpleFaultGeometry ( trace , geo_dict [ 'Dip' ] , geo_dict [ 'Upper_Depth' ] , geo_dict [ 'Lower_Depth' ] , mesh_spacing ) elif geo_dict [ 'Fault_Typology' ] == 'Complex' : trace = [ ] for raw_trace in geo_dict [ 'Fault_Trace' ] : fault_edge = Line ( [ Point ( raw_trace [ ival ] , raw_trace [ ival + 1 ] , raw_trace [ ival + 2 ] ) for ival in range ( 0 , len ( raw_trace ) , 3 ) ] ) trace . append ( fault_edge ) geometry = ComplexFaultGeometry ( trace , mesh_spacing ) else : raise ValueError ( 'Unrecognised or unsupported fault geometry!' ) return geometry
Creates the fault geometry from the parameters specified in the
        dictionary.

        :param dict geo_dict:
            Sub-dictionary of main fault dictionary containing only
            the geometry attributes
        :param float mesh_spacing:
            Fault mesh spacing (km)
        :returns:
            Instance of SimpleFaultGeometry or ComplexFaultGeometry, depending
            on typology