This documentation is not for the latest stable Salvus version.
# Global site name for all runs
import os
SALVUS_FLOW_SITE_NAME = os.environ.get("SITE_NAME", "local")
%matplotlib inline
from salvus.mesh.simple_mesh import basic_mesh
from salvus.flow import simple_config
from salvus.flow import api
import salvus.namespace as sn
import json
import h5py
import matplotlib.pyplot as plt
import numpy as np
import obspy
import pathlib
import typing
# Print all available 1-D Earth models. You can of course
# provide your own.
from salvus.mesh.models_1D import model
model.get_builtin_models()
['prem_iso', 'iasp91', 'prem_ani_no_crust', 'prem_iso_one_crust', 'csem', 'prem_ani_one_crust', 'mars_sohl', 'prem_crust20_global', 'prem_iso_no_crust', 'prem_ani', 'VPREMOON', 'prem_crust20_cont', 'VPREMOON_noLVL', 'prem_ani_ocean', 'prem_crust20_ocean', 'ak135', 'ak135f', 'Moon_Weber2011']
# The most important settings are collected here.
PERIOD = 100.0
# A good idea as the gradients are always computed
# relative to the input parameterization. This will
# just result in a much smoother looking gradient.
# Planet will also be actually round.
TENSOR_ORDER = 4
# Probably up this a bit for any final results but works
# just fine for testing purposes.
ELEMENTS_PER_WAVELENGTH = 1.0
# No latitude in 2-D. Receiver always at the surface.
SRC_LONGITUDE = 0.0
SRC_DEPTH_KM = 100.0
REC_LONGITUDE = 135.0
# It will by default select a window around this phase.
PHASE = "Pdiff"
m = basic_mesh.Circular2D()
m.basic.model = "prem_ani_no_crust"
m.basic.min_period_in_seconds = PERIOD
m.basic.elements_per_wavelength = ELEMENTS_PER_WAVELENGTH
m.advanced.tensor_order = TENSOR_ORDER
m