2.14.2.5. pycsamt.emtools.resphase_psection#

MTPy-style apparent-resistivity and phase pseudo-sections.

PlotResPhasePseudoSection draws the classic magnetotelluric pseudo-section: apparent resistivity above phase, one column per impedance component, and one stacked [resistivity, phase] row-pair per site group. By default every group shares one period (vertical) axis, one resistivity colour scale, and one phase colour scale; the station axis (names + inverted-triangle markers) is drawn on top, from pycsamt.api.PYCSAMT_STATION_RENDERING.

Functions

plot_res_phase_pseudosection(sites, *[, axes])

Functional wrapper around PlotResPhasePseudoSection.

Classes

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

Apparent-resistivity / phase pseudo-section, MTPy style.

class pycsamt.emtools.resphase_psection.PlotResPhasePseudoSection(sites, *, components=None, res_phase_ratio=2.0, phase_range='0-90', res_range=None, log_res=True, log_period=True, res_cmap=None, phase_cmap=None, share_scales=True, res_scale_from='offdiag', period_range=None, station_order=None, n_grid=60, share_period=True, station_label_step=None, station_side='top', station_markers=True, panel_labels=False, grid=False, show_colorbar=True, figsize=None, title=None, axes=None, **kwargs)[source]

Bases: CoreObject

Apparent-resistivity / phase pseudo-section, MTPy style.

Each column is one impedance component; within a column the apparent-resistivity panel sits above the phase panel. Passing several site groups stacks them as extra [resistivity, phase] row-pairs down the figure. Every panel shares the period axis; by default every resistivity panel shares one colour scale and every phase panel shares another, so the columns and groups are directly comparable.

Parameters:
  • sites (Sites-like, or mapping of str to Sites-like) – One survey (any input ensure_sites() accepts – a directory, an EDI list, a Sites), or a mapping {group_label: survey} to stack several groups vertically.

  • components (sequence of {"xy", "yx", "xx", "yy"}, optional) – Which components to draw, in the order given. None (default) auto-detects: every component that carries finite data in at least one group is plotted, in canonical xy, yx, xx, yy order.

  • res_phase_ratio (float, default 2.0) – Height of a resistivity panel relative to its phase panel, fed straight into the [res, phase] height_ratios. The default gives resistivity two-thirds of the row-pair and phase the remaining third; pass 1.0 for equal panels, or a fraction below 1.0 to make phase the taller of the two.

  • station_side ({"top", "bottom", "none"}, default "top") – Where the station axis (ticks, names, and inverted-triangle markers) is drawn. "top" matches the pyCSAMT section convention (PYCSAMT_STATION_RENDERING) and gives every stacked line its own station axis above its resistivity panel; "bottom" places it under each phase panel; "none" omits it.

  • station_markers (bool, default True) – Draw the triangle station markers from PYCSAMT_STATION_RENDERING. False keeps only the tick names.

  • panel_labels (bool or sequence of str, default False) – Add a per-group corner tag. True uses (a), (b), …; a sequence supplies the tags verbatim.

  • grid (bool, default False) – Draw faint horizontal period grid lines on every panel.

  • show_colorbar (bool, default True) – Draw the two shared colourbars (resistivity, phase) on the right.

  • phase_range (str or tuple of float, default "0-90") – Phase colour limits in degrees: one of the presets "0-90", "-45-45", "-90-90", "-180-180", the string "auto" (2nd/98th percentiles), or an explicit (vmin, vmax) tuple. The yx and yy phases are always rotated by 180 degrees first, so a 1-D response plots near 45 degrees in every component (the MTPy convention).

  • res_range (tuple of float, optional) – Resistivity colour limits in \(\Omega\cdot\mathrm{m}\). None uses the 5th/95th percentiles.

  • log_res (bool, default True) – Map \(\log_{10}\rho_a\) rather than \(\rho_a\) to colour.

  • log_period (bool, default True) – Label the vertical axis with \(\log_{10}T\) on a linear axis – the convention plot_phase_tensor_psection() and the rest of this module’s pseudo-section family already default to. False keeps \(T\) in seconds on a logarithmic axis instead.

  • res_cmap (str or Colormap, optional) – Colormaps. None uses the pyCSAMT defaults ("jet_r" for resistivity, "plasma" for phase).

  • phase_cmap (str or Colormap, optional) – Colormaps. None uses the pyCSAMT defaults ("jet_r" for resistivity, "plasma" for phase).

  • share_scales (bool, default True) – Share one resistivity colour scale and one phase colour scale across every panel. When False each panel is scaled on its own data.

  • res_scale_from ({"offdiag", "all"}, default "offdiag") – When share_scales is on, whether the shared resistivity limits are taken from the off-diagonal components only (xy/yx – the physically meaningful ones) or from every drawn component. Ignored when only diagonal components are present.

  • period_range (tuple of float, optional) – (T_min, T_max) in seconds; samples outside are dropped.

  • station_order (sequence of str, optional) – Explicit left-to-right station order. None keeps the order the sites are read in.

  • n_grid (int, default 60) – Number of log-spaced period rows per group.

  • share_period (bool, default True) – Resample every group onto one common period grid and share the vertical axis. Set False when stacking lines from different instruments (e.g. an AMT line above an LMT line) so each keeps its own period window instead of a mostly-empty shared axis.

  • station_label_step (int, optional) – Show every n-th station label. None picks a step that keeps at most ~12 labels.

  • figsize (tuple of float, optional)

  • title (str, optional) – Figure suptitle.

  • axes (sequence of matplotlib.axes.Axes, optional) – A flat, row-major grid of 2 * n_groups * n_components axes to draw into (resistivity then phase for each column, top group first). When given, the figure and its two shared colourbars are the caller’s responsibility. None (default) builds a fresh figure.

  • kwargs (Any)

Examples

All present components of one survey:

>>> from pycsamt.emtools import PlotResPhasePseudoSection
>>> fig = PlotResPhasePseudoSection(
...     "data/MT/broken-hill/edis"
... ).plot()

Two lines stacked, resistivity twice the height of phase, station markers above each line, lettered panels:

>>> fig = PlotResPhasePseudoSection(
...     {"Line A": sites_a, "Line B": sites_b},
...     components=["xy", "yx"],
...     res_phase_ratio=2.0,
...     station_side="top",
...     panel_labels=True,
... ).plot()
plot()[source]

Render the pseudo-section.

Return type:

matplotlib.figure.Figure

Raises:

ValueError – If the input carries no resistivity/phase data, if no component is usable, or if phase_range is not recognised.

pycsamt.emtools.resphase_psection.plot_res_phase_pseudosection(sites, *, axes=None, **kwargs)[source]

Functional wrapper around PlotResPhasePseudoSection.

Equivalent to PlotResPhasePseudoSection(sites, axes=axes, **kwargs).plot().

Parameters: