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
Fomosto backend for the GEMINI program system. |
|
Functions
|
Check that the variant of a modelling backend is supported. |
|
Undo the time shift and amplitude error of a rectangle rule integration. |
|
Get comma-separated list of the modelling code IDs of a backend. |
Get the modelling backend variants which can be used with |
- 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,
Noneif none was givenvariants – the backend’s
variantsdict
- Raises:
StoreErrorif 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]), wherevare exact samples of the time derivative. Compared to the exact integral, this delays the result by half a sample and amplifies it byx / sin(x), withx = pi * f * deltat(up to a factor of 1.57 at the Nyquist frequency). This function applies the inverse filterexp(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 integrationdeltat – 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 (Nonefor a backend without variants) to the list of executables it needs.- Returns:
list of
(modelling_code_id, missing)tuples, wheremissingis the list of required executables which are not found in thePATH, orNoneif the backend module cannot be imported.