watex.externals.z.Z#
- class watex.externals.z.Z(z_array=None, z_err_array=None, freq=None)[source]#
Z class - generates an impedance tensor (Z) object.
Z is a complex array of the form (n_freq, 2, 2), with indices in the following order:
Zxx: (0,0)
Zxy: (0,1)
Zyx: (1,0)
Zyy: (1,1)
All errors are given as standard deviations (sqrt(VAR))
- Parameters:
z_array (numpy.ndarray(n_freq, 2, 2)) β array containing complex impedance values
z_err_array (numpy.ndarray(n_freq, 2, 2)) β array containing error values (standard deviation) of impedance tensor elements
freq (np.ndarray(n_freq)) β array of frequency values corresponding to impedance tensor elements.
Attributes
Description
freq
array of frequencies corresponding to elements of z
rotation_angle
angle of which data is rotated by
z
impedance tensor
z_err
estimated errors of impedance tensor
resistivity
apparent resisitivity estimated from z in Ohm-m
resistivity_err
apparent resisitivity error
phase
impedance phase (deg)
phase_err
error in impedance phase
Methods
Description
det
calculates determinant of z with errors
invariants
calculates the invariants of z
inverse
calculates the inverse of z
remove_distortion
removes distortion given a distortion matrix
remove_ss
removes static shift by assumin Z = S * Z_0
norm
calculates the norm of Z
only1d
zeros diagonal components and computes the absolute valued mean of the off-diagonal components.
only2d
zeros diagonal components
res_phase
computes resistivity and phase
rotate
rotates z positive clockwise, angle assumes North is 0.
set_res_phase
recalculates z and z_err, needs attribute freq
skew
calculates the invariant skew (off diagonal trace)
trace
calculates the trace of z
- Example:
>>> import mtpy.core.z as mtz >>> import numpy as np >>> z_test = np.array([[0+0j, 1+1j], [-1-1j, 0+0j]]) >>> z_object = mtz.Z(z_array=z_test, freq=[1]) >>> z_object.rotate(45) >>> z_object.resistivity