Index of functions
Basic physical properties
SeisModels.evaluate
— Functionevaluate(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.vp
— Functionvp(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.vs
— Functionvs(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.density
— Functiondensity(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.vph
— Functionvph(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.vpv
— Functionvpv(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.vsh
— Functionvsh(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.vsv
— Functionvsv(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.eta
— Functioneta(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μ
— FunctionQμ(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.Qmu
— FunctionQμ(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κ
— FunctionQκ(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.Qkappa
— FunctionQκ(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.depth
— Functiondepth(m, radius) -> depth
Return the depth
in km for the model m
given a radius
in km.
SeisModels.discontinuities
— Functiondiscontinuities(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 LinearLayeredModel
s 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.hasattenuation
— Functionhasattenuation(m) -> ::Bool
Return true
if the model m
includes attenuation and false
otherwise.
SeisModels.hasdensity
— Functionhasdensity(m) -> ::Bool
Return true
if density is defined for model m
, and false
otherwise.
SeisModels.hasreffrequency
— Functionhasreffrequency(m::PREMPolyModel) -> ::Bool
Return true
if a reference frequency is defined for PREMPolyModel
m
, and false
otherwise.
SeisModels.isanisotropic
— Functionisanisotropic(m) -> ::Bool
Return true
if the model m
is anisotropic and false
otherwise.
SeisModels.radius
— Functionradius(m, depth) -> radius
Return the radius
in km for the model m
given a depth
in km.
SeisModels.reffrequency
— Functionreffrequency(m::PREMPolyModel) = f
Return the reference frequency for a PREMPolyModel
m
in Hz.
SeisModels.surface_radius
— Functionsurface_radius(m) -> radius
Return the surface radius in km of the SeisModel
m
.
Derived model properties
SeisModels.bulk_modulus
— Functionbulk_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.gravity
— Functiongravity(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.mass
— Functionmass(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_inertia
— Functionmoment_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_ratio
— Functionpoissons_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.pressure
— Functionpressure(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_modulus
— Functionshear_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_mass
— Functionsurface_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_modulus
— Functionyoungs_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_mineos
— Functionread_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_mineos
— Functionwrite_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_tvel
— Functionread_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_tvel
— Functionwrite_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.LinearLayeredModel
— MethodLinearLayeredModel(m::PREMPolyModel, spacing=20)
Convert the model m
into a LinearLayeredModel
, with radial knots spaced a maximum of spacing
km apart.
SeisModels.LinearLayeredModel
— MethodLinearLayeredModel(m::SteppedLayeredModel)
Convert the model m
into a LinearLayeredModel
, with radial knots spaced at the bottom and top of each layer in m
.
SeisModels.PREMPolyModel
— MethodPREMPolyModel(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.PREMPolyModel
— MethodPREMPolyModel(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.SteppedLayeredModel
— MethodSteppedLayeredModel(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.LinearLayeredModel
— MethodLinearLayeredModel(; 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 ofr
is repeated twice, a discontinuity is introduced at that radius. The first value ofr
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
, Qμ
, etc.) must have the correct number of layers.
vp
: P-wave velocityvs
: S-wave velocitydensity
: 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 velocityvph
: Horizontal P-wave velocityvsv
: Vertical S-wave velocityvsh
: Horizontally-polarised S-wave velocityeta
: 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 (Qμ
, Qκ
). If both are supplied, an error is thrown.
Qμ
orQmu
: Shear modulus quality factorQκ
orQkappa
: Bulk modulus quality factor
SeisModels.PREMPolyModel
— MethodPREMPolyModel(; 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
, Qμ
, etc.) may have a different polynomial order, but all must have the correct number of layers
vp
: P-wave velocityvs
: S-wave velocitydensity
: 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 velocityvph
: Horizontal P-wave velocityvsv
: Vertical S-wave velocityvsh
: Horizontally-polarised S-wave velocityeta
: 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 (Qμ
, Qκ
). If both are supplied, an error is thrown.
Qμ
orQmu
: Shear modulus quality factorQκ
orQkappa
: Bulk modulus quality factorfref
: Reference Q frequency
SeisModels.SteppedLayeredModel
— MethodSteppedLayeredModel(; 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
, Qμ
, etc.) must have the correct number of layers.
vp
: P-wave velocityvs
: S-wave velocitydensity
: 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 velocityvph
: Horizontal P-wave velocityvsv
: Vertical S-wave velocityvsh
: Horizontally-polarised S-wave velocityeta
: 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 (Qμ
, Qκ
). If both are supplied, an error is thrown.
Qμ
orQmu
: Shear modulus quality factorQκ
orQkappa
: Bulk modulus quality factor