Skip to content

Commit

Permalink
Merge branch 'main' of github.com:brendanjmeade/celeri
Browse files Browse the repository at this point in the history
  • Loading branch information
brendanjmeade committed Mar 9, 2022
2 parents 1732690 + 4584ddb commit 906c7fa
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions celeri/celeri_vis.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@ def common_plot_elements(segment: pd.DataFrame, lon_range: Tuple, lat_range: Tup
is_constrained_edge = np.zeros(meshes[i].n_tde)
is_constrained_edge[meshes[i].top_elements] = meshes[i].top_slip_rate_constraint
is_constrained_edge[meshes[i].bot_elements] = meshes[i].bot_slip_rate_constraint
is_constrained_edge[meshes[i].side_elements] = meshes[i].side_slip_rate_constraint
is_constrained_edge[meshes[i].side_elements] = meshes[
i
].side_slip_rate_constraint
x_coords = meshes[i].meshio_object.points[:, 0]
y_coords = meshes[i].meshio_object.points[:, 1]
vertex_array = np.asarray(meshes[i].verts)
Expand Down Expand Up @@ -485,6 +487,7 @@ def common_plot_elements(segment: pd.DataFrame, lon_range: Tuple, lat_range: Tup
common_plot_elements(segment, lon_range, lat_range)
# plot_meshes(meshes, estimation.tde_strike_slip_rates, plt.gca())
fill_value = estimation.tde_strike_slip_rates
fill_value_range = [np.min(fill_value), np.max(fill_value)]
ax = plt.gca()
for i in range(len(meshes)):
x_coords = meshes[i].meshio_object.points[:, 0]
Expand All @@ -497,12 +500,13 @@ def common_plot_elements(segment: pd.DataFrame, lon_range: Tuple, lat_range: Tup
verts, edgecolor="none", cmap="rainbow"
)
if i == 0:
tde_slip_component_start = 0
tde_slip_component_end = meshes[i].n_tde
tde_slip_component_start = 0
tde_slip_component_end = meshes[i].n_tde
else:
tde_slip_component_start = tde_slip_component_end
tde_slip_component_end = tde_slip_component_start + meshes[i].n_tde
tde_slip_component_start = tde_slip_component_end
tde_slip_component_end = tde_slip_component_start + meshes[i].n_tde
pc.set_array(fill_value[tde_slip_component_start:tde_slip_component_end])
pc.set_clim(fill_value_range)
ax.add_collection(pc)
# ax.autoscale()
if i == len(meshes) - 1:
Expand All @@ -521,6 +525,7 @@ def common_plot_elements(segment: pd.DataFrame, lon_range: Tuple, lat_range: Tup
common_plot_elements(segment, lon_range, lat_range)
# plot_meshes(meshes, estimation.tde_dip_slip_rates, plt.gca())
fill_value = estimation.tde_dip_slip_rates
fill_value_range = [np.min(fill_value), np.max(fill_value)]
ax = plt.gca()
for i in range(len(meshes)):
x_coords = meshes[i].meshio_object.points[:, 0]
Expand All @@ -533,12 +538,13 @@ def common_plot_elements(segment: pd.DataFrame, lon_range: Tuple, lat_range: Tup
verts, edgecolor="none", cmap="rainbow"
)
if i == 0:
tde_slip_component_start = 0
tde_slip_component_end = meshes[i].n_tde
tde_slip_component_start = 0
tde_slip_component_end = meshes[i].n_tde
else:
tde_slip_component_start = tde_slip_component_end
tde_slip_component_end = tde_slip_component_start + meshes[i].n_tde
tde_slip_component_start = tde_slip_component_end
tde_slip_component_end = tde_slip_component_start + meshes[i].n_tde
pc.set_array(fill_value[tde_slip_component_start:tde_slip_component_end])
pc.set_clim(fill_value_range)
ax.add_collection(pc)
# ax.autoscale()
if i == len(meshes) - 1:
Expand Down

0 comments on commit 906c7fa

Please sign in to comment.