def rock_velocity(timefaultname, depthfaultname):
    """Builds a 1D depth model for sub-seafloor velocities based on two 
    versions of the same fault (one in time and one in depth)."""
    timefault = geoprobe.swfault(timefaultname)
    depthfault = geoprobe.swfault(depthfaultname)

    # Convert to one-way-time in seconds so that the model units apply...
    time = twt2owt(timefault.z)

    # The time project has X defined as crossline instead of inline
    timexyz = np.vstack([timefault.y, timefault.x, time]).T
    depthxyz = depthfault.xyz

    # Sample the seafloor depths, convert them to one-way-time, and subtract
    seadepth = sample_seafloor(timexyz[:,0], timexyz[:,1])
    timexyz[:,-1] -= np.abs(seadepth) / 1500.00

    depthxyz[:,-1] -= np.abs(sample_seafloor(depthfault.x, depthfault.y))

    time, depth = compare(timexyz, depthxyz)
    mask = np.isfinite(time) & np.isfinite(depth)
    time, depth = time[mask], depth[mask]

    model = np.polyfit(time, depth, 2)

    return model, time, depth
def timefault2depth(faultname, model):
    timefault = geoprobe.swfault(faultname)

    # Convert to one-way-time in seconds so that the model units apply...
    time = twt2owt(timefault.z)

    # The time project has X defined as crossline instead of inline
    x, y, z = timefault.y, timefault.x, time
    seafloor = sample_seafloor(x, y)

    # Sample the seafloor depths, convert them to one-way-time, and subtract
    time = z - np.abs(seafloor) / 1500.00

    # Now convert things to depth..
    depth = np.polyval(model, time)

    # and add back on the seafloor depths...
    depth += np.abs(seafloor)

    # Now make a new swfault...
    xyz = np.vstack([x,y,depth]).T
    idx = timefault._indices
    depthfault = geoprobe.swfault([xyz[item] for item in idx])

    # and write it to disk
    output_name, ext = os.path.splitext(faultname)
    depthfault.write(output_name + '_depth' + ext)
    return timefault
def rock_velocity(timefaultname, depthfaultname):
    """Builds a 1D depth model for sub-seafloor velocities based on two 
    versions of the same fault (one in time and one in depth)."""
    timefault = geoprobe.swfault(timefaultname)
    depthfault = geoprobe.swfault(depthfaultname)

    # Convert to one-way-time in seconds so that the model units apply...
    time = twt2owt(timefault.z)

    # The time project has X defined as crossline instead of inline
    timexyz = np.vstack([timefault.y, timefault.x, time]).T
    depthxyz = depthfault.xyz

    # Sample the seafloor depths, convert them to one-way-time, and subtract
    seadepth = sample_seafloor(timexyz[:, 0], timexyz[:, 1])
    timexyz[:, -1] -= np.abs(seadepth) / 1500.00

    depthxyz[:, -1] -= np.abs(sample_seafloor(depthfault.x, depthfault.y))

    time, depth = compare(timexyz, depthxyz)
    mask = np.isfinite(time) & np.isfinite(depth)
    time, depth = time[mask], depth[mask]

    model = np.polyfit(time, depth, 2)

    return model, time, depth
def timefault2depth(faultname, model):
    timefault = geoprobe.swfault(faultname)

    # Convert to one-way-time in seconds so that the model units apply...
    time = twt2owt(timefault.z)

    # The time project has X defined as crossline instead of inline
    x, y, z = timefault.y, timefault.x, time
    seafloor = sample_seafloor(x, y)

    # Sample the seafloor depths, convert them to one-way-time, and subtract
    time = z - np.abs(seafloor) / 1500.00

    # Now convert things to depth..
    depth = np.polyval(model, time)

    # and add back on the seafloor depths...
    depth += np.abs(seafloor)

    # Now make a new swfault...
    xyz = np.vstack([x, y, depth]).T
    idx = timefault._indices
    depthfault = geoprobe.swfault([xyz[item] for item in idx])

    # and write it to disk
    output_name, ext = os.path.splitext(faultname)
    depthfault.write(output_name + '_depth' + ext)
    return timefault
def triangles(fault, vol):
    if isinstance(fault, basestring):
        fault = geoprobe.swfault(fault)
    if isinstance(vol, basestring):
        vol = geoprobe.volume(vol)
    geo_xyz = georef_xyz(fault, vol)

    mask = inside_outline(fault)
    return geo_xyz[fault.tri.triangle_nodes[mask]]
