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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

Model enquiry

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

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

SeisModels.discontinuitiesFunction
discontinuities(m::LinearLayeredModel; depths=false) -> radii, indices

Return the radii (or depths if depths=true; both in km) and indices of velocity discontinuities for the 1D LinearLayeredModel m.

Discontinuities are marked in LinearLayeredModels by two repeated radii, and the index returned for each one is the lower index. Therefore indices gives the properties of the model below the discontinuities, and indices .+ 1 gives the properties above.

Example

julia> radii, inds = discontinuities(AK135)
([1217.5, 3479.5, 3631.0, 5711.0, 5961.0, 6161.0, 6336.0, 6351.0], [24, 69, 73, 116, 122, 127, 132, 134])

julia> index_icb = inds[1]
24

julia> AK135.vp[index_icb], AK135.vp[index_icb + 1]
(11.0427, 10.289)
SeisModels.hasattenuationFunction
hasattenuation(m) -> ::Bool

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

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

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

SeisModels.hasreffrequencyFunction
hasreffrequency(m::PREMPolyModel) -> ::Bool

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

SeisModels.isanisotropicFunction
isanisotropic(m) -> ::Bool

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

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

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

SeisModels.reffrequencyFunction
reffrequency(m::PREMPolyModel) = f

Return the reference frequency for a PREMPolyModel m in Hz.

Derived model properties

SeisModels.bulk_modulusFunction
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.

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.

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).

SeisModels.moment_of_inertiaFunction
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.

SeisModels.poissons_ratioFunction
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.

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.

SeisModels.shear_modulusFunction
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.

SeisModels.surface_massFunction
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.

SeisModels.youngs_modulusFunction
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.

Input/output

SeisModels.read_mineosFunction
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
SeisModels.write_mineosFunction
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
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.

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.

Conversion

SeisModels.LinearLayeredModelMethod
LinearLayeredModel(m::PREMPolyModel, spacing=20)

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

SeisModels.LinearLayeredModelMethod
LinearLayeredModel(m::SteppedLayeredModel)

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

SeisModels.PREMPolyModelMethod
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.

SeisModels.PREMPolyModelMethod
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.

SeisModels.SteppedLayeredModelMethod
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.

Construction

SeisModels.LinearLayeredModelMethod
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
SeisModels.PREMPolyModelMethod
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
SeisModels.SteppedLayeredModelMethod
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