%matplotlib inline
%config Completer.use_jedi = False
from salvus.mesh.simple_mesh import SmoothieSEM, Globe3D
from salvus import namespace as sn
from obspy.clients.fdsn import Client
# a quake in Turkey that we will use in this tutorial, original data from IRIS spud:
# http://service.iris.edu/fdsnws/event/1/query?eventid=2847365
# http://ds.iris.edu/spudservice/momenttensor/gcmtid/C201003241411A/quakeml#momenttensor
source = sn.simple_config.source.seismology.SideSetMomentTensorPoint3D(
latitude=38.82,
longitude=40.14,
depth_in_m=4500,
side_set_name="r1",
mrr=5.47e15,
mtt=-4.11e16,
mpp=3.56e16,
mrt=2.26e16,
mrp=-2.25e16,
mtp=1.92e16,
)
# get USarray stations from iris
inv = Client("IRIS").get_stations(network="US", level="station", format="text")
receivers = sn.simple_config.receiver.seismology.parse(
inv, dimensions=3, fields=["displacement"]
)
# prepare an event collection that will later be used to mask the mesh to a region of interest
event_collection = sn.EventCollection.from_sources(
sources=[source], receivers=receivers
)