pycsamt.zonge.ops#

This module contains functions for Zonge engineering calculations, based on the GDP DATA PROCESSING MANUAL.

Functions

calculate_apparent_resistivity(e_mag, h_mag)

Calculates the apparent resistivity (Rho Apparent) from the E-field and H-field magnitudes using the geometric factor.

calculate_averaged_magnitude(values)

Calculates the average of magnitudes, useful for processing both

calculate_avg_amplitude(field_values)

Calculates the average amplitude for E-field or H-field values.

calculate_avg_magnitude(mag_values)

Calculates the average magnitude for E or H fields.

calculate_avg_phase(phase_values)

Calculates the average for phase values.

calculate_c_var(sigma, average)

Calculates the Coefficient of Variation (C-var).

calculate_component_avg_rho(e_mag_avg, ...)

Calculates the Component Average RHO.

calculate_conductivity(rho)

Calculates the conductivity (Sigma) from the resistivity.

calculate_e_field_error(e_vals, asp, current)

Calculates the error for the E-field based on field values, A-spacing,

calculate_e_field_std_dev(e_vals, asp, current)

Calculates the standard deviation for the E-field.

calculate_error_propagation_amplitude(e_std, ...)

Propagates error for the amplitude based on the standard deviations

calculate_frequency_dependent_resistivity(...)

Calculates frequency-dependent resistivity (Rho) based on the E-field

calculate_h_field_std_dev(h_vals, current)

Calculates the standard deviation for the H-field.

calculate_ip(phz_e, phz_h)

Calculates the Impedance Phase (IP).

calculate_magnetic_induction(h_mag, rho)

Calculates the Magnetic Induction (M) from the magnetic field

calculate_magnitude_ratio(e_mag, h_mag)

Calculates the magnitude ratio between the E-field and H-field.

calculate_parameter_avg_rho(rho_values)

Calculates the Parameter Average RHO.

calculate_phase_error(phz_e, phz_h)

Calculates the phase error based on the difference between the E-field and H-field phases.

calculate_relative_error(rho, sigma_rho)

Calculates the relative error in resistivity.

calculate_resistivity_phase(rho, phase_e, ...)

Calculates the resistivity phase based on resistivity and phase differences between E-field and H-field.

calculate_rho(mag_e, mag_h, asp, freq)

Calculates the Resistivity (Rho).

calculate_rho_correction(rho, e_std, h_std, ...)

Corrects resistivity values based on the standard deviations of E-field

calculate_snr(signal_values, noise_values)

Calculates the Signal-to-Noise Ratio (SNR) for the given signal and noise values.

calculate_std_dev(values)

Calculates the standard deviation of a list of values.

calculate_std_dev_rho_c(rho_c, e_avg, h_avg, ...)

Calculates the Standard Deviation for Component RHO.

calculate_std_dev_rho_p(rho_values)

Calculates the Standard Deviation for Parameter RHO.

propagate_resistivity_error(rho, e_avg, ...)

Propagates the error in resistivity based on the standard deviations of E-field and H-field.

pycsamt.zonge.ops.calculate_rho(mag_e, mag_h, asp, freq)[source]#

Calculates the Resistivity (Rho).

Args:

mag_e (float): E-field magnitude in µV. mag_h (float): H-field magnitude in pT. asp (float): A-spacing in meters (m). freq (float): Frequency in Hertz (Hz).

Returns:

float: The calculated resistivity (Rho) in Ωm.

pycsamt.zonge.ops.calculate_ip(phz_e, phz_h)[source]#

Calculates the Impedance Phase (IP).

Args:

phz_e (float): E-field phase in mRad. phz_h (float): H-field phase in mRad.

Returns:

float: The Impedance Phase (IP) in mRad.

pycsamt.zonge.ops.calculate_std_dev(values)[source]#

Calculates the standard deviation of a list of values.

Args:

values (list): A list of numerical values.

Returns:

float: The calculated standard deviation.

