def main(): fig, ax = plt.subplots() ax.set_xlabel('Eastward Slip (m)') ax.set_ylabel('Northward Slip (m)') offsets = [[0, 0]] heaves = [[0,0,0]] for hor, name in zip(data.horizons[::-1], data.gulick_names[::-1]): results = get_result(hor.name) discarded = 200 - results.shape[0] print 'Discarded {} points from {}'.format(discarded, hor.name) # Plot covariance ellipse... dx, dy, slip = plot(ax, results, '# ' + name) offsets.append([dx, dy]) heaves.append(utilities.calculate_heave([dx, dy], hor)) # Plot plate motion over 200kyr utilities.plot_plate_motion(xy=offsets[3], time=2e5) # Plot lines connecting the horizons... ax.plot(*zip(*offsets), marker='o', color='darkred') # Plot heaves... heaves = np.array(heaves) ax.plot(*heaves[:,:2].T, marker='o', color='green') # Set aspect ratio of plot to 1 so that azimuths are properly represented ax.axis('equal') plt.show()
def main(): fig, ax = plt.subplots() ax.set_xlabel('Eastward Slip (m)') ax.set_ylabel('Northward Slip (m)') offsets = [[0, 0]] heaves = [[0, 0, 0]] for hor, name in zip(data.horizons[::-1], data.gulick_names[::-1]): results = get_result(hor.name) discarded = 200 - results.shape[0] print 'Discarded {} points from {}'.format(discarded, hor.name) # Plot covariance ellipse... dx, dy, slip = plot(ax, results, '# ' + name) offsets.append([dx, dy]) heaves.append(utilities.calculate_heave([dx, dy], hor)) # Plot plate motion over 200kyr utilities.plot_plate_motion(xy=offsets[3], time=2e5) # Plot lines connecting the horizons... ax.plot(*zip(*offsets), marker='o', color='darkred') # Plot heaves... heaves = np.array(heaves) ax.plot(*heaves[:, :2].T, marker='o', color='green') # Set aspect ratio of plot to 1 so that azimuths are properly represented ax.axis('equal') plt.show()
def restore_horizons(func=invert_slip): """ Restore each of the uplifted horizons individually. "func" just allows overriding of the specific inversion (e.g. see "invert_slip_fixed_azimuth.py") without code duplication. """ # Note that we start each horizon at zero offset and restore independently guess = (0, 0) variances, planar_variances = [], [] slips, heaves = [], [] for hor in data.horizons[::-1]: hor_xyz = data.world_xyz(hor) # Downsample the horizon for faster runtime # (No need to include millions of points along the horizon's surface) hor_xyz = hor_xyz[::50] # Invert for the slip along the fault needed to restore the horizon # to horizontal. slip, metric = func(data.fault_xyz, hor_xyz, alpha=data.alpha, guess=guess, overlap_thresh=1, return_metric=True) heave = utilities.calculate_heave(slip, hor) variances.append(metric) planar_var = planar_variance(hor_xyz) planar_variances.append(planar_var) slips.append(slip) heaves.append(heave) # Note: We're plotting "metric / planar_var" to allow a direct # comparison of the quality of the fit between different horizons. print 'Restoring', hor.name print ' Roughness (lower is better):', metric / planar_var return slips, heaves, variances, planar_variances
def restore_horizons(func=invert_slip): """ Restore each of the uplifted horizons individually. "func" just allows overriding of the specific inversion (e.g. see "invert_slip_fixed_azimuth.py") without code duplication. """ # Note that we start each horizon at zero offset and restore independently guess = (0,0) variances, planar_variances = [], [] slips, heaves = [], [] for hor in data.horizons[::-1]: hor_xyz = data.world_xyz(hor) # Downsample the horizon for faster runtime # (No need to include millions of points along the horizon's surface) hor_xyz = hor_xyz[::50] # Invert for the slip along the fault needed to restore the horizon # to horizontal. slip, metric = func(data.fault_xyz, hor_xyz, alpha=data.alpha, guess=guess, overlap_thresh=1, return_metric=True) heave = utilities.calculate_heave(slip, hor) variances.append(metric) planar_var = planar_variance(hor_xyz) planar_variances.append(planar_var) slips.append(slip) heaves.append(heave) # Note: We're plotting "metric / planar_var" to allow a direct # comparison of the quality of the fit between different horizons. print 'Restoring', hor.name print ' Roughness (lower is better):', metric / planar_var return slips, heaves, variances, planar_variances
slips = [(0,0)] guess = (0,0) heaves = [(0,0,0)] planar_variances = [] variances = [] for i, hor in enumerate(data.horizons[::-1]): print hor.name xyz = data.to_xyz(hor)[::50] xyz = data.to_world(xyz) slip, metric = invert_slip(fault, xyz, alpha=data.alpha, guess=guess, overlap_thresh=1, return_metric=True) heave = utilities.calculate_heave(slip, hor) variances.append(metric) planar_var = planar_variance(xyz) planar_variances.append(planar_var) print metric / planar_var slips.append(slip) heaves.append(heave) x, y = np.array(slips).T plt.plot(x, y, 'bo-') x, y, z = np.array(heaves).T plt.plot(x, y, 'go-')
def heave(): results = bootstrap_results() slip = results.mean(axis=0) offset = utilities.calculate_heave(slip, data.horizons[0]) return offset[:2]