Function index

Index of functions

Basic physical properties

SeisModels.evaluateFunction.
evaluate(m::SeisModel1D, field::Symbol, r; depth=false) -> vals

Evaluate the model m at radius r km for the different property/ies in field, returning a scalar for scalar input, and an array for array input.

If depth is true, r is treated as a depth in km instead.

source
SeisModels.vpFunction.
vp(m::SeisModel1D, r; depth=false, freq=reffrequency(m)) -> isotropic average Vp

Return the value of isotropic average Vp (km/s) for model m at radius r km.

If depth is true, then r is given as a depth in km instead.

If freq is given, then the velocity is corrected for attenuation. This requires the model has attenuation and a reference frequency.

source
SeisModels.vsFunction.
vs(m::SeisModel1D, r; depth=false, freq=reffrequency(m)) -> isotropic average Vs

Return the value of isotropic average Vs (km/s) for model m at radius r km.

If depth is true, then r is given as a depth in km instead.

If freq is given, then the velocity is corrected for attenuation. This requires the model has attenuation and a reference frequency.

source
SeisModels.densityFunction.
density(m::SeisModel1D, r; depth=false) -> density

Return the value of density (g/cm^3) for model m at radius r km.

If depth is true, then r is given as a depth in km instead.

source
SeisModels.vphFunction.
vph(m::SeisModel1D, r; depth=false, freq=reffrequency(m)) -> Vph

Return the value of Vph (km/s) for model m at radius r km.

If depth is true, then r is given as a depth in km instead.

If freq is given, then the velocity is corrected for attenuation. This requires the model has attenuation and a reference frequency.

source
SeisModels.vpvFunction.
vpv(m::SeisModel1D, r; depth=false, freq=reffrequency(m)) -> Vpv

Return the value of Vpv (km/s) for model m at radius r km.

If depth is true, then r is given as a depth in km instead.

If freq is given, then the velocity is corrected for attenuation. This requires the model has attenuation and a reference frequency.

source
SeisModels.vshFunction.
vsh(m::SeisModel1D, r; depth=false, freq=reffrequency(m)) -> Vsh

Return the value of Vsh (km/s) for model m at radius r km.

If depth is true, then r is given as a depth in km instead.

If freq is given, then the velocity is corrected for attenuation. This requires the model has attenuation and a reference frequency.

source
SeisModels.vsvFunction.
vsv(m::SeisModel1D, r; depth=false, freq=reffrequency(m)) -> Vsv

Return the value of Vsv (km/s) for model m at radius r km.

If depth is true, then r is given as a depth in km instead.

If freq is given, then the velocity is corrected for attenuation. This requires the model has attenuation and a reference frequency.

source
SeisModels.etaFunction.
eta(m::SeisModel1D, r; depth=false) -> η

Return the value of η for model m at radius r km.

If depth is true, then r is given as a depth in km instead.

source
SeisModels.QμFunction.
Qμ(m::SeisModel1D, r; depth=false) -> Qμ

Return the value of Qμ for model m at radius r km.

If depth is true, then r is given as a depth in km instead.

source
SeisModels.QmuFunction.
Qμ(m::SeisModel1D, r; depth=false) -> Qμ

Return the value of Qμ for model m at radius r km.

If depth is true, then r is given as a depth in km instead.

source
SeisModels.QκFunction.
Qκ(m::SeisModel1D, r; depth=false) -> Qκ

Return the value of Qκ for model m at radius r km.

If depth is true, then r is given as a depth in km instead.

source
SeisModels.QkappaFunction.
Qκ(m::SeisModel1D, r; depth=false) -> Qκ

Return the value of Qκ for model m at radius r km.

If depth is true, then r is given as a depth in km instead.

source

Model enquiry

SeisModels.depthFunction.
depth(m, radius) -> depth

Return the depth in km for the model m given a radius in km.

source
hasattenuation(m) -> ::Bool

Return true if the model m includes attenuation and false otherwise.

source
SeisModels.hasdensityFunction.
hasdensity(m) -> ::Bool

Return true if density is defined for model m, and false otherwise.

source
hasreffrequency(m::PREMPolyModel) -> ::Bool

Return true if a reference frequency is defined for PREMPolyModel m, and false otherwise.

source
isanisotropic(m) -> ::Bool

Return true if the model m is anisotropic and false otherwise.

source
SeisModels.radiusFunction.
radius(m, depth) -> radius

Return the radius in km for the model m given a depth in km.

source
reffrequency(m::PREMPolyModel) = f

Return the reference frequency for a PREMPolyModel m in Hz.

source
surface_radius(m) -> radius

Return the surface radius in km of the SeisModel m.

source

Derived model properties

bulk_modulus(m::SeisModel1D, r; depth=false) -> K