pycsamt.zonge.ops.calculate_e_field_std_dev(e_vals, asp, current)[source]#

Calculates the standard deviation for the E-field.

Args:

e_vals (list): E-field values in µV. asp (float): A-spacing in meters (m). current (float): Transmitter current in Amperes (a).

Returns:

float: Std deviation of the E-field in mV/Km*a.

pycsamt.zonge.ops.calculate_h_field_std_dev(h_vals, current)[source]#

Calculates the standard deviation for the H-field.

Args:

h_vals (list): H-field values in pT. current (float): Transmitter current in Amperes (a).

Returns:

float: Std deviation of the H-field in pT/a.

pycsamt.zonge.ops.calculate_c_var(sigma, average)[source]#

Calculates the Coefficient of Variation (C-var).

Args:

sigma (float): Standard deviation. average (float): Arithmetic average.

Returns:

float: The Coefficient of Variation in percent.

pycsamt.zonge.ops.calculate_std_dev_rho_p(rho_values)[source]#

Calculates the Standard Deviation for Parameter RHO.

Args:

rho_values (list): A list of RHO values.

Returns:

float: The standard deviation for parameter RHO.

pycsamt.zonge.ops.calculate_std_dev_rho_c(rho_c, e_avg, h_avg, sigma_e, sigma_h)[source]#

Calculates the Standard Deviation for Component RHO.

Args:

rho_c (float): Resistivity from averaged components. e_avg (float): Average E-field magnitude. h_avg (float): Average H-field magnitude. sigma_e (float): Standard deviation of E-field. sigma_h (float): Standard deviation of H-field.

Returns:

float: The standard deviation for component RHO.

pycsamt.zonge.ops.calculate_avg_magnitude(mag_values)[source]#

Calculates the average magnitude for E or H fields.

Args:

mag_values (list): A list of magnitude values.

Returns:

float: The average magnitude.

pycsamt.zonge.ops.calculate_avg_phase(phase_values)[source]#

Calculates the average for phase values.

Args:

phase_values (list): A list of phase values.

Returns:

float: The average phase.

pycsamt.zonge.ops.calculate_parameter_avg_rho(rho_values)[source]#

Calculates the Parameter Average RHO.

Args:

rho_values (list): RHO values from each data block.

Returns:

float: The parameter average RHO.

pycsamt.zonge.ops.calculate_component_avg_rho(e_mag_avg, h_mag_avg, freq)[source]#

Calculates the Component Average RHO.

Args:

e_mag_avg (float): Averaged E_MAG (mV/Km*amp). h_mag_avg (float): Averaged H_MAG (pTesla/amp). freq (float): Frequency in Hz.

Returns:

float: The component average RHO.

pycsamt.zonge.ops.calculate_magnetic_induction(h_mag, rho)[source]#

Calculates the Magnetic Induction (M) from the magnetic field amplitude and resistivity.

Args:

h_mag (float): Magnetic field magnitude in nT. rho (float): Resistivity in Ωm.

Returns:

float: The calculated magnetic induction (M) in nT·m.

\[M =\]

rac{H}{ ho}

ext{Where H is the magnetic field magnitude in nT and }

ho ext{ is the resistivity in Ωm.}

pycsamt.zonge.ops.calculate_apparent_resistivity(e_mag, h_mag, geometric_factor=1.0)[source]#

Calculates the apparent resistivity (Rho Apparent) from the E-field and H-field magnitudes using the geometric factor.

Args:

e_mag (float): Electric field magnitude in V/m. h_mag (float): Magnetic field magnitude in T. geometric_factor (float): Geometric factor, typically 1.0 for

vertical dipole configuration (default is 1.0).

Returns:

float: The calculated apparent resistivity (Rho Apparent) in Ωm.

\[\rho_a = \frac{5 \cdot E}{H} \cdot \text{Geometric Factor} \text{Where E is in V/m and H is in T.}\]
pycsamt.zonge.ops.calculate_snr(signal_values, noise_values)[source]#

