res_m = 848 rho = 2700 g = 9.8 depth_corr = 1000 # m in a km (depth units) poiss_corr = 0.33 # clip_len = 1500 clip_dist = clip_len + 1500 # make new coordinates for fault patches (in array coordinates) s1_xyz = hbx.coord_map_inverse_3d( [s1['utm_lon'], s1['utm_lat'], s1['depth_km']], x_step=x_res_deg, x_shift=x0_conv, y_step=y_res_deg, y_shift=y0_conv, z_step=1, z_shift=1.5) s1_xyz = np.array(s1_xyz) s1_xyz[0:2, :] = s1_xyz[0:2, :] - clip_len s1_yxz = np.array([s1_xyz[1, :], s1_xyz[0, :], s1_xyz[2, :]]) s2_xyz = hbx.coord_map_inverse_3d( [s2['utm_lon'], s2['utm_lat'], s2['depth_km']], x_step=x_res_deg, x_shift=x0_conv, y_step=y_res_deg, y_shift=y0_conv, z_step=1, z_shift=1.5)
# get coordinate data info (manually input) topo_x0 = -1919052.3800296092 topo_y0 = 5429616.539854606 x_res_deg = 848.2707 y_res_deg = 848.2707 x0_conv = topo_x0 y0_conv = topo_y0 - (4343 * y_res_deg) #upper to lower edge clip_len = 1500 clip_dist = clip_len * 2 lms_xyz = hbx.coord_map_inverse_3d( [lms['utm_lon'], lms['utm_lat'], lms['depth']], x_step=x_res_deg, x_shift=x0_conv, y_step=y_res_deg, y_shift=y0_conv, z_step=1, z_shift=1.851) lms_xyz = np.array(lms_xyz) lms_xyz[0:2, :] = lms_xyz[0:2, :] - clip_len lms_yxz = np.array([lms_xyz[1, :], lms_xyz[0, :], lms_xyz[2, :]]) print 'loading stress arrays' fs = h5py.File(stress_file, 'r') comp_list = ['xx', 'yy', 'zz', 'xy', 'xz', 'yz'] stress_dict = {} for cc in comp_list: stress_dict[cc] = (fs['{}_MPa'.format(cc)][clip_len:clip_dist,
res_m = 848 rho = 2700 g = 9.8 depth_corr = 1000 # m in a km (depth units) poiss_corr = 0.33 # clip_len = 1500 clip_dist = clip_len + 1500 # make new coordinates for fault patches (in array coordinates) s1_xyz = hbx.coord_map_inverse_3d([s1['utm_lon'],s1['utm_lat'],s1['depth_km']], x_step = x_res_deg, x_shift = x0_conv, y_step = y_res_deg, y_shift = y0_conv, z_step = 1, z_shift = 1.5) s1_xyz = np.array(s1_xyz) s1_xyz[0:2,:] = s1_xyz[0:2,:] - clip_len s1_yxz = np.array([ s1_xyz[1,:], s1_xyz[0,:], s1_xyz[2,:] ]) s2_xyz = hbx.coord_map_inverse_3d([s2['utm_lon'],s2['utm_lat'],s2['depth_km']], x_step = x_res_deg, x_shift = x0_conv, y_step = y_res_deg, y_shift = y0_conv, z_step = 1, z_shift = 1.5) s2_xyz = np.array(s2_xyz) s2_xyz[0:2,:] = s2_xyz[0:2,:] - clip_len s2_yxz = np.array([ s2_xyz[1,:], s2_xyz[0,:], s2_xyz[2,:] ]) s3_xyz = hbx.coord_map_inverse_3d([s3['utm_lon'],s3['utm_lat'],s3['depth_km']],
# get coordinate data info (manually input) topo_x0 = -1919052.3800296092 topo_y0 = 5429616.539854606 x_res_deg = 848.2707 y_res_deg = 848.2707 x0_conv = topo_x0 y0_conv = topo_y0 - (4343 * y_res_deg) #upper to lower edge clip_len = 1500 clip_dist = clip_len * 2 lms_xyz = hbx.coord_map_inverse_3d([lms['east_utm48'].values, lms['north_utm48'].values, lms['z'].values], x_step = x_res_deg, x_shift = x0_conv, y_step = y_res_deg, y_shift = y0_conv, z_step = 1, z_shift = 0.851) lms_xyz = np.array(lms_xyz) lms_xyz[0:2,:] = lms_xyz[0:2,:] - clip_len lms_yxz = np.array([ lms_xyz[1,:], lms_xyz[0,:], lms_xyz[2,:] ]) lms[['strike', 'dip']] = lms[['strike', 'dip']].astype(float) lms.strike += 360 print 'loading stress arrays' fs = h5py.File(stress_file, 'r') comp_list = ['xx', 'yy', 'zz', 'xy', 'xz', 'yz'] stress_dict = {}
# get coordinate data info (manually input) topo_x0 = -1919052.3800296092 topo_y0 = 5429616.539854606 x_res_deg = 848.2707 y_res_deg = 848.2707 x0_conv = topo_x0 y0_conv = topo_y0 - (4343 * y_res_deg) #upper to lower edge clip_len = 1500 clip_dist = clip_len + 1500 # make new coordinates for fault patches (in array coordinates) s1_xyz = hbx.coord_map_inverse_3d([s1['utm_e'],s1['utm_n'],s1['depth']], x_step = x_res_deg, x_shift = x0_conv, y_step = y_res_deg, y_shift = y0_conv, z_step = 1, z_shift = 1.5) s1_xyz = np.array(s1_xyz) s1_xyz[0:2,:] = s1_xyz[0:2,:] - clip_len comp_list = ['zz', 'xy', 'xz', 'yz', 'xx', 'yy'] print 'interpolating stresses to fault points' for comp in comp_list: print 'doing {}'.format(comp) stress_vol = (stress_db['{}_MPa'.format(comp)][clip_len:clip_dist, clip_len:clip_dist,:]) s1['{}_stress'.format(comp)] = nd.map_coordinates( stress_vol, [s1_xyz[1], s1_xyz[0], s1_xyz[2]], order=interp_order)