Return the bulk modulus K in GPa at radius r km in the model m.

If depth is true, r is treated as a depth in km instead.

source
SeisModels.gravityFunction.
gravity(m::SeisModel1D, r; depth=false) -> g

Return the acceleration due to gravity, g, in m/s^2 at radius r in km.

If depth is true, r is treated as a depth in km instead.

source
SeisModels.massFunction.
mass(m::SeisModel1D, r; depth=false) -> mass

Return the mass in kg between the centre of the model and the radius r km.

If depth is true, r is treated as a depth in km instead.

mass(m) -> mass

Return the mass for the whole body in kg (between the centre of the model and the surface).

source
moment_of_inertia(m, r0=0, r1=surface_radius(m)) -> I

Return the moment of interia I in kg m² for the model m between radii r0 and r1 in km.

source
poissons_ratio(m, r; depth=false) -> ν

Return the Poisson's ratio for the model m given a radius r in km. The calculation uses the isotropic average velocities at r.

If depth is true, r is treated as a depth in km instead.

source
SeisModels.pressureFunction.
pressure(m::SeisModel1D, r; depth=false) -> p

Return the pressure p in Pa at radius r km.

If depth is true, r is treated as a depth in km instead.

source
shear_modulus(m::SeisModel1D, r; depth=false) -> μ

Return the shear modulus μ (often also called G) in GPa at radius r in the model m.

If depth is true, r is treated as a depth in km instead.

source
surface_mass(m::SeisModel1D, r; depth=false) -> mass

Return the mass in kg betwen radius r km and the surface.

If depth is true, r is treated as a depth in km instead.

source
youngs_modulus(m, r; depth=false) -> E

Return the Young's modulus E in GPa for the model m given a radius r in km.

If depth is true, r is treated as a depth in km instead.

source

Input/output

read_mineos(file) -> m::LinearLayeredModel

Read a 1D seismic model from a Mineos tabular format file.

References:

  • https://geodynamics.org/cig/software/mineos/mineos-manual.pdf
source
write_mineos(file, m::LinearLayeredModel, freq=1.0, title="Model from SeisModels.jl")
write_mineos(io::IO, m, args...)

Save a SeisModel1D as a Mineos 'tabular' format file to file on disk or to an io. Optionally supply the reference frequency freq in Hz (which defaults to 1 Hz) and a title.

Note that Mineos has two types of model file; one parameterised by radial knots with values interpolated linearly between them ('tabular' format), and one with PREM-style polynomials ('polynomial' format). Mineos uses the tabular format internally even if a polynomial file is read in, and testing suggests that polynomial files are not used correctly by the CIG version of Mineos, so it is not recommended to use them at all. Consequently, SeisModels does not support writing polynomial format files.

Reference

  • Mineos manual, https://geodynamics.org/cig/software/mineos/mineos-manual.pdf
source
SeisModels.read_tvelFunction.
read_tvel(file) -> model::LinearLayeredModel
read_tvel(io::IO) -> model::LinearLayeredModel

Read a model from a file in the ttimes 'tvel' format. This format specifies a LinearLayeredModel with only isotropic Vp, Vs and density.

The two header lines are ignored but must be present.

source
SeisModels.write_tvelFunction.
write_tvel(file, model::LinearLayeredModel; comment1="SeisModels.jl - P", comment2="SeisModels.jl - S")
write_tvel(io::IO, model; kwargs...)

Write a model to file or an arbitrary IO object in the ttimes 'tvel' format.

Optionally supply the two comment lines, comment1 and comment2 which form the header of the file.

source

Conversion

LinearLayeredModel(m::PREMPolyModel, spacing=20)

Convert the model m into a LinearLayeredModel, with radial knots spaced a maximum of spacing km apart.

source
LinearLayeredModel(m::SteppedLayeredModel)

Convert the model m into a LinearLayeredModel, with radial knots spaced at the bottom and top of each layer in m.

source
PREMPolyModel(m::LinearLayeredModel, order=1; fref=1.0)

Convert the model m into a PREMPolyModel, with maximum polynomial order. The reference frequency fref in Hz can be given.

source
PREMPolyModel(m::SteppedLayeredModel, order=0; fref=1.0)

Convert the model m into a PREMPolyModel, with maximum polynomial order. The reference frequency fref in Hz can be given.

source
SteppedLayeredModel(m::Union{LinearLayeredModel, PREMPolyModel}, spacing=10)

Convert the model m into a SteppedLayeredModel, with layer tops spaced a maximum of spacing km apart. Where layer tops of m lie between the regular set of spacing layer tops, extra layers are inserted. Thus layer tops in the new model always coincide with discontinuities in m.