def visualize(slip, faultxyz, horxyz):
    fault = geoprobe.swfault('/data/nankai/data/swFaults/jdk_oos_splay_large_area_depth.swf')

    azimuth = np.degrees(np.arctan2(*slip[::-1]))
    azimuth = 90 - azimuth
    mag = np.linalg.norm(slip) / 1000

    f = FaultModel(fault, horxyz, origxyz=horxyz, ve=3, azimuth=azimuth, 
                   slip=mag, alpha=data.alpha, calc_fault=faultxyz)
    f.configure_traits()
def triangles(fault):
    if isinstance(fault, basestring):
        fault = geoprobe.swfault(fault)
    # Iterate through triangles in internal coords and select those inside
    # outline the non-convex outline of the fault...
    xyz = fault._internal_xyz
    rotated_tri = LinearNDInterpolator(xyz[:, :2], xyz[:, -1])
    rotated_xyz = fault._internal_xyz
    rotated_outline = Polygon(fault._rotated_outline)

    def inside_outline(tri):
        return rotated_outline.contains(Polygon(rotated_xyz[tri]))

    triangles = rotated_tri.tri.vertices
    return np.array([tri for tri in triangles if inside_outline(tri)])
def triangles(fault):
    if isinstance(fault, basestring):
        fault = geoprobe.swfault(fault)
    # Iterate through triangles in internal coords and select those inside 
    # outline the non-convex outline of the fault...
    xyz = fault._internal_xyz
    rotated_tri = LinearNDInterpolator(xyz[:,:2], xyz[:,-1])
    rotated_xyz = fault._internal_xyz
    rotated_outline = Polygon(fault._rotated_outline)

    def inside_outline(tri):
        return rotated_outline.contains(Polygon(rotated_xyz[tri]))

    triangles = rotated_tri.tri.vertices
    return np.array([tri for tri in triangles if inside_outline(tri)])
def main():
    fault = geoprobe.swfault('/data/nankai/data/swFaults/jdk_oos_splay_large_area_depth.swf')

    faultxyz = data.to_world(data.to_xyz(data.fault))

    horxyz = data.to_world(data.to_xyz(data.horizons[0]))[::100]

    slip = invert_slip(faultxyz, horxyz, alpha=data.alpha)

    azimuth = np.degrees(np.arctan2(*slip[::-1]))
    azimuth = 90 - azimuth
    mag = np.linalg.norm(slip) / 1000

    f = FaultModel(fault, horxyz, origxyz=horxyz, ve=3, azimuth=azimuth, 
                   slip=mag, alpha=data.alpha, calc_fault=faultxyz)
    f.configure_traits()
def main():
    fault = geoprobe.swfault(
        '/data/nankai/data/swFaults/jdk_oos_splay_large_area_depth.swf')

    faultxyz = data.to_world(data.to_xyz(data.fault))

    horxyz = data.to_world(data.to_xyz(data.horizons[0]))[::100]

    slip = invert_slip(faultxyz, horxyz, alpha=data.alpha)

    azimuth = np.degrees(np.arctan2(*slip[::-1]))
    azimuth = 90 - azimuth
    mag = np.linalg.norm(slip) / 1000

    f = FaultModel(fault,
                   horxyz,
                   origxyz=horxyz,
                   ve=3,
                   azimuth=azimuth,
                   slip=mag,
                   alpha=data.alpha,
                   calc_fault=faultxyz)
    f.configure_traits()
        ),
        resizable=True,
    )


def triangles(fault):
    if isinstance(fault, basestring):
        fault = geoprobe.swfault(fault)
    # Iterate through triangles in internal coords and select those inside
    # outline the non-convex outline of the fault...
    xyz = fault._internal_xyz
    rotated_tri = LinearNDInterpolator(xyz[:, :2], xyz[:, -1])
    rotated_xyz = fault._internal_xyz
    rotated_outline = Polygon(fault._rotated_outline)

    def inside_outline(tri):
        return rotated_outline.contains(Polygon(rotated_xyz[tri]))

    triangles = rotated_tri.tri.vertices
    return np.array([tri for tri in triangles if inside_outline(tri)])


if __name__ == '__main__':
    fault = geoprobe.swfault(
        '/data/nankai/data/swFaults/jdk_oos_splay_large_area_depth.swf')
    hor = data.horizons[0]
    horxyz = data.to_world(data.to_xyz(hor))[::100]

    plot = FaultModel(fault, horxyz)
    plot.configure_traits()
Example #12
0
import os

import geoprobe
import numpy as np

basedir = os.path.dirname(__file__)
basedir = os.path.join(basedir, 'data')

faultname = os.path.join(basedir, 'swFaults', 
                         'jdk_oos_splay_large_area_depth-mod.swf')
fault = geoprobe.swfault(faultname)

volname = os.path.join(basedir, 'Volumes', 'example.hdf')
vol = geoprobe.volume(volname)

