This documentation is not for the latest stable Salvus version.
# This notebook will use this variable to determine which
# remote site to run on.
import os
import pathlib
import time
from salvus import namespace as sn
SALVUS_FLOW_SITE_NAME = os.environ.get("SITE_NAME", "local")
PROJECT_DIR = "project"
IU
global network. These are high quality stations which will be perfect for a comparison to our synthetic data.# Define a spherical chunk domain.
lat_c, lon_c = -27.5, 135
lat_e, lon_e = 25.5, 42.0
d = sn.domain.dim3.SphericalChunkDomain(
lat_center=lat_c,
lat_extent=lat_e,
lon_center=lon_c,
lon_extent=lon_e,
radius_in_meter=6371e3,
)
p = sn.Project.from_domain(
path=PROJECT_DIR,
domain=d,
load_if_exists=True,
)
# Add an event
e = sn.Event(
sources=sn.simple_config.source.seismology.parse(
"./data/event.txt", dimensions=3
),
receivers=[],
)
if e.event_name not in p.events.list():
p.add_to_project(e)
p.actions.seismology.download_data_for_event(
data_name="raw_recording",
event=p.events.list()[0],
add_receivers_to_project_event=True,
receiver_fields=["velocity"],
seconds_before_event=300.0,
seconds_after_event=1800.0,
network="IU",
download_providers=["IRIS"],
)
.nc
) files entitled ausrem_crust.nc
and ausrem_mantle.nc
. The name of these models are relatively self descriptive: they are modified version of the AusREM (Australian Seismological Reference Model) crust and mantle models respectively. The format that they are stored in is governed by the CF conventions, which is a commonly used format for storing geoscientific data.taper_in_degrees
parameter. Ok, now let's add the crustal model to the project...p.add_to_project(
sn.model.volume.seismology.CrustalModel(
name="ausrem_crust",
data="./data/ausrem_crust.nc",
taper_in_degrees=5.0,
)
)
p.add_to_project(
sn.model.volume.seismology.MantleModel(
name="ausrem_mantle",
data="./data/ausrem_mantle.nc",
taper_in_degrees=5.0,
)
)
mc = sn.ModelConfiguration(
background_model="prem_ani_one_crust",
volume_models=["ausrem_crust", "ausrem_mantle"],
)
p.add_to_project(
sn.topography.spherical.SurfaceTopography(
name="topo_surface",
data="./data/topography_wgs84_filtered_512.nc",
use_symlink=True,
)
)
p.add_to_project(
sn.topography.spherical.MohoTopography(
name="topo_moho",
data="./data/moho_topography_wgs84_filtered.nc",
use_symlink=True,
)
)
tc = sn.topography.TopographyConfiguration(
topography_models=["topo_surface", "topo_moho"]
)
# end_time_in_seconds should be 1800.0 s!
# We only truncated the time interval for the CI.
ec = sn.EventConfiguration(
wavelet=sn.simple_config.stf.GaussianRate(half_duration_in_seconds=1.5000),
waveform_simulation_configuration=sn.WaveformSimulationConfiguration(
end_time_in_seconds=10.0
),
)
ab = sn.AbsorbingBoundaryParameters(
reference_velocity=6000.0,
number_of_wavelengths=3.5,
reference_frequency=1 / 40.0,
)
# Combine everything into a complete configuration.
p.add_to_project(
sn.SimulationConfiguration(
tensor_order=1,
name="40seconds",
elements_per_wavelength=1.0,
min_period_in_seconds=40,
max_depth_in_meters=1000e3,
model_configuration=mc,
topography_configuration=tc,
event_configuration=ec,
absorbing_boundaries=ab,
)
)
p.viz.nb.simulation_setup("40seconds", events=p.events.list())
[2024-03-15 09:34:05,166] INFO: Creating mesh. Hang on.
Interpolating model: ausrem_crust.
Interpolating model: ausrem_mantle.