pycsamt.tdem.zplot#

Readers for Zonge TEMAVG contour .Z files.

Functions

is_tem_z_file(path)

Return True when path looks like a TEMAVG .Z file.

Classes

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

Parsed content of one TEMAVG contour .Z file.

TEMZRecord(line, station, time, magnitude, ...)

One row from a TEMAVG contour .Z file.

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

Bases: PyCSAMTObject

Parsed content of one TEMAVG contour .Z file.

.Z files are plotting-oriented TEMAVG outputs. They store station, time gate, magnitude, frequency, and window values in a compact fixed-width text layout. They are useful for quick pseudo-section plotting and for checking that the processed .AVG magnitude column was exported correctly.

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

  • metadata (dict) – Parsed header metadata such as date, plot data type, window name, units, component, receiver area, contour mode, and profile mode when present.

  • records (list of TEMZRecord) – Parsed plot rows.

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

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

  • verbose (int)

  • logger (object | None)

Examples

>>> from pycsamt.tdem.zplot import TEMZPlot
>>> z = TEMZPlot.read("data/TEMAVG/JIANGSU/TEM100.Z")
>>> z.n_records > 0
True
>>> z.records[0].window
1
path: Path#
metadata: dict[str, Any]#
records: list[TEMZRecord]#
version: str | None = None#
processed: str | None = None#
verbose: int = 0#
logger: object | None = None#
classmethod read(path, *, verbose=0, logger=None)[source]#

Read a TEMAVG contour .Z file.

Parameters:
  • path (path-like) – TEMAVG contour file produced by the ZPLOT stage.

  • verbose (int)

  • logger (object | None)

Returns:

Parsed contour records and header metadata.

Return type:

TEMZPlot

property n_records: int[source]#

Number of contour data 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.

rows_for_station(station)[source]#

Return all contour rows for one station value.

Parameters:

station (float)

Return type:

list[TEMZRecord]

to_records()[source]#

Return contour records as dictionaries.

Return type:

list[dict[str, Any]]

to_dataframe()[source]#

Return the parsed contour table as a DataFrame.

class pycsamt.tdem.zplot.TEMZRecord(line, station, time, magnitude, frequency, window)[source]#

Bases: object

One row from a TEMAVG contour .Z file.

Parameters:
  • line (int) – Line or profile identifier stored in the first column.

  • station (float) – Station coordinate or station number.

  • time (float) – Gate centre time in milliseconds.

  • magnitude (float) – Contoured transient magnitude, commonly in microvolts per ampere for TEMAVG output.

  • frequency (float) – Repetition frequency in hertz.

  • window (int) – Time-window number.

line: int#
station: float#
time: float#
magnitude: float#
frequency: float#
window: int#
property time_s: float[source]#

Gate centre time in seconds.

pycsamt.tdem.zplot.is_tem_z_file(path)[source]#

Return True when path looks like a TEMAVG .Z file.

Parameters:

path (str | Path)

Return type:

bool