This tutorial is presented as Python code running inside a Jupyter Notebook, the recommended way to use Salvus. To run it yourself you can copy/type each individual cell or directly download the full notebook, including all required files.

Continental Scale FWI Tutorial - Part 1: Project Setup & Data Acquisition

The first part of the continental scale full waveform inversion tutorial explains how to set up the spatial domain and how to acquire observed data for it.
PROJECT_DIR = "project_dir_central_europe"
import pathlib
from salvus import namespace as sn
from frequency_band import FrequencyBand

fband_file = pathlib.Path("./frequency_band_70_120.pkl")
fband = FrequencyBand.load(fband_file)
Frequency band: 8.33 mHz - 14.3 mHz, 70.0 s - 120.0 s
FrequencyBand(min_frequency_in_hertz=0.008333333333333333, max_frequency_in_hertz=0.014285714285714285)

Choosing the spatial domain

The first crucial choice is the choice of spatial domain, i.e. which region you want to invert for. A hard constraint in FWI is that sources and receivers must both be part of the domain - this means that teleseismic events are not usable aside from inversions for the full globe.
In most cases you will already know which region you want to invert it. Nonetheless it is useful to have a look at seismicity and station maps. Oftentimes it is worthwhile to extend the domain to include extra sources and receivers, because FWI in seismology is fundamentally limited by the available data and more is always better.

Suitable earthquake magnitude range

Not all earthquakes can be used. Two main restrictions limit the acceptable magnitude range, both are a function of the domain size as well as the period range one is interested in.

Limit on minimum magnitude

Must be big enough to be measurable across the whole domain in the frequency range of interest. Small earthquakes additionally don't excite a lot of low frequency surface wave energy which further limits their use especially in the initial, long-period iterations of an inversion. This is dependent on the sites' instrumentations and noise levels and no general rule can be given and it has to be figured out by trial and error. Most studies set the minimum moment magnitude to a value between 4 and 5.

Limit on maximum magnitude

The earthquakes must be small enough so that they can be reasonably approximated by a point source. It is okay if the source mechanisms captures some of the finite fault nature. The rupture length of the earthquake should be significantly smaller than the smallest wavelength one is interested in, which is especially important for receivers close to the fault.
This is a deep topic and strongly dependent on the region and type of fault but the following figure empirically relates fault length to moment magnitude. There are no hard rules but between moment magnitudes from 6 to 7.5 the fault length approximately ranges from 10 to 100 km and depending on the chosen region and frequency range the maximum magnitude one uses for a continental scale full waveform dimension should be in that range.
Common moment magnitude vs fault length relations, constants taken from Leonard, M. (2014). Self-Consistent Earthquake Fault-Scaling Relations: Update and Extension to Stable Continental Strike-Slip Faults. Bulletin of the Seismological Society of America, 104(6), 2953–2965. doi:10.1785/0120140087
For this tutorial we will study central Europe. The following image shows the seismicity of Europe and the approximate domain of interest.
Screenshot from the EFEHR Hazard Map Portal, CC BY-SA 3.0 (unported).
SalvusProject has a number of different domains that are suitable for different use cases.
In Salvus we can describe this as a spherical chunk on the surface of the Earth. So let's start by defining this domain and center a new Project around it. Domain objects can be visualized so it is easy to try a few values until the desired result is achieved. This will be the inversion domain so the goal here is to get as close to the desired region as possible as it cannot be changed after a project has been created. The map projections between the above image and the domain plot are different but they show a very similar region.
lat_center, lon_center = 48.0, 10.0
lat_extent, lon_extent = 25.0, 25.0

domain = sn.domain.dim3.SphericalChunkDomain(