pyrocko.fomosto.gemini

Fomosto backend for the GEMINI program system.

GEMINI (Green’s function of the Earth by MINor integration) by Jörg Dalkolmo and Wolfgang Friederich computes complete synthetic seismograms for a spherically symmetric, transversely isotropic, anelastic earth by numerical integration of the equations of motion in the frequency domain [Friederich & Dalkolmo 1995]. It consists of three programs, which this backend expects to be installed as fomosto_gemini_Gemini_2_2, fomosto_gemini_Dispec_2_2 and fomosto_gemini_Totido_2_2, e.g. with the fomosto-gemini package:

  • Gemini computes the Green’s basis solutions in the frequency-degree domain for a given source depth.

  • Dispec combines them with a moment tensor source and sums over the spherical harmonics, giving spectra at the receivers.

  • Totido transforms the spectra to the time domain.

The earth model, which may be transversely isotropic, is given in GEMINI’s own polynomial format in the earthmodel entry of the store’s extra/gemini file. The earthmodel_1d in the store’s config is an isotropic approximation of it, used for travel time tables. If the earthmodel entry is omitted, it is fitted to earthmodel_1d when the store is built.

Models can be converted between the formats on the command line:

python -m pyrocko.fomosto.gemini nd-to-gemini IN OUT
python -m pyrocko.fomosto.gemini gemini-to-nd IN OUT

Receivers must be at the surface. Components are computed in source-centred coordinates, with the source at the north pole and the receivers on the 180° meridian, so that any epicentral distance between 0° and 180° can be used.

References

Friederich, W. and Dalkolmo, J. (1995): Complete synthetic seismograms for a spherically symmetric earth by a numerical computation of the Green’s function in the frequency domain. Geophysical Journal International, 122, 537-550.

Functions

build(store_dir[, force, nworkers, ...])

Build GF store with GEMINI.

have_backend()

Get the GEMINI versions for which all programs are available.

init(store_dir, variant[, config_params, ...])

Initialize GF store for GEMINI.

main([args])

Command line tool to convert earth models between formats.

Classes

GeminiConfig(**kwargs)

Configuration of the GEMINI backend, stored in extra/gemini.

GeminiEarthmodel(...)

Earth model in GEMINI's native file format.

GeminiGFBuilder(store_dir[, force, tmp, ...])

Builds a GF store with GEMINI.

GeminiLayer(r_bottom, coefs, qmu, qkappa)

Layer of a GEMINI earth model.

GeminiModel(layers, r_surface[, ...])

Spherically symmetric, possibly transversely isotropic GEMINI earth model.

have_backend()[source]

Get the GEMINI versions for which all programs are available.

class GeminiLayer(r_bottom, coefs, qmu, qkappa)[source]

Bases: object

Layer of a GEMINI earth model.

Parameters:
  • r_bottom – radius of the bottom of the layer [km]

  • coefs – polynomial coefficients, array of shape (ncoefs, 6). The columns are density [g/cm^3], vertical and horizontal P-wave velocity, vertical and horizontal S-wave velocity [km/s], and the anisotropy parameter eta. Rows are the coefficients of increasing powers of the normalized radius x = r / r_surface.

  • qmu – shear quality factor, <= 0 for a fluid layer

  • qkappa – bulk quality factor

evaluate(x)[source]

Evaluate the polynomials at normalized radii x.

Returns:

array of shape (6, len(x)) with the rows density, vpv, vph, vsv, vsh, eta

class GeminiModel(layers, r_surface, reference_frequency=1.0, transversely_isotropic=False, comments=None)[source]

Bases: object

Spherically symmetric, possibly transversely isotropic GEMINI earth model.

Densities are in [g/cm^3], velocities in [km/s] and radii in [km], as in the native file format of GEMINI. Layers are ordered from the centre to the surface.

classmethod from_string(s)[source]

Parse earth model in GEMINI’s native file format.

This reads the format the same way as GEMINI’s gtmanis.f does.

to_string()[source]

Get earth model in GEMINI’s native file format.

isotropic_properties(layer, r)[source]

Get isotropic approximation of the material properties of a layer.

For a transversely isotropic model the equivalent isotropic Voigt average moduli are used, as by GEMINI (after Dziewonski & Anderson 1980). For an isotropic model only the vertical velocities are used, as by GEMINI.

Parameters:
Returns:

(vp, vs, rho, qp, qs), arrays in SI units

to_cake(rtol=0.0005)[source]

Get isotropic approximation as pyrocko.cake.LayeredModel.

Each polynomial layer is approximated by gradient layers, with nodes inserted until linear interpolation deviates by less than rtol (relative) from the polynomials.

Discontinuities are named, as needed for standard phase definitions, if they are roughly at the expected depth (see discontinuity_depth_ranges): the top of a fluid layer is named cmb, its bottom icb, and the shallowest discontinuity with a P-wave velocity increasing across 7.5 km/s is named moho.

classmethod from_cake(mod, nlayers_max=20, rtol_velocity=0.002, rtol_q=0.1, nsamples_per_layer=20)[source]

Approximate pyrocko.cake.LayeredModel by GEMINI layers.