Layers take the value of the properties at the midpoint of the spacing km interval in the original PREMPolyModel.

source

Construction

LinearLayeredModel(; kwargs...) -> m

Construct a LinearLayeredModel by specifying keyword arguments. The length of arrays defines the number of layers and the presence of arguments determines whether the model has density, anisotropy and attenuation.

Note that radii are given in km, velocities in km/s, densities in g/cm³ and frequency in Hz.

Keyword arguments

Radii

  • r: The radius of a set of nodes ranging from the centre of the planet to the surface, in km. When the same value of r is repeated twice, a discontinuity is introduced at that radius. The first value of r must be 0 km. This is the only mandatory argument.

Isotropic properties

These must be given each as a Vector of values at each radial node. Each parameter (vp, density, , etc.) must have the correct number of layers.

  • vp: P-wave velocity
  • vs: S-wave velocity
  • density: Material density

Anisotropic parameters

If the model is anisotropic and the radial anisotropy parameters are all provided, then the Voigt average velocities are constructed automatically unless vp and/or vs are also given separately.

  • vpv: Vertical P-wave velocity
  • vph: Horizontal P-wave velocity
  • vsv: Vertical S-wave velocity
  • vsh: Horizontally-polarised S-wave velocity
  • eta: The ratio C₁₃/(Vph - 2Vsv), where cᵢⱼ is the Voigt elasticity matrix, the 1-direction is horizontal and the 3-direction is radial

Attenuation parameters

ASCII versions (Qmu, Qkappa) of these exist for ease of use as well as the Unicode versions (, ). If both are supplied, an error is thrown.

  • or Qmu: Shear modulus quality factor
  • or Qkappa: Bulk modulus quality factor
source
PREMPolyModel(; kwargs...) -> m

Construct a PREMPolyModel by specifying keyword arguments. The length of arrays defines the number of layers and the presence of arguments determines whether the model has density, anisotropy and attenuation.

Note that radii are given in km, velocities in km/s, densities in g/cm³ and frequency in Hz.

Keyword arguments

Radii

  • r: The upper radii of each layer in km. This is the only mandatory argument.

Isotropic properties

These must be given each as an (norder + 1)×nlayers Matrix of polynomial coefficients. Each parameter (vp, density, , etc.) may have a different polynomial order, but all must have the correct number of layers

  • vp: P-wave velocity
  • vs: S-wave velocity
  • density: Material density

Anisotropic parameters

If the model is anisotropic and the radial anisotropy parameters are all provided, then the Voigt average velocities are constructed automatically unless vp and/or vs are also given separately.

  • vpv: Vertical P-wave velocity
  • vph: Horizontal P-wave velocity
  • vsv: Vertical S-wave velocity
  • vsh: Horizontally-polarised S-wave velocity
  • eta: The ratio C₁₃/(Vph - 2Vsv), where cᵢⱼ is the Voigt elasticity matrix, the 1-direction is horizontal and the 3-direction is radial

Attenuation parameters

ASCII versions (Qmu, Qkappa) of these exist for ease of use as well as the Unicode versions (, ). If both are supplied, an error is thrown.

  • or Qmu: Shear modulus quality factor
  • or Qkappa: Bulk modulus quality factor
  • fref: Reference Q frequency
source
SteppedLayeredModel(; kwargs...) -> m

Construct a SteppedLayeredModel by specifying keyword arguments. The length of arrays defines the number of layers and the presence of arguments determines whether the model has density, anisotropy and attenuation.

Note that radii are given in km, velocities in km/s, densities in g/cm³ and frequency in Hz.

Keyword arguments

Radii

  • r: The upper radius of a set of constant layers in km. The uppermost layer radius is taken to be the planetary radius. This is the only mandatory argument.

Isotropic properties

These must be given each as a Vector of values for each layer. Each parameter (vp, density, , etc.) must have the correct number of layers.

  • vp: P-wave velocity
  • vs: S-wave velocity
  • density: Material density

Anisotropic parameters

If the model is anisotropic and the radial anisotropy parameters are all provided, then the Voigt average velocities are constructed automatically unless vp and/or vs are also given separately.

  • vpv: Vertical P-wave velocity
  • vph: Horizontal P-wave velocity
  • vsv: Vertical S-wave velocity
  • vsh: Horizontally-polarised S-wave velocity
  • eta: The ratio C₁₃/(Vph - 2Vsv), where cᵢⱼ is the Voigt elasticity matrix, the 1-direction is horizontal and the 3-direction is radial

Attenuation parameters

ASCII versions (Qmu, Qkappa) of these exist for ease of use as well as the Unicode versions (, ). If both are supplied, an error is thrown.

  • or Qmu: Shear modulus quality factor
  • or Qkappa: Bulk modulus quality factor
source