array_processing.tools.array_characterization module¶
-
array_processing.tools.array_characterization.
arraySig
(rij, kmax, sigLevel, p=0.9, velLims=(0.27, 0.36), NgridV=100, NgridTh=100, NgridK=100)[source]¶ Estimate 2-D array uncertainties in trace velocity and back-azimuth, and calculate impulse response.
Parameters: - rij – Coordinates (km) of sensors as eastings & northings in a
(2, N)
array - kmax (float) – Impulse response will be calculated over the range [-kmax, kmax] in \(k\)-space (1/km)
- sigLevel (float) – Variance in time delays (s), typically \(\sigma_\tau\)
- p (float) – Confidence limit in uncertainty estimates
- velLims (tuple) – Range of trace velocities (km/s) to estimate uncertainty over. A single value can be used, but the by default a range is used
- NgridV (int) – Number of velocities to estimate uncertainties in range velLims
- NgridTh (int) – Number of angles to estimate uncertainties in range \([0^\circ, 360^\circ]\)
- NgridK (int) – Number of \(k\)-space coordinates to calculate in each dimension
Returns: Tuple containing:
- sigV – Uncertainties in trace velocity (°) as a function of trace
velocity and back-azimuth as
(NgridTh, NgridV)
array - sigTh – Uncertainties in trace velocity (km/s) as a function of
trace velocity and back-azimuth as
(NgridTh, NgridV)
array - impResp – Impulse response over grid as
(NgridK, NgridK)
array - vel – Vector of trace velocities (km/s) for axis in
(NgridV, )
array - th – Vector of back azimuths (°) for axis in
(NgridTh, )
array - kvec – Vector wavenumbers for axes in \(k\)-space in
(NgridK, )
array
Return type: - rij – Coordinates (km) of sensors as eastings & northings in a
-
array_processing.tools.array_characterization.
chi2
(nu, alpha, funcTol=1e-10)[source]¶ Calculate value of a \(\chi^2\) such that a \(\nu\)-dimensional confidence ellipsoid encloses a fraction \(1 - \alpha\) of normally distributed variable.
Parameters: Returns: Value of a \(\chi^2\) enclosing \(1 - \alpha\) confidence region
Return type:
-
array_processing.tools.array_characterization.
co_array
(rij)[source]¶ Form co-array coordinates for given array coordinates.
Parameters: rij – (d, n)
array;n
sensor coordinates as [northing, easting, {elevation}] column vectors ind
dimensionsReturns: (d, n(n-1)//2)
co-array, coordinates of the sensor pairing separations
-
array_processing.tools.array_characterization.
cubicEqn
(a, b, c)[source]¶ Roots of cubic equation in the form \(x^3 + ax^2 + bx + c = 0\).
Parameters: Returns: Roots of cubic equation in standard form
Return type: See also
numpy.roots()
— Generic polynomial root finderNotes
Relatively stable solutions, with some tweaks by Dr. Z, per algorithm of Numerical Recipes 2nd ed., \(\S\) 5.6. Even
numpy.roots()
can have some (minor) issues; e.g., \(x^3 - 5x^2 + 8x - 4 = 0\).
-
array_processing.tools.array_characterization.
impulseResp
(dij, kmax, NgridK)[source]¶ Calculate impulse response of a 2-D array.
Parameters: Returns: Tuple containing:
- d – Impulse response over grid as
(NgridK, NgridK)
array - kvec - Vector wavenumbers for axes in \(k\)-space in
(NgridK, )
array
Return type: - d – Impulse response over grid as
-
array_processing.tools.array_characterization.
quadraticEqn
(a, b, c)[source]¶ Roots of quadratic equation in the form \(ax^2 + bx + c = 0\).
Parameters: Returns: Roots of quadratic equation in standard form
Return type: See also
numpy.roots()
— Generic polynomial root finderNotes
Stable solutions, even for \(b^2 >> ac\) or complex coefficients, per algorithm of Numerical Recipes 2nd ed., \(\S\) 5.6.
-
array_processing.tools.array_characterization.
quarticEqn
(a, b, c, d)[source]¶ Roots of quartic equation in the form \(x^4 + ax^3 + bx^2 + cx + d = 0\).
Parameters: Returns: Roots of quartic equation in standard form
Return type: See also
numpy.roots()
— Generic polynomial root finderNotes
Stable solutions per algorithm of CRC Std. Mathematical Tables, 29th ed.
-
array_processing.tools.array_characterization.
read_kml
(kml_file)[source]¶ Parse an array KML file into a list of element latitudes and longitudes.
KML file must contain a single folder containing the array element points.
Parameters: kml_file (str) – Full path to input KML file (extension .kml
)Returns: (latlist, lonlist)
for input togetrij()
Return type: tuple
-
array_processing.tools.array_characterization.
rthEllipse
(a, b, x0, y0)[source]¶ Calculate angles subtending, and extremal distances to, a coordinate-aligned ellipse from the origin.
Parameters: Returns: Tuple containing:
eExtrm – Extremal parameters in
(4, )
array as[min distance, max distance, min angle (degrees), max angle (degrees)]
eVec – Coordinates of extremal points on ellipse in
(4, 2)
array as[[x min dist., y min dist.], [x max dist., y max dist.], [x max angle tangency, y max angle tangency], [x min angle tangency, y min angle tangency]]
Return type: