This documentation is not for the latest stable Salvus version.
%matplotlib inline
# This notebook will use this variable to determine which
# remote site to run on.
import os
SALVUS_FLOW_SITE_NAME = os.environ.get("SITE_NAME", "local")
PROJECT_DIR = "project"
import pathlib
import numpy as np
import salvus.namespace as sn
print("Opening existing project.")
p = sn.Project(path=PROJECT_DIR)
Opening existing project.
p.viz.nb.domain()
p.events.list()
['event_0']
p.simulations.list()
['my_first_simulation']
HDF5
file named reference_data.h5
in the data directory.ASDF
or SEGY
describe their data with associated headers. We'll see how to add these types of data in a later tutorial, but in this case we are just reading in raw waveform traces with little to no meta information. Because of this we'll need to assist Salvus a little and tell the project to what events this raw data refers to.p.waveforms.add_external(
data_name="reference",
event="event_0",
data_filename="data/reference_data.h5",
)
p.viz.nb.waveforms()
to visualize seismograms in part 1. To compare the simulated seismograms to the reference data, we just need to pass a list instead of a single simulation name.p.viz.nb.waveforms(
["EXTERNAL_DATA:reference", "my_first_simulation"],
receiver_field="displacement",
)
abp = sn.AbsorbingBoundaryParameters(
reference_velocity=3000.0,
number_of_wavelengths=3.5,
reference_frequency=15.0,
)
sc = p.entities.get(
entity_type="simulation_configuration", entity_name="my_first_simulation"
)
p += sn.SimulationConfiguration(
name="simulation_2",
max_frequency_in_hertz=sc.max_frequency_in_hertz,
elements_per_wavelength=sc.elements_per_wavelength,
model_configuration=sc.model_configuration,
event_configuration=sc.event_configuration,
absorbing_boundaries=abp,
)
+=
or add_to_project
to add new entities to the project.p.visualizations.nb.simulation_setup(
simulation_configuration="simulation_2",
events=p.events.list(),
)
[2024-03-15 09:01:29,812] INFO: Creating mesh. Hang on.