pyrocko.fomosto

Green’s function store builders interfacing with the external modelling codes.

This subpackage contains the GF builders which are used by fomosto to interface with the various supported numerical forward modelling tools (Fomosto backends).

Modules

ahfullgreen

dummy

elastic10_fd_to_elastic10

elastic10_to_rotational8

gemini

Fomosto backend for the GEMINI program system.

poel

psgrn_pscmp

qseis

qseis2d

qssp

report

Functions

check_variant(name, variant, variants)

Check that the variant of a modelling backend is supported.

correct_rectangle_rule(ydata, deltat)

Undo the time shift and amplitude error of a rectangle rule integration.

format_variants(name, variants)

Get comma-separated list of the modelling code IDs of a backend.

get_backend_variants()

Get the modelling backend variants which can be used with fomosto init.

format_variants(name, variants)[source]

Get comma-separated list of the modelling code IDs of a backend.

check_variant(name, variant, variants)[source]

Check that the variant of a modelling backend is supported.

To avoid ambiguities, there is no default variant: for backends with variants, it must always be given.

Parameters:
  • name – name of the backend

  • variant – requested variant, None if none was given

  • variants – the backend’s variants dict

Raises:

StoreError if the variant is not supported

correct_rectangle_rule(ydata, deltat)[source]

Undo the time shift and amplitude error of a rectangle rule integration.

QSSP and QSEIS integrate their output with a running sum, so that ydata[k] = deltat * sum(v[:k]), where v are exact samples of the time derivative. Compared to the exact integral, this delays the result by half a sample and amplifies it by x / sin(x), with x = pi * f * deltat (up to a factor of 1.57 at the Nyquist frequency). This function applies the inverse filter exp(i x) * sin(x) / x.

The trace is padded with its first and last values before filtering, so that static offsets are preserved.

Parameters:
  • ydata (numpy.ndarray) – samples of the rectangle rule integration

  • deltat – sampling interval [s]

Returns:

corrected samples, same size as ydata

get_backend_variants()[source]

Get the modelling backend variants which can be used with fomosto init.

Backends declare their variants in a module-level dict variants, mapping the variant name (None for a backend without variants) to the list of executables it needs.

Returns:

list of (modelling_code_id, missing) tuples, where missing is the list of required executables which are not found in the PATH, or None if the backend module cannot be imported.