fault_mesh.faults.leapfrog
Classes that implement the Leapfrog fault model. Inherit from GenericFault and GenericMultiFault.
Classes
Class to hold data for multiple faults, read in from shapefile (and hopefully also tsurfaces) |
|
Represents either a whole fault (for simple faults) or one segment. Behaviours is slightly |
Module Contents
- class fault_mesh.faults.leapfrog.LeapfrogMultiFault(fault_geodataframe, sort_sr=False, segment_distance_tolerance=100.0, smoothing_n=None, remove_colons=True, dip_choice='pref', trimming_gradient=1.0, epsg=None, dip_multiplier=1.0, strike_multiplier=0.5, check_optional_fields=True)
Bases:
fault_mesh.faults.generic.GenericMultiFault
Class to hold data for multiple faults, read in from shapefile (and hopefully also tsurfaces)
- Parameters:
fault_geodataframe (geopandas.GeoDataFrame)
sort_sr (bool)
segment_distance_tolerance (float)
smoothing_n (int)
remove_colons (bool)
dip_choice (str)
trimming_gradient (float)
epsg (int)
dip_multiplier (float)
strike_multiplier (float)
check_optional_fields (bool)
- find_connections(verbose=True)
Find all connections between faults in the fault list using networkx :param verbose: print out information about individual connections :return:
- Parameters:
verbose (bool)
- to_opensha_xml(exclude_subduction=True, buffer_width=5000.0, write_buffers=True, subduction_names=('hikurangi', 'puysegur'))
Write out XML in OpenSHA format :param exclude_subduction: Do not include subduction zones from CFM :return:
- Parameters:
exclude_subduction (bool)
buffer_width (float)
write_buffers (bool)
subduction_names (tuple)
- to_quads_mesh(sampled_dip=True, depth_multiplier=0.8, file_name=None)
Generate a mesh of quads from the fault traces. :param sampled_dip: If True, use the sampled dip value for the fault. :param depth_multiplier: Multiplier for the depth to control the spacing of the mesh. :return: Meshio mesh object.
- Parameters:
sampled_dip (bool)
depth_multiplier (float)
file_name (str)
- class fault_mesh.faults.leapfrog.LeapfrogFault(parent_multifault=None, smoothing=5, trimming_gradient=1.0, segment_distance_tolerance=100.0)
Bases:
fault_mesh.faults.generic.GenericFault
Represents either a whole fault (for simple faults) or one segment. Behaviours is slightly
- Parameters:
parent_multifault (LeapfrogMultiFault)
smoothing (int)
trimming_gradient (float)
segment_distance_tolerance (float)
- property is_segment
Records whether instance is a segment of a larger multi-segment fault like the Alpine Fault. :return:
- property smoothing
n value to use in Chaikin’s corner-cutting algorithm. :return:
- property trimming_gradient
Factor that controls how much the ends of segment contours of a multi-segment fault are shortened to allow :return:
- property parent
Return LeapfrogMultiFault instance that this fault is part of. :return:
- property sampled_dip
Dip value sampled from the fault trace. Used for calculating dip in depth contours. :return:
- generate_sampled_dip(from_parent=True)
Generate a sampled dip value from the min and max dip :param from_parent: If True, use the parent multi-fault’s sampled dip value. :return:
- property down_dip_vector_sampled
Calculated from dip and dip direction
- depth_contour(depth, smoothing=True, km=False, sr_and_rake=False)
Generate contour of fault surface at depth below surface :param depth: In metres, upwards is positive :param smoothing: N for use with Chaikin’s corner cutting :param km: If True, divide depth by 1000 :return: LineString or MultiLineString representing contour
- Parameters:
depth (float)
smoothing (bool)
sr_and_rake (bool)
- property nztm_trace_coords
Return the coordinates of the nztm trace as a numpy array. :return: numpy array of coordinates
- extend_footprint(end_i, other_end, other_segment, deepest_contour_depth=30000.0, search_line_length=150000.0, buffer_size=5000.0, fall_back_distance=40.3)
- Parameters:
end_i (shapely.geometry.Point) – End to extend
other_end (shapely.geometry.Point) – Other end of segment
other_segment (LeapfrogFault) – Other
deepest_contour_depth (float)
search_line_length (float)
buffer_size (float)
fall_back_distance (float)
- Returns:
- to_quads(sampled=True, depth_multiplier=0.8)
Extract quads and vertices for writing using meshio. :param sampled: If True, use the sampled dip vector. :param depth_multiplier: Multiplier for the depth to scale the bottom trace. :return: vertices and quads as numpy arrays.
- Parameters:
sampled (bool)
depth_multiplier (float)
- Return type:
dict