pycsamt.zonge.info#
DataInfo - High-level AVG data aggregator.
This module provides the DataInfo class, which serves as a primary facade for interacting with a complete Zonge AVG dataset. It composes all other components (Header, Z, Resistivity, Phase, and various QC metrics) into a single, convenient container.
Classes
|
High-level aggregator for a complete Zonge AVG dataset. |
- class pycsamt.zonge.info.DataInfo(verbose=False)[source]#
Bases:
ZongeHigh-level aggregator for a complete Zonge AVG dataset.
This class acts as the primary container and orchestrator for all data and metadata parsed from a Zonge AVG file. It composes all other data components (e.g., Header, Z, Resistivity, Phase, and QC metrics) into a single, convenient object.
Its main role is to provide a unified interface, holding all the structured information in one place after the initial parsing is complete.
- Variables:
df (pandas.DataFrame or None) – The core tidy DataFrame containing all available data columns after parsing and standardization.
meta (mapping or None) – The raw metadata dictionary extracted from the file’s header section.
header (
Header) – A component that aggregates all header-level metadata.station (
Station) – A component that manages survey line geometry.z (
Z) – The component for computing the complex impedance tensor.phase (resistivity,) – Components for apparent resistivity and phase data.
comp (frequency, amps,) – Components for core measurement quantities.
pc_rho (pc_emag, pc_hmag,) – Components for percent-error quality control metrics.
s_phz (s_ephz, s_hphz,) – Components for phase standard deviation QC metrics.
- Parameters:
verbose (bool)
- from_avg(avg, meta=None)[source]#
A classmethod factory to build a DataInfo object from various sources, including a file path or DataFrame.
- read(source, meta=None)[source]#
Orchestrates the population of all sub-components from a standardized DataFrame and metadata dictionary.
Notes
The read method is the core of this class. It iterates through all its component attributes and calls their respective read methods. It includes a robust error- handling mechanism that will issue a warning and skip any component that fails to load (e.g., due to missing data in the source file), making the loading process resilient.
Examples
While typically used internally by the AVG class, you could use DataInfo directly:
>>> from pycsamt.zonge.info import DataInfo >>> from pycsamt.zonge.utils import load_avg >>> df, meta = load_avg('data/avg/K2.avg') >>> data_info = DataInfo() >>> data_info.read(df, meta) >>> print(data_info.station) Station(n=28, span=25.0–1375.0 m, inc=50.0)
See also
pycsamt.zonge.avg.AVGThe main user-facing class that uses DataInfo.
pycsamt.zonge.base.AVGComponentBaseThe base class for all components held by DataInfo.