Calculates the Signal-to-Noise Ratio (SNR) for the given signal and noise values.

Args:

signal_values (list): A list of signal values. noise_values (list): A list of noise values.

Returns:

float: The signal-to-noise ratio (SNR).

\[\text{SNR} = \frac{\text{Signal Mean}}{\text{Noise Std Dev}} \text{Where Signal Mean is the average signal value, and} \text{Noise Std Dev is the standard deviation of the noise values.}\]
pycsamt.zonge.ops.calculate_phase_error(phz_e, phz_h)[source]#

Calculates the phase error based on the difference between the E-field and H-field phases.

Args:

phz_e (float): E-field phase in degrees or radians. phz_h (float): H-field phase in degrees or radians.

Returns:

float: The calculated phase error in degrees or radians.

\[\begin{split}\text{Phase Error} = \left| \phi_E - \phi_H \right| \text{Where }\phi_E\text{ is the E-field phase and }\\ \phi_H\text{ is the H-field phase.}\end{split}\]
pycsamt.zonge.ops.propagate_resistivity_error(rho, e_avg, h_avg, sigma_e, sigma_h)[source]#

Propagates the error in resistivity based on the standard deviations of E-field and H-field.

Args:

rho (float): The calculated resistivity (Rho). e_avg (float): Average E-field magnitude. h_avg (float): Average H-field magnitude. sigma_e (float): Standard deviation of the E-field. sigma_h (float): Standard deviation of the H-field.

Returns:

float: The propagated error in resistivity.

\[\begin{split}\text{Error in Resistivity} = \rho \cdot \sqrt{ \left( \frac{\sigma_E}{E_{\text{avg}}} \right)^2 + \left( \frac{\sigma_H}{H_{\text{avg}}} \right)^2 } \text{Where }\sigma_E\text{ and }\sigma_H\\\ text{ are the standard deviations of E-field and H-field.}\end{split}\]
pycsamt.zonge.ops.calculate_avg_amplitude(field_values)[source]#

Calculates the average amplitude for E-field or H-field values.

Args:

field_values (list): A list of E-field or H-field values.

Returns:

float: The average amplitude.

\[\text{Avg Amplitude} = \frac{1}{N} \sum_{i=1}^N |x_i| \text{Where } x_i\text{ represents the individual field values.}\]
pycsamt.zonge.ops.calculate_relative_error(rho, sigma_rho)[source]#

Calculates the relative error in resistivity.

Args:

rho (float): The calculated resistivity. sigma_rho (float): The standard deviation of resistivity.

Returns:

float: The relative error in resistivity as a percentage.

\[ext{Relative Error} =\]

rac{sigma_{ ho}}{ ho} imes 100

ext{Where }sigma_{

ho} text{ is the standard deviation of resistivity.}

pycsamt.zonge.ops.calculate_magnitude_ratio(e_mag, h_mag)[source]#

Calculates the magnitude ratio between the E-field and H-field.

Args:

e_mag (float): Electric field magnitude in V/m. h_mag (float): Magnetic field magnitude in T.

Returns:

float: The magnitude ratio (E/H).

\[ext{Magnitude Ratio} =\]
rac{E_{ ext{mag}}}{H_{ ext{mag}}}

ext{Where } E_{ ext{mag}} ext{ is the electric field magnitude and }

H_{ ext{mag}} ext{ is the magnetic field magnitude.}

pycsamt.zonge.ops.calculate_resistivity_phase(rho, phase_e, phase_h)[source]#

Calculates the resistivity phase based on resistivity and phase differences between E-field and H-field.

Args:

rho (float): The resistivity value in Ωm. phase_e (float): E-field phase in radians. phase_h (float): H-field phase in radians.

Returns:

float: The resistivity phase in radians.

\[ext{Resistivity Phase} = ext{atan2}(E_{ ext{phase}} - H_{ ext{phase}}) ext{Where E}_{ ext{phase}} ext{ and H}_\ { ext{phase}} ext{ are the phases of E-field and H-field.}\]
pycsamt.zonge.ops.calculate_frequency_dependent_resistivity(e_mag, h_mag, freq)[source]#

