pycsamt.zonge.z#

Impedance tensor (Z) component for Zonge AVG data.

This module provides the Z class, which computes the complex impedance tensor from apparent resistivity and phase data. It inherits from TensorBase to provide powerful reshaping and analysis capabilities.

Classes

Z([data, meta, name, verbose])

Complex impedance tensor (Z) component.

class pycsamt.zonge.z.Z(data=None, meta=None, *, name=None, verbose=0)[source]#

Bases: TensorBase

Complex impedance tensor (Z) component.

This class reads a tidy AVG table and computes the complex impedance Z from apparent resistivity (\(\rho_a\)) and impedance phase (\(\phi\)). It provides properties to access the complex tensor, its real and imaginary parts, and the propagated error.

The impedance is calculated using the standard formula [1]:

\[Z = \sqrt{\rho_a \cdot \omega \cdot \mu_0} \cdot e^{i \cdot \phi}\]

where \(\omega = 2\pi f\).

Variables:
  • z (pd.Series) – The complex impedance \(Z\) in Ohms [Ω].

  • z_imag (z_real,) – The real and imaginary parts of the impedance tensor.

  • z_err (pd.Series) – The propagated error in the magnitude of \(Z\), \(|dZ|\), in Ohms [Ω].

  • z_yy (z_xx, z_xy, z_yx,) – Convenience properties to access the individual components of the complex impedance tensor.

Parameters:

Examples

>>> from pycsamt.zonge import Z
>>> from pycsamt.zonge.avg import AVG
>>> avg = AVG.from_file('data/avg/K2.avg')
>>> z_component = avg.z
>>> # Get the complex impedance for all measurements
>>> complex_z_values = z_component.z
>>> # Get only the Z_xy component
>>> z_xy = z_component.z_xy

References

See also

TensorBase

The parent class providing tensor-shaping logic.

read(source, meta=None, **kws)[source]#

Read and prepare data for impedance calculation.

Parameters:
Return type:

None

property z: Series[source]#

Complex impedance Z [Ω].

property z_real: Series[source]#

Real part of the impedance tensor, Z’ [Ω].

property z_imag: Series[source]#

Imaginary part of the impedance tensor, Z’’ [Ω].

property z_err: Series[source]#

Propagated error in the magnitude of Z, |dZ| [Ω].

Calculated via standard error propagation from the relative error in resistivity (dρ/ρ) and the absolute error in phase (dφ).

\[|dZ| \approx \sqrt{ (\frac{\partial |Z|}{\partial \rho} d\rho)^2 + (|Z| d\phi)^2 }\]

Since phase errors are often dominant and uncorrelated, a simpler estimate is often used:

\[|dZ| \approx \frac{1}{2} |Z| \frac{d\rho}{\rho}\]
property z_xx: Series[source]#

Complex impedance for the Zxx component.

property z_xy: Series[source]#

Complex impedance for the Zxy component.

property z_yx: Series[source]#

Complex impedance for the Zyx component.

property z_yy: Series[source]#

Complex impedance for the Zyy component.

property z_xx_err: Series[source]#

Propagated error for the Zxx component.

property z_xy_err: Series[source]#

Propagated error for the Zxy component.

property z_yx_err: Series[source]#

Propagated error for the Zyx component.

property z_yy_err: Series[source]#

Propagated error for the Zyy component.

to_tensor(*, var='z', station=None, agg='mean', fill_value=nan, sort_freq=True, align='union')[source]#

Convert impedance data into a 2x2 tensor.

Parameters:
Return type:

tuple[ndarray, ndarray, ndarray]

to_xarray(*, var='z', station=None, agg='mean', fill_value=nan, attrs=None)[source]#

Return a 3D or 4D xarray.DataArray.

Parameters:
write()[source]#

Serializes the core Z data to a CSV block.

Return type:

Sequence[str]