The model is split at its discontinuities. The material properties in each part are fitted with polynomials of up to third order in the normalized radius, the quality factors are averaged. As long as the total number of layers stays at most nlayers_max, the worst fitting part is split further, at the node minimizing the misfit. The misfit is the maximum of the relative misfit of velocities and density divided by rtol_velocity and the relative deviation of the quality factors from the layer’s constant value divided by rtol_q. A warning is issued if it exceeds 1 in the end.

max_deviation(mod, ddepth=10000.0)[source]

Get maximum relative deviation from an isotropic cake model.

Compares the isotropic approximation of this model to mod in terms of P- and S-wave velocities and density, at regularly sampled depths, avoiding the immediate vicinity of discontinuities.

Returns:

maximum relative deviation and depth [m] where it occurs

class GeminiEarthmodel(...) → pyrocko.fomosto.gemini.GeminiModel[source]

Bases: Object

Earth model in GEMINI’s native file format.

class GeminiConfig(**kwargs)[source]

Bases: Object

Configuration of the GEMINI backend, stored in extra/gemini.

♦ gemini_version

str, optional

Version of the GEMINI programs to use (required, set by fomosto init).

♦ earthmodel

pyrocko.fomosto.gemini.GeminiModel (GeminiEarthmodel), optional

Earth model in GEMINI’s native format (radius in [km], density in [g/cm^3], velocities in [km/s], coefficients of polynomials in the normalized radius r/r_surface), possibly transversely isotropic. If not given, it is fitted to the isotropic earthmodel_1d of the store’s config.

♦ time_region

tuple of 2 pyrocko.gf.meta.Timing objects, default: (<pyrocko.gf.meta.Timing object at 0x7f5d78cc9a90>, <pyrocko.gf.meta.Timing object at 0x7f5d786f8510>)

Time window to be covered by the computed seismograms.

♦ cut

tuple of 2 pyrocko.gf.meta.Timing objects, optional

Time window to which the Green’s functions are cut before they are stored.

♦ time_window_factor

float, default: 2.0

Factor to enlarge the length of the FFT time window relative to time_region (it is further enlarged to a power of two samples), to keep energy arriving after the time window from wrapping around into it.

♦ damping_time

float, optional

Damping time of the complex frequency [s], to suppress time-domain aliasing. Default is a fifth of the FFT time window length.

♦ frequency_max

float, optional

Maximum frequency [Hz]. Default is just below the Nyquist frequency of the store.

♦ slowness_max

float, default: 0.6

Maximum horizontal slowness [s/km], determining the maximum harmonic degree to compute at each frequency. Truncation of the harmonic degree range produces an artificial arrival with this slowness, so it should be above the slowness of the slowest phases of interest and arrive after the end of the time window.

♦ harmonic_degree_max

int, default: 10000

Absolute limit for the harmonic degree.

♦ degree_taper_length

int, default: 40

Length of the cosine taper applied at the upper end of the harmonic degree range by Dispec. The degree range is enlarged by this amount.

♦ include_physical_dispersion

bool, default: True

Whether to use anelastic, frequency-dependent, complex moduli (at the reference frequency of the model). If false, GEMINI computes purely elastic, unattenuated seismograms.

♦ accuracy

float, default: 0.0001

Accuracy of the Bulirsch-Stoer integration in GEMINI.

♦ lowpass_order

int, default: 0

Order of Butterworth low-pass filter to apply (0: no filter).

♦ lowpass_corner

float, default: 1.0

Corner frequency of Butterworth low-pass filter [Hz].

♦ nlayers_max

int, default: 20

Maximum number of earth model layers supported by the GEMINI executable.

♦ keep_basis_solutions

bool, default: False

Whether to keep the files with basis solutions computed by GEMINI (in the store’s gemini_green directory) after the store has been built.

class GeminiGFBuilder(store_dir, force=False, tmp=None, keep_tmp=False)[source]

Bases: object

Builds a GF store with GEMINI.

Step 1 runs Gemini for each source depth (one block per depth). Step 2 runs Dispec and Totido for each of the elementary moment tensor sources (one block per source depth and range of up to 149 distances) and stores the Green’s functions.

async run(runner, jobs, on_done, remove_basis=False)[source]

Run the given jobs, (step, iblock) pairs.

Step 2 blocks wait for the step 1 block of their source depth, if it is among the jobs. With remove_basis, the basis solutions of a source depth are removed when its step 2 jobs are done. This is only safe if the jobs include all of its step 2 blocks not done yet.

build(store_dir, force=False, nworkers=None, continue_=False, step=None, iblock=None)[source]

Build GF store with GEMINI.

Follows the conventions of the build method of pyrocko.gf.builder.Builder regarding the continue_, step and iblock arguments. Step 1 computes the basis solutions with Gemini (one block per source depth), step 2 computes and stores the Green’s functions with Dispec and Totido. Without step, both steps run as a pipeline.

init(store_dir, variant, config_params=None, earthmodel=None)[source]

Initialize GF store for GEMINI.

Parameters:
  • config_params – dict with parameters to override in the store’s config

  • earthmodel – GeminiModel, possibly transversely isotropic, to be used. If given, the store’s earthmodel_1d is set to its isotropic approximation, unless explicitly given in config_params. Otherwise, the GEMINI earth model is fitted to earthmodel_1d.

main(args=None)[source]

Command line tool to convert earth models between formats.