2.14.2.4. pycsamt.emtools.inspect#

Functions

frequency_coverage(sites, *[, mode, ...])

list_missing_sections(sites, *[, require, ...])

plot_coverage(sites, *[, axis, show_mask, ...])

plot_rhoa_phi(sites, *[, components, axis, ...])

plot_station_response(sites, *[, station, ...])

Full four-component impedance tensor + tipper response for one station.

plot_survey_inventory_overview(sites, *[, ...])

Plot station inventory counts and the observed period coverage map.

plot_tipper_components(sites, *[, kind, ...])

pseudosection(sites, *[, quantity, axis_x, ...])

Draw a period-vs-station pseudosection.

sites_summary(sites, *[, fields, recursive, ...])

pycsamt.emtools.inspect.sites_summary(sites, *, fields=('station', 'n_freq', 'has_tipper', 'period_min', 'period_max', 'lat', 'lon'), recursive=True, on_dup='replace', strict=False, verbose=0, api=None)[source]
Parameters:
Return type:

Any

pycsamt.emtools.inspect.list_missing_sections(sites, *, require=('mt', 'tipper'), recursive=True, on_dup='replace', strict=False, verbose=0)[source]
Parameters:
Return type:

dict[str, list[str]]

pycsamt.emtools.inspect.frequency_coverage(sites, *, mode='per-site', recursive=True, on_dup='replace', strict=False, verbose=0)[source]
Parameters:
Return type:

Any

pycsamt.emtools.inspect.plot_survey_inventory_overview(sites, *, station_order=None, station_labels=None, count_kws=None, coverage_cmap='YlGnBu', station_grid=True, station_grid_kws=None, axes=None, figsize=None, title='Survey inventory overview', recursive=True, on_dup='replace', strict=False, verbose=0)[source]

Plot station inventory counts and the observed period coverage map.

The upper panel reports the number of usable frequency rows at each station. The lower panel shows where those rows occur on a common log-period axis, so equal row counts cannot conceal different bands or internal gaps. Both panels use the same station centres.

Parameters:
  • sites (any) – Any input accepted by ensure_sites().

  • station_order (list of str or None) – Explicit station order. Missing names are retained as empty columns.

  • station_labels (list of str or None) – Display labels corresponding to station_order. By default the resolved station names are used.

  • count_kws (dict or None) – Matplotlib line/marker overrides for the upper inventory profile. Useful keys include color, marker, markersize, linewidth, markerfacecolor, and markeredgecolor.

  • coverage_cmap (str, default="YlGnBu") – Colormap for absent/present samples in the lower map.

  • station_grid (bool, default=True) – Draw aligned vertical station guides in both panels.

  • station_grid_kws (dict or None) – Keyword arguments forwarded to Axes.axvline.

  • axes ((Axes, Axes) or None) – Existing (ax_count, ax_map) pair to draw into. When None (default), a new two-panel figure is created.

  • figsize (tuple[float, float] | None)

  • title (str)

  • recursive (bool)

  • on_dup (str)

  • strict (bool)

  • verbose (int)

Returns:

Figure containing the aligned inventory and coverage axes.

Return type:

matplotlib.figure.Figure

pycsamt.emtools.inspect.plot_coverage(sites, *, axis='period', show_mask=True, figsize=(7.0, 4.0), recursive=True, on_dup='replace', strict=False, verbose=0, ax=None)[source]
Parameters:
Return type:

Axes

pycsamt.emtools.inspect.plot_rhoa_phi(sites, *, components=('xy', 'yx'), axis='period', errorbar=True, figsize=(7.5, 6.0), recursive=True, on_dup='replace', strict=False, verbose=0, ax_r=None, ax_p=None)[source]
Parameters:
Return type:

tuple[Axes, Axes]

pycsamt.emtools.inspect.plot_tipper_components(sites, *, kind=('real', 'imag'), axis='period', figsize=(7.5, 4.5), recursive=True, on_dup='replace', strict=False, verbose=0, ax=None)[source]
Parameters:
Return type:

Axes

