API Reference#
The Application Programming Interface (API) of PyNetDesign is composed of the following modules:
Modelling: algorithms for modelling related to microseismic network design
Core: high-level drivers for magnitude sensitivity
Homogeneous: algorithms for a homogeneous velocity model
Geometry generators: synthetic geometry generators
Input / output: reading and writing geometry and velocity files
Classes: parameter containers
Modelling utilities: wave modes, radiation patterns, amplitudes and grid helpers
Visualization: plotting of results and input
Geometry: receiver geometry
Sensitivity: magnitude sensitivity results
Visualization utilities: general utility functions for visualization
Modelling#
Core#
|
Computes detectable magnitude sensitivity for input geometry, velocity and parameters. |
|
Computes magnitude sensitivity using mag_sensitivity_grid for input local geometry, velocity and parameters. |
Homogeneous#
|
Computes magnitude sensitivity - the minimum moment magnitude (Mw) of a microseismic event which will theoretically produce particle velocity amplitudes (of P and/or S waves) on stations necessary for event detection assuming 3D elastic homogeneous medium with attenuation. |
|
Calculates the seismic moment \(M_0\) in a homogeneous medium given the density \(\rho\), wave velocity \(v\), distance from the source \(r\) and the displacement amplitude spectrum \(\left|U(f)\right|\) using: |
|
Calculates the peak frequency \(f_{peak}\) for particle velocity in a homogeneous medium given the wave velocity \(v\), the attenuation factor \(Q\), and the distance from a source \(r\) using: |
|
Validates the input parameters. |
Geometry generators#
|
Generate a DAS geometry file in PyNetDesign tab-delimited format. |
|
Generate borehole DAS channel coordinates. |
|
Generate surface DAS channel coordinates. |
|
Generate a continuous dark-fiber cable path. |
Input / output#
|
Read geometry data from a whitespace-delimited CSV (ASCII) file and return a DataFrame. |
|
Save geometry to disk in a format compatible with |
|
Read velocity model data from a whitespace-delimited CSV (ASCII) file and return a DataFrame. |
|
Combine an arbitrary number of pandas DataFrames with geometries into one while retaining the ability to distinguish and recover the original DataFrames. |
Check if the given DataFrame is a combined geometry DataFrame created by combine_geometry. |
|
|
Decimate a non-combined geometry by keeping every |
|
Converts global latitude and longitude coordinates to Cartesian coordinates under a simple spherical Earth approximation. |
Classes#
|
Container for the parameters controlling event detection. |
Modelling utilities#
Wave modes and radiation patterns#
|
Return the canonical form of a wave mode. |
|
Expand a wave mode into the physical phases that must be evaluated. |
|
Return whether |
|
Return whether |
|
Return the S-family phases included in |
|
Return the root-mean-square radiation-pattern magnitude of a phase. |
|
Resolve the radiation-pattern magnitude to use for a phase. |
Magnitudes and amplitudes#
|
Calculates the moment magnitude \(M_w\) according to Kanamori (1977) using formula |
Calculates the seismic moment \(M_0\) from moment magnitude \(M_w\) according to Kanamori (1977) |
|
|
Get scaling coefficient(s) to convert to the amplitudes to displacement provided the type of original amplitudes and the frequency (or array of frequencies). |
|
Retrieve minimum amplitudes for P and S waves from geometry data, scaled based on noise type. |
Detectability and receiver response#
|
Computes detectable minimum magnitudes from magnitude sensitivities for individual stations with respect to number of stations necessary for event detection using P and/or S waves. |
|
Check that the minimum numbers of stations required for detection are valid. |
|
Compute free surface amplification coefficients for each station and grid point. |
|
Derive receiver projection coefficients for P, SV and SH polarizations. |
Return whether a geometry needs receiver-component projection. |
|
|
Derive directionality coefficients for P and S waves along a cable. |
Grids and helpers#
|
From the grid vectors x,y,z generates an array of grid point coordinates of size (nx*ny*nz,3). |
|
Reshape a flat grid array into a multidimensional array based on the provided grid vectors. |
|
Reshape data to 2D array using axes vectors. |
|
From the array of grid point coordinates of size (nx*ny*nz,3) retrieve coordinates of the slice plane at a given slice coordinate in a given slice dimension. |
|
Check if all points in |
|
Find indices of points in |
|
Find the n-th minimum value in each row of a given 2D numpy array. |
|
Check if the input value is close to zero and raise an error if true. |
Check if a sequence (tuple, list, or numpy array) contains only numeric values. |
|
|
Computes the greatest common divisor (GCD) of three positive float values. |
Visualization#
Geometry#
|
Plots either a map view or side view of stations as filled triangles with name labels. |
Sensitivity#
|
Plots magnitude sensitivity in map or side view with stations plotted as non-filled triangles with name labels. |
Visualization utilities#
|
Generate a colorscale from a colormap and number of colors. |
Check if code is run in a notebook. |
|
Check if code is run inside Spyder. |