Calculates frequency-dependent resistivity (Rho) based on the E-field and H-field magnitudes.

Args:

e_mag (float): Electric field magnitude in V/m. h_mag (float): Magnetic field magnitude in T. freq (float): Frequency in Hz.

Returns:

float: The calculated frequency-dependent resistivity (Rho) in Ωm.

\[\]

ho_{ ext{freq}} = rac{E_{ ext{mag}}}

{H_{ ext{mag}}} cdot

rac{1}{f}

ext{Where } f ext{ is the frequency in Hz.}

pycsamt.zonge.ops.calculate_rho_correction(rho, e_std, h_std, e_avg, h_avg)[source]#

Corrects resistivity values based on the standard deviations of E-field and H-field, and their average values.

Args:

rho (float): Resistivity in Ωm. e_std (float): Standard deviation of E-field. h_std (float): Standard deviation of H-field. e_avg (float): Average E-field magnitude. h_avg (float): Average H-field magnitude.

Returns:

float: The corrected resistivity value.

\[\]

ho_{ ext{corr}} = ho cdot left

( 1 +

rac{sigma_E}{E_{ ext{avg}}} +

rac{sigma_H}{H_{ ext{avg}}} ight)

ext{Where } sigma_E ext{ and }

sigma_H ext{ are the standard deviations of E-field and H-field.}

pycsamt.zonge.ops.calculate_averaged_magnitude(values)[source]#

Calculates the average of magnitudes, useful for processing both E-field and H-field magnitudes.

Args:

values (list): A list of magnitude values.

Returns:

float: The average magnitude.

\[ext{Avg Magnitude} =\]
rac{1}{N} sum_{i=1}^N |x_i|

ext{Where } x_i ext{ represents individual field values.}

pycsamt.zonge.ops.calculate_conductivity(rho)[source]#

Calculates the conductivity (Sigma) from the resistivity.

Args:

rho (float): Resistivity in Ωm.

Returns:

float: The calculated conductivity (Sigma) in S/m.

\[\sigma =\]

rac{1}{ ho}

ext{Where }

ho ext{ is the resistivity in Ωm.}

pycsamt.zonge.ops.calculate_error_propagation_amplitude(e_std, h_std, rho_std, e_avg, h_avg, rho)[source]#

Propagates error for the amplitude based on the standard deviations of the E-field, H-field, and resistivity.

Args:

e_std (float): Standard deviation of the E-field. h_std (float): Standard deviation of the H-field. rho_std (float): Standard deviation of resistivity. e_avg (float): Average value of the E-field. h_avg (float): Average value of the H-field. rho (float): Resistivity value.

Returns:

float: The propagated error for amplitude.

\[ext{Error in Amplitude} = \sqrt{ \left(\]
rac{sigma_E}

{E_{ ext{avg}}}

ight)^2
  • left(

rac{sigma_H}{H_{ ext{avg}}}

ight)^2 + left( rac{sigma_{ ho}}{ ho} ight)^2 }

ext{Where }sigma_E ext{, }sigma_H ext{, and }

sigma_{

ho} ext{ are the standard deviations

for E-field, H-field, and resistivity.}

pycsamt.zonge.ops.calculate_e_field_error(e_vals, asp, current)[source]#

Calculates the error for the E-field based on field values, A-spacing, and current.

Args:

e_vals (list): E-field values in µV. asp (float): A-spacing in meters (m). current (float): Transmitter current in Amperes (a).

Returns:

float: The calculated error for the E-field.

\[ext{E-field Error} =\]
rac{1}{N} sum_{i=1}^N

left| E_{ ext{val}} -

rac{E_{ ext{avg}}}{ ext{current}} ight|

ext{Where } E_{ ext{val}} ext{ are the individual E-field values and }

E_{ ext{avg}} ext{ is the average E-field.}