# These are in stratigraphic order from oldest to youngest
horizon_names = [
    'jdk_forearc_horizon_7.hzn',
    'jdk_forearc_horizon_6.hzn',
    'jdk_forearc_horizon_5.hzn',
    'jdk_forearc_horizon_4.hzn',
    'jdk_forearc_horizon_3.5.hzn',
    'jdk_forearc_horizon_3.hzn',
    'jdk_forearc_horizon_2.5.hzn',
    'jdk_forearc_horizon_2.hzn',
    'jdk_forearc_horizon_1.5.hzn',
    'jdk_forearc_horizon_1.hzn',
    ]

horizon_names = [os.path.join(basedir, 'Horizons', item) for item in horizon_names]
horizons = [geoprobe.horizon(item) for item in horizon_names]
                Group(
                    '_', 'azimuth', 'slip', 'alpha',
                    ),
                resizable=True,
                )

def triangles(fault):
    if isinstance(fault, basestring):
        fault = geoprobe.swfault(fault)
    # Iterate through triangles in internal coords and select those inside 
    # outline the non-convex outline of the fault...
    xyz = fault._internal_xyz
    rotated_tri = LinearNDInterpolator(xyz[:,:2], xyz[:,-1])
    rotated_xyz = fault._internal_xyz
    rotated_outline = Polygon(fault._rotated_outline)

    def inside_outline(tri):
        return rotated_outline.contains(Polygon(rotated_xyz[tri]))

    triangles = rotated_tri.tri.vertices
    return np.array([tri for tri in triangles if inside_outline(tri)])


if __name__ == '__main__':
    fault = geoprobe.swfault('/data/nankai/data/swFaults/jdk_oos_splay_large_area_depth.swf')
    hor = data.horizons[0]
    horxyz = data.to_world(data.to_xyz(hor))[::100]

    plot = FaultModel(fault, horxyz)
    plot.configure_traits()
def all_faults():
    """All (recent and minor) faults in the piggyback basin."""
    for filename in iglob(BASENAME + '*'):
        yield geoprobe.swfault(filename)
Example #15
0
 def setup(self):
     self.normal = geoprobe.swfault(faultdir + '/example_normal.swf')
     self.strike_slip = geoprobe.swfault(faultdir + '/example_ss.swf')
     self.empty = geoprobe.swfault(faultdir + '/empty.swf')
def all_normal_faults():
    """All normal faults in the piggyback basin."""
    for filename in iglob(BASENAME + '*normal*'):
        yield geoprobe.swfault(filename)
def main_normal_faults():
    """Main normal fault population in the piggyback basin."""
    for filename in iglob(BASENAME + '*normal*'):
        if 'perp' not in filename:
            yield geoprobe.swfault(filename)
def right_lateral_faults():
    """All right-lateral strike-slip faults in the piggyback basin."""
    for filename in iglob(BASENAME + '*strikeslip*rl.swf'):
        yield geoprobe.swfault(filename)
def strike_slip_faults():
    """All strike-slip faults in the piggyback basin."""
    for filename in iglob(BASENAME + '*strikeslip*'):
        yield geoprobe.swfault(filename)
 def setup(self):
     self.normal = geoprobe.swfault(faultdir + "/example_normal.swf")
     self.strike_slip = geoprobe.swfault(faultdir + "/example_ss.swf")
     self.empty = geoprobe.swfault(faultdir + "/empty.swf")
Example #21
0
import os

import geoprobe
import numpy as np

basedir = os.path.dirname(__file__)
basedir = os.path.join(basedir, 'data')

faultname = os.path.join(basedir, 'swFaults',
                         'jdk_oos_splay_large_area_depth-mod.swf')
fault = geoprobe.swfault(faultname)

volname = os.path.join(basedir, 'Volumes', 'example.hdf')
vol = geoprobe.volume(volname)

# These are in stratigraphic order from oldest to youngest
horizon_names = [
    'jdk_forearc_horizon_7.hzn',
    'jdk_forearc_horizon_6.hzn',
    'jdk_forearc_horizon_5.hzn',
    'jdk_forearc_horizon_4.hzn',
    'jdk_forearc_horizon_3.5.hzn',
    'jdk_forearc_horizon_3.hzn',
    'jdk_forearc_horizon_2.5.hzn',
    'jdk_forearc_horizon_2.hzn',
    'jdk_forearc_horizon_1.5.hzn',
    'jdk_forearc_horizon_1.hzn',
]

horizon_names = [
    os.path.join(basedir, 'Horizons', item) for item in horizon_names
def sec_normal_faults():
    """Secondary normal fault population in the piggyback basin."""
    for filename in iglob(BASENAME + '*normal*'):
        if 'perp' in filename:
            yield geoprobe.swfault(filename)