pycsamt.tdem.avg#

Readers for Zonge TEMAVG processed .AVG files.

Functions

is_temavg_file(path)

Return True when path looks like a TEMAVG file.

Classes

TEMAVG(path[, metadata, records, version, ...])

Processed content of one Zonge TEMAVG .AVG file.

TEMAVGRecord(skip, tx, station, frequency, ...)

One processed TEMAVG gate value.

class pycsamt.tdem.avg.TEMAVG(path, metadata=<factory>, records=<factory>, version=None, dated=None, processed=None, verbose=0, logger=None)[source]#

Bases: PyCSAMTObject

Processed content of one Zonge TEMAVG .AVG file.

TEMAVG reads the human-readable output produced by the Zonge TEMAVG processing program. The object stores global metadata such as transmitter ramp, loop dimensions, and receiver area together with one row per station/time gate. It is a processed time-domain EM container, not an EDI or frequency-domain impedance object.

Parameters:
  • path (pathlib.Path) – Source file path.

  • metadata (dict) – Parsed header metadata. Keys include entries such as "TXramp", "TXdx", "TXdy", "TXarea", and "RXarea" when present.

  • records (list of TEMAVGRecord) – Parsed processed data rows.

  • version (str, optional) – TEMAVG program version parsed from the first line.

  • dated (str, optional) – Field data date parsed from the first line.

  • processed (str, optional) – Processing date parsed from the first line.

  • verbose (int)

  • logger (object | None)

Examples

>>> from pycsamt.tdem.avg import TEMAVG
>>> avg = TEMAVG.read("data/TEMAVG/JIANGSU/TEM100.AVG")
>>> avg.n_records > 0
True
>>> avg.stations[:3]
[100.0, 120.0, 140.0]
path: Path#
metadata: dict[str, Any]#
records: list[TEMAVGRecord]#
version: str | None = None#
dated: str | None = None#
processed: str | None = None#
verbose: int = 0#
logger: object | None = None#
classmethod read(path, *, verbose=0, logger=None)[source]#

Read a Zonge TEMAVG .AVG file.

Parameters:
  • path (path-like) – Processed TEMAVG file. The reader expects the standard Zonge header followed by the table whose columns include station, frequency, component, current, window, time, magnitude, apparent resistivity, depth, and percent magnitude.

  • verbose (int)

  • logger (object | None)

Returns:

Parsed TEMAVG file.

Return type:

TEMAVG

property n_records: int[source]#

Number of processed gate rows.

property stations: list[float][source]#

Sorted station values represented in the file.

property windows: list[int][source]#

Sorted time-window numbers represented in the file.

property tx_area: float | None[source]#

Transmitter loop area in square metres when present.

property rx_area: float | None[source]#

Receiver loop or coil area in square metres when present.

property tx_dx: float | None[source]#

Transmitter loop x dimension in metres when present.

property tx_dy: float | None[source]#

Transmitter loop y dimension in metres when present.

rows_for_station(station)[source]#

Return all gate rows for one station value.

Parameters:

station (float)

Return type:

list[TEMAVGRecord]

to_soundings(*, stations=None, component='Hz', frequency=None, data_column='magnitude', magnitude_unit='uV/A', data_type='voltage', rx_turns=1, tx_turns=1, coordinate_table=None, profile=None, station_name_template='{stem}_{station:g}', min_gates=1, verbose=0, logger=None)[source]#

Build one TEMSounding per station.

Parameters:
  • stations (list of float, optional) – Station values to export. When omitted, every station in the file is converted.

  • component (str, default "Hz") – Component label to select from the TEMAVG rows.

  • frequency (float, optional) – Repetition frequency to select. When omitted, all rows matching component are used.

  • data_column ({"magnitude"}, default "magnitude") – TEMAVG data column used for the sounding decay. The processed magnitude column is currently the only supported transient column.

  • magnitude_unit (str, default "uV/A") – Unit of the TEMAVG magnitude column. "uV/A" means microvolts per ampere. "V/A", "uV", "V", and "SI" are also accepted.

  • data_type (str, default "voltage") – Output TEMSounding data type. "voltage" keeps the decay as receiver voltage. "dBdt" divides by receiver turns and area. "dHdt" additionally divides by \(\mu_0\).

  • rx_turns (int, default 1) – Receiver and transmitter turn counts passed to the resulting soundings.

  • tx_turns (int, default 1) – Receiver and transmitter turn counts passed to the resulting soundings.

  • coordinate_table (object, optional) – Coordinate table exposing get(profile, point). Matching coordinates are copied to the sounding x, y, and elevation fields.

  • profile (float, optional) – Profile id used with coordinate_table. If omitted and no coordinate table is supplied, coordinates stay at their default values.

  • station_name_template (str, default "{stem}_{station:g}") – Format string used to create each station name. Available fields are stem, station, profile, and component.

  • min_gates (int, default 1) – Minimum number of selected time gates required to create a sounding.

  • verbose (int)

  • logger (object | None)

Returns:

Station-wise soundings ready for late-time or Fourier conversion.

Return type:

list of TEMSounding

to_records()[source]#

Return records as dictionaries with file metadata.

Return type:

list[dict[str, Any]]

to_dataframe()[source]#

Return the parsed table as a pandas.DataFrame.

class pycsamt.tdem.avg.TEMAVGRecord(skip, tx, station, frequency, component, current, window, time, magnitude, ramp_app_res, depth, percent_magnitude)[source]#

Bases: object

One processed TEMAVG gate value.

Parameters:
  • skip (int) – TEMAVG skip or block flag stored in the first column.

  • tx (float) – Transmitter identifier from the Tx column.

  • station (float) – Station coordinate or station number along the survey profile.

  • frequency (float) – Repetition frequency in hertz.

  • component (str) – Measured component label, for example "Hz".

  • current (float) – Transmitter current in amperes from the Amps column.

  • window (int) – Time-window number.

  • time (float) – Gate centre time in milliseconds, as written by TEMAVG.

  • magnitude (float) – Processed transient magnitude. For TEMAVG contour files this is commonly reported in microvolts per ampere.

  • ramp_app_res (float) – Ramp-corrected apparent resistivity in ohm metres.

  • depth (float) – TEMAVG depth estimate in metres.

  • percent_magnitude (float) – Percent magnitude or percent error column.

skip: int#
tx: float#
station: float#
frequency: float#
component: str#
current: float#
window: int#
time: float#
magnitude: float#
ramp_app_res: float#
depth: float#
percent_magnitude: float#
property time_s: float[source]#

Gate centre time in seconds.

pycsamt.tdem.avg.is_temavg_file(path)[source]#

Return True when path looks like a TEMAVG file.

Parameters:

path (str | Path)

Return type:

bool