Skip to content

Commit

Permalink
Examples: fixed linting for infrasound example
Browse files Browse the repository at this point in the history
  • Loading branch information
EdCaunt committed Dec 9, 2022
1 parent 7e1b795 commit e6a2a90
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
2 changes: 1 addition & 1 deletion examples/infrasound/3d_infrasound_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@
plot_st_helens(model.zsc.data[-1], src_coords, rec_coords,
np.array([-4800., -4800., 0.]), (30, 30, 30))

plot_top_down(model.zsc.data[-1], -4800., 4800., -4800., 4800.)
plot_top_down(model.zsc.data[-1], -4800., 4800., -4800., 4800.)
1 change: 0 additions & 1 deletion examples/infrasound/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"""

import devito as dv
import sympy as sp

from itertools import product
from examples.seismic import TimeAxis, RickerSource, Receiver
Expand Down
14 changes: 3 additions & 11 deletions examples/infrasound/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,14 @@

def plot_st_helens(data, src_loc, rec_loc, origin, spacing):
"""Plot a 3D render of slices through a dataset with topography"""
# Create the spatial reference
mesh = pv.UniformGrid()

# Set the grid dimensions: shape + 1 because we want to inject our values on
# the CELL data
mesh.dimensions = np.array(data.shape) + 1

# Edit the spatial reference
mesh.origin = origin # The bottom left corner of the data set
mesh.spacing = spacing # These are the cell sizes along each axis
mesh.origin = origin
mesh.spacing = spacing

# Add the data values to the cell data
mesh.cell_data["values"] = data.flatten(order="F") # Flatten the array!
mesh.cell_data["values"] = data.flatten(order="F")

# Now plot the grid!
# slices = mesh.slice_orthogonal(z=1800)
slicex = mesh.slice(normal=[1, 0, 0])
slicey = mesh.slice(normal=[0, 1, 0])

Expand Down

0 comments on commit e6a2a90

Please sign in to comment.