pycsamt.api.station#

Global station-rendering controls for pyCSAMT figures.

Functions

configure_station_rendering(**kw)

Configure PYCSAMT_STATION_RENDERING.

reset_station_rendering()

Reset PYCSAMT_STATION_RENDERING to package defaults.

Classes

PyCSAMTStationRendering()

Package-wide station rendering control container.

StationAxisStyle([side, xlabel, every, ...])

Station-axis tick, label, and marker configuration.

StationMarkerStyle([marker, size, ...])

Marker style used to draw stations along a profile axis.

class pycsamt.api.station.PyCSAMTStationRendering[source]#

Bases: object

Package-wide station rendering control container.

style_for(preset='pseudosection')[source]#

Return the station-axis style associated with preset.

Parameters:

preset (str)

Return type:

StationAxisStyle

apply(ax, positions, labels=None, *, preset='pseudosection', xlim=None)[source]#

Apply one named station-rendering preset to ax.

Parameters:
Return type:

ndarray

configure(**kw)[source]#

Configure station rendering using section__attribute paths.

Parameters:

kw (Any)

Return type:

None

context(preset=None, **kw)[source]#

Temporarily override station rendering, then restore it.

Parameters:
  • preset (str | None)

  • kw (Any)

Return type:

Generator[PyCSAMTStationRendering, None, None]

use_preset(preset)[source]#

Copy one preset into the pseudosection slot.

Parameters:

preset (str)

Return type:

None

reset()[source]#

Reset station rendering to package defaults.

Return type:

None

summary()[source]#

Return a human-readable summary.

Return type:

str

class pycsamt.api.station.StationAxisStyle(side='top', xlabel='Station', every='auto', max_labels=14, rotation=90.0, fontsize=7, tick_length=3.0, label_tick_length=5.0, label_pad=8.0, xlabel_pad=6.0, show_all_ticks=True, show_labels=True, show_markers=True, marker=<factory>)[source]#

Bases: object

Station-axis tick, label, and marker configuration.

Parameters:
side: str = 'top'#
xlabel: str = 'Station'#
every: int | str = 'auto'#
max_labels: int = 14#
rotation: float = 90.0#
fontsize: int = 7#
tick_length: float = 3.0#
label_tick_length: float = 5.0#
label_pad: float = 8.0#
xlabel_pad: float = 6.0#
show_all_ticks: bool = True#
show_labels: bool = True#
show_markers: bool = True#
marker: StationMarkerStyle#
compute_every(n, figwidth_in=10.0, max_label_len=4)[source]#

Return the interval between visible station labels.

Parameters:
Return type:

int

label_indices(labels, figwidth_in=10.0)[source]#

Return indices whose station labels should be visible.

Parameters:
Return type:

ndarray

apply(ax, positions, labels=None, *, xlim=None, topo_elev=None)[source]#

Apply station ticks, labels, and markers to ax.

Parameters:
  • ax (Axes)

  • positions ((n,) station x positions)

  • labels ((n,) station name strings, optional)

  • xlim ((xmin, xmax) x-axis limits, optional)

  • topo_elev ((n,) terrain elevation in data y-units, optional) – When provided the markers are placed at the terrain surface (+ a small pad toward the viewer) instead of at the flat axis edge. Labels are drawn inline above the markers; xticklabels at the axis edge are suppressed.

Returns:

Indices of stations whose labels are visible.

Return type:

numpy.ndarray

class pycsamt.api.station.StationMarkerStyle(marker='v', size=34.0, facecolor='white', edgecolor='black', linewidth=0.9, alpha=1.0, offset=1.025, zorder=5)[source]#

Bases: object

Marker style used to draw stations along a profile axis.

Parameters:
marker: str = 'v'#
size: float = 34.0#
facecolor: str = 'white'#
edgecolor: str = 'black'#
linewidth: float = 0.9#
alpha: float = 1.0#
offset: float = 1.025#
zorder: int = 5#
kwargs(**overrides)[source]#

Return Matplotlib scatter keyword arguments.

Parameters:

overrides (Any)

Return type:

dict[str, Any]

pycsamt.api.station.configure_station_rendering(**kw)[source]#

Configure PYCSAMT_STATION_RENDERING.

Parameters:

kw (Any)

Return type:

None

pycsamt.api.station.reset_station_rendering()[source]#

Reset PYCSAMT_STATION_RENDERING to package defaults.

Return type:

None