pycsamt.emtools.inspect.pseudosection(sites, *, quantity='rho_xy', axis_x='station', axis_y='period', period_range=None, vmin=None, vmax=None, figsize=(7.5, 4.5), recursive=True, on_dup='replace', strict=False, verbose=0, ax=None, topo=None, dark=True)[source]

Draw a period-vs-station pseudosection.

Parameters:
  • sites (Sites or compatible) – Station data.

  • quantity (str) – Column name to plot (e.g. "rho_xy", "phi_xy").

  • topo (bool or None) – Override the global PYCSAMT_TOPO setting. None (default) reads the global singleton.

  • dark (bool) – Use dark-palette styling for the topo strip.

  • axis_x (str)

  • axis_y (str)

  • period_range (tuple[float, float] | None)

  • vmin (float | None)

  • vmax (float | None)

  • figsize (tuple[float, float])

  • recursive (bool)

  • on_dup (str)

  • strict (bool)

  • verbose (int)

  • ax (Axes | None)

Return type:

Axes

pycsamt.emtools.inspect.plot_station_response(sites, *, station=None, sites_model=None, components=('xx', 'xy', 'yx', 'yy'), period_range=None, rho_lim=None, phase_lim=None, tipper_lim=(-0.5, 0.5), show_tipper=True, show_error_bars=True, show_rms=True, title='', axes=None, figsize=None, recursive=True, on_dup='replace', strict=False, verbose=0)[source]

Full four-component impedance tensor + tipper response for one station.

Renders a 3-row × N-column figure (N = len(components)) following the MTComponentStyle colour scheme:

  • Row 0 — apparent resistivity ρa (Ω·m) vs period, log–log.

  • Row 1 — phase φ (°) vs period, semilog-x.

  • Row 2 — tipper magnitude: Re(Tx), Im(Tx), Re(Ty), Im(Ty) vs period, semilog-x. Hidden when show_tipper is False or when no tipper data are found.

Each column corresponds to one impedance tensor component (Zxx, Zxy, Zyx, Zyy). The tipper row always uses four fixed sub-panels regardless of which Z components are selected.

An optional sites_model argument overlays a second (model/forward) dataset on the same axes as dotted lines. When both observed and model data are present, a per-component RMS is computed in log10(ρa) space and appended to each column header.

Parameters:
  • sites (any) – Observed EDI data — path, SitesCollection, or anything accepted by ensure_sites().

  • station (str or None) – Name of the station to plot. None picks the first available.

  • sites_model (any or None) – Optional forward-model or inversion-response EDI data (same API as sites). When provided, overlay dashed lines and show RMS.

  • components (tuple of {"xx","xy","yx","yy"}, default all four) – Z-tensor components to display. Order determines column order.

  • period_range ((T_min, T_max) or None) – Clip period axis to this window (seconds).

  • rho_lim ((vmin, vmax) or None) – ρa y-axis limits. None → matplotlib auto.

  • phase_lim ((lo, hi) or None) – Phase y-axis limits in degrees. None → auto.

  • tipper_lim ((lo, hi), default (-0.5, 0.5)) – Tipper y-axis limits.

  • show_tipper (bool, default True) – Whether to add the tipper row.

  • show_error_bars (bool, default True) – Draw error bars on observed data.

  • show_rms (bool, default True) – Append per-component RMS to column titles when sites_model is set.

  • title (str) – Override the auto-derived figure title.

  • figsize ((float, float) or None) – Figure size. Auto-computed when None.

  • recursive (bool) – Passed to ensure_sites().

  • on_dup (str) – Passed to ensure_sites().

  • strict (bool) – Passed to ensure_sites().

  • verbose (int) – Passed to ensure_sites().

Return type:

matplotlib.figure.Figure

Examples

Observed data only:

>>> from pycsamt.emtools import plot_station_response
>>> fig = plot_station_response("path/to/edis/", station="S07")

With model overlay:

>>> fig = plot_station_response(
...     obs_edis,
...     station="HBH03_IMP",
...     sites_model=model_edis,
...     period_range=(1e-4, 1.0),
... )