https://github.com/anowacki/momenttensors.jl

Seismic moment tensors in Julia

https://github.com/anowacki/momenttensors.jl

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 2 committers (50.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.1%) to scientific vocabulary

Keywords

julia moment-tensor seismology
Last synced: 11 months ago · JSON representation

Repository

Seismic moment tensors in Julia

Basic Info
  • Host: GitHub
  • Owner: anowacki
  • License: other
  • Language: Julia
  • Default Branch: master
  • Size: 64.5 KB
Statistics
  • Stars: 10
  • Watchers: 3
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
julia moment-tensor seismology
Created almost 10 years ago · Last pushed 12 months ago
Metadata Files
Readme License

README.md

MomentTensors.jl

Build Status Coverage status

What is MomentTensors.jl?

A Julia package for dealing with seismic moment tensors.

It is currently very limited, and useful for three main things:

  1. Calculating the radiation pattern for a moment tensor;
  2. Decomposing tensors into their istropic, double-couple and CLVD components; and
  3. Rotating moment tensors.

I wrote this module because these are by far the most common things I need to do in my day-to-day global seismologist life.

What it isn't

Currently, no plotting is performed, nor conversion between conventions.

The module internally assumes the Harvard/Global CMT convention (see the module interactive help for details), though nothing is stopping you using another convention with it as long as you remember which indices correspond to which directions.

Input/output is limited to reading the CMTSOLUTION format used by SPECFEM3D and the NDK format used by the GlobalCMT project.

How to install

MomentTensors.jl can be added to your Julia install like so:

julia julia> import Pkg; Pkg.add("MomentTensors")

How to use

MT type

MomentTensors.jl represents moment tensors using the MT type.

Construction

They can be constructed by: - passing a set of six moment tensor components, in the order Mrr, Mθθ, Mφφ, M, M, Mθφ), - a vector of length six containing these components, - a 3 × 3 matrix Mij with i,j ∈ {r,θ,φ}, or - the strike, dip and rake (in Aki & Richards convention) plus a moment in N.m.

The element type of an MT{T} where T instance is determined automatically from the values supplied, or one can specify a desired element type explicitly with e.g. MT{Float32}(1, 2, 3, 4, 5, 6).

See the docstring for MT for more details of construction.

Indexing

To retrieve an individual component of the MT m, you can: - access the i,j component with m[i,j] where i,j ∈ {1,2,3}; - get the named components with m[:rθ] or equivalently m[:rt] (see the docstring for getindex); and - get the Ith component of the six-element vector with m[I].

Exported functions

  • MT: Construct a new moment tensor.
  • amplitude_v_azimuth: Compute the P, SV and SH amplitudes, and polarisation angle, for a particular takeoff angle at a range of azimuths.
  • cmtsolution: Construct a new moment tensor from a string in the SPECFEM3D 'CMTSOLUTION' format
  • decompose: Decompose a moment tensor into its isotropic, double-couple and CLVD components, and report the relative proportion of the isotropic, deviatoric and double-couple parts, plus their associated moments.
  • eps_non_dc: Calculate the non-double-couple component of an MT as defined by Giardini.
  • m0: Return the scalar moment, given a moment magnitude.
  • mw: Return the moment magnitude, given a scalar moment.
  • ndk: Construct a new moment tensor from a string in the 'NDK' format used by the Global CMT project.
  • radiation_pattern: Compute the P, SV and SH amplitude, and S polarisation angle, along a specific takeoff angle and azimuth.
  • rotate: Rotate an MT.

Getting help

Functions are documented, so at the REPL type ? to get a help?> prompt, and type the name of the function:

```julia help?> MT search: MT mtime SymTridiagonal Meta Method match Matrix mktemp methods matchall

MT(rr, θθ, ϕϕ, rθ, rϕ, θϕ) -> ::MT MT(M::Vector(6)) -> ::MT MT(M::Array(3,3)) -> ::MT MT(strike, dip, rake, M0) -> ::MT

Construct a new MT (moment tensor) in the native frame used by MomentTensors:

•    Radial (r) upwards

•    Colatitude (θ or t) southwards

•    Longitude (ϕ or p) eastwards)

Several forms exist to construct a moment tensor:

•    Supply individual components as a list of arguments

•    Supply a 6-vector

•    Give a 3×3 matrix

•    Specify a strike, dip and rake in degrees, and scalar moment (N.m)

One may access the values of a moment tensor M in two ways:

1.   M[i,j] yields the elements of M.m as if they were a two-tensor

2.   M[::Symbol] yields the elements by name; see getindex(::MT) for details

```

Contributing

If you find a bug with MomentTensors or have suggestions for improvement, please open an issue giving as much information as possible on how to reproduce the bug or problem.

Pull requests to add new features are welcome and will be seriously considered. Please note that the package aims to be lightweight and rely on few external dependencies.

Owner

  • Name: Andy Nowacki
  • Login: anowacki
  • Kind: user

Lecturer at the School of Earth and Environment, University of Leeds, studying the Earth's deep interior.

GitHub Events

Total
  • Delete event: 2
  • Push event: 1
  • Pull request event: 3
  • Create event: 1
Last Year
  • Delete event: 2
  • Push event: 1
  • Pull request event: 3
  • Create event: 1

Committers

Last synced: over 3 years ago

All Time
  • Total Commits: 41
  • Total Committers: 2
  • Avg Commits per committer: 20.5
  • Development Distribution Score (DDS): 0.049
Top Committers
Name Email Commits
Andy Nowacki a****i@l****k 39
CompatHelper Julia c****y@j****g 2
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 12 months ago

All Time
  • Total issues: 0
  • Total pull requests: 10
  • Average time to close issues: N/A
  • Average time to close pull requests: 3 days
  • Total issue authors: 0
  • Total pull request authors: 4
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 9
  • Bot issues: 0
  • Bot pull requests: 7
Past Year
  • Issues: 0
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: 8 days
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 1
Top Authors
Issue Authors
Pull Request Authors
  • dependabot[bot] (11)
  • github-actions[bot] (2)
  • anowacki (2)
  • JuliaTagBot (1)
Top Labels
Issue Labels
Pull Request Labels
dependencies (11) github_actions (1)

Packages

  • Total packages: 1
  • Total downloads:
    • julia 1 total
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
juliahub.com: MomentTensors

Seismic moment tensors in Julia

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 1 Total
Rankings
Dependent repos count: 9.9%
Average: 32.3%
Dependent packages count: 38.9%
Stargazers count: 39.8%
Forks count: 40.4%
Last synced: 12 months ago

Dependencies

.github/workflows/CI.yaml actions
  • actions/cache v1 composite
  • actions/checkout v2 composite
  • codecov/codecov-action v4 composite
  • julia-actions/julia-buildpkg v1 composite
  • julia-actions/julia-processcoverage v1 composite
  • julia-actions/julia-runtest v1 composite
  • julia-actions/setup-julia v1 composite
.github/workflows/CompatHelper.yaml actions