pycsamt.api.interp#
Global visual controls for pycsamt.interp hydrogeophysical plots.
Centralises every colour, line-style, figure-geometry, and colourbar choice used by the five hydro-geophysical plot classes:
This module follows the same singleton + preset + context-manager pattern
used by pycsamt.api.section, pycsamt.api.style, and
pycsamt.api.station.
Quick start#
Apply a named preset globally:
from pycsamt.api import use_interp
use_interp("publication") # all subsequent interp plots use it
use_interp("accessible") # colorblind-safe palette
Temporarily override for one block:
from pycsamt.api.interp import PYCSAMT_INTERP
with PYCSAMT_INTERP.context("dark"):
PlotHydroSection(result).plot()
PlotTimeLapseSection(tl).plot()
# reverts automatically
Fine-tune one field:
from pycsamt.api import configure_interp
configure_interp(
section__cmap_K="plasma",
section__wt_color="white",
profile__color_wt="royalblue",
)
Pass a style directly to one plot (overrides global state):
from pycsamt.api.interp import PYCSAMT_INTERP
fig = PlotHydroSection(result,
style=PYCSAMT_INTERP.publication).plot()
Functions
|
Configure |
Reset |
|
|
Return the effective figure size. |
|
Resolve a style argument to a |
|
Resolve a style argument to a |
|
Activate a named preset in |
Classes
|
Visual parameters for 1-D hydrogeophysical profile plots. |
|
Visual parameters for 2-D hydrogeophysical colour sections. |
|
Complete visual bundle for one hydrogeophysical interpretation preset. |
Package-wide visual control container for hydro-geophysical plots. |
- class pycsamt.api.interp.HydroSectionStyle(cmap_K='viridis', cmap_Sw='RdYlBu', cmap_phi='YlOrRd', cmap_timelapse='RdBu_r', cmap_spread='hot_r', cmap_p50='viridis', wt_color='deepskyblue', wt_lw=2.5, wt_ls='--', station_color='k', station_alpha=0.45, station_lw=0.4, cb_fraction=0.025, cb_pad=0.01, cb_fontsize=8, nan_color='0.88', cmap_crossplot='viridis', scatter_alpha=0.6, scatter_size=12.0, hs_alpha=0.12, model_curve_color='k', model_curve_ls='--', model_curve_lw=1.6, rho_curve_color='0.15', rho_fill_color='steelblue', rho_fill_alpha=0.12, zone_boundary_color='0.55', zone_boundary_ls='--', zone_label_fontsize=7)[source]#
Bases:
objectVisual parameters for 2-D hydrogeophysical colour sections.
Governs
PlotHydroSection,PlotTimeLapseSection, and both panels ofPlotUncertaintySection.- Parameters:
cmap_K (str) – Colourmap for the hydraulic-conductivity K section (default
'viridis').cmap_Sw (str) – Colourmap for the water-saturation Sw section (
'RdYlBu').cmap_phi (str) – Colourmap for the porosity φ section (
'YlOrRd').cmap_timelapse (str) – Diverging colourmap for Δlog₁₀ρ and ΔSw time-lapse sections (
'RdBu_r').cmap_spread (str) – Colourmap for uncertainty spread (CV or P90–P10) panels (
'hot_r'— dark = high uncertainty).cmap_p50 (str) – Colourmap for the P50 estimate panel of
PlotUncertaintySection.wt_color (str / float / str) – Water-table overlay: colour, line width, line style.
wt_lw (str / float / str) – Water-table overlay: colour, line width, line style.
wt_ls (str / float / str) – Water-table overlay: colour, line width, line style.
station_color (str / float / float) – Station-tick axvline appearance.
station_alpha (str / float / float) – Station-tick axvline appearance.
station_lw (str / float / float) – Station-tick axvline appearance.
cb_fraction (float / float / int) – Colourbar geometry and tick label size.
cb_pad (float / float / int) – Colourbar geometry and tick label size.
cb_fontsize (float / float / int) – Colourbar geometry and tick label size.
nan_color (str)
cmap_crossplot (str)
scatter_alpha (float)
scatter_size (float)
hs_alpha (float)
model_curve_color (str)
model_curve_ls (str)
model_curve_lw (float)
rho_curve_color (str)
rho_fill_color (str)
rho_fill_alpha (float)
zone_boundary_color (str)
zone_boundary_ls (str)
zone_label_fontsize (int)
- crossplot_scatter_kwargs(**overrides)[source]#
Kwargs for the
ax.scattercall in a petrophysical cross-plot.
- class pycsamt.api.interp.HydroProfileStyle(color_wt='steelblue', color_T='seagreen', envelope_alpha=0.25, p50_lw=2.0, scatter_size=14.0, ref_color='tomato', ref_ls='--', ref_lw=1.4, grid_alpha=0.3, grid_axis='y', station_color='0.6', station_alpha=0.5, station_lw=0.35, color_TR='darkorange', color_S='mediumpurple', tr_threshold=1000.0, s_threshold_moderate=1.0, s_threshold_good=5.0, hist_alpha=0.7, hist_edgecolor='white', hist_bins=30, kde_color='k', kde_lw=1.8)[source]#
Bases:
objectVisual parameters for 1-D hydrogeophysical profile plots.
Governs
PlotWaterTableProfileandPlotUncertaintyProfile.- Parameters:
color_wt (str) – Colour for water-table bars/lines/envelopes (
'steelblue').color_T (str) – Colour for transmissivity bars/lines/envelopes (
'seagreen').envelope_alpha (float) – Fill-between transparency for P10–P90 bands (0–1).
p50_lw (float) – Line width for the P50 central estimate.
scatter_size (float) – Marker size for station-value scatter dots.
ref_color (str / str / float) – Reference-depth line style (axhline).
ref_ls (str / str / float) – Reference-depth line style (axhline).
ref_lw (str / str / float) – Reference-depth line style (axhline).
grid_alpha (float) – Background grid transparency.
grid_axis (str) –
'y','x', or'both'.station_color (str / float / float) – Station-tick axvline appearance.
station_alpha (str / float / float) – Station-tick axvline appearance.
station_lw (str / float / float) – Station-tick axvline appearance.
color_TR (str)
color_S (str)
tr_threshold (float)
s_threshold_moderate (float)
s_threshold_good (float)
hist_alpha (float)
hist_edgecolor (str)
hist_bins (int)
kde_color (str)
kde_lw (float)
- envelope_kwargs(color, **overrides)[source]#
Keyword arguments for
ax.fill_between(uncertainty band).
- class pycsamt.api.interp.InterpStyle(section=<factory>, profile=<factory>, figsize_section=(13.0, 5.0), figsize_profile=(13.0, 6.0), figsize_uncertainty=(13.0, 8.0), figsize_crossplot=(7.0, 5.5), figsize_depth_profile=(4.5, 9.0), figsize_aquifer_char=(13.0, 9.0), figsize_tl_panel=(3.5, 4.5))[source]#
Bases:
objectComplete visual bundle for one hydrogeophysical interpretation preset.
- Parameters:
section (HydroSectionStyle) – Controls all 2-D colour-section plots.
profile (HydroProfileStyle) – Controls all 1-D profile plots.
figsize_section (tuple) – Default figure size (width, height) for single-panel 2-D sections.
figsize_profile (tuple) – Default figure size for 2-panel 1-D profile plots.
figsize_uncertainty (tuple) – Default figure size for 2-panel uncertainty sections.
- section: HydroSectionStyle#
- profile: HydroProfileStyle#
- class pycsamt.api.interp.PyCSAMTInterp[source]#
Bases:
objectPackage-wide visual control container for hydro-geophysical plots.
Holds one
InterpStyleper named preset. The default preset is what plot classes use when no explicitstyle=argument is given.Examples
>>> from pycsamt.api.interp import PYCSAMT_INTERP >>> PYCSAMT_INTERP.use("publication") >>> # now all subsequent interp plots use the publication style >>> with PYCSAMT_INTERP.context("dark"): ... fig = PlotHydroSection(result).plot() >>> # reverts
- style_for(preset)[source]#
Return the
InterpStylefor preset.- Parameters:
preset (str) – One of
'default','publication','dark','accessible'.- Return type:
- use(preset)[source]#
Copy a named preset into the default slot.
After this call, all plot classes that read from
PYCSAMT_INTERPwill use the chosen preset’s styles.- Parameters:
preset (str) – Name of the preset to activate.
- Return type:
None
- configure(**kw)[source]#
Configure the default style using
sub__fielddotted paths.Examples
>>> PYCSAMT_INTERP.configure( ... section__cmap_K="plasma", ... section__wt_color="white", ... profile__color_wt="royalblue", ... figsize_section=(10, 4), ... )
- Parameters:
kw (Any)
- Return type:
None
- context(preset=None, **kw)[source]#
Temporarily override the default style, then restore it.
- Parameters:
preset (str, optional) – Named preset to activate for the duration of the block.
**kw – Additional dotted-path overrides applied after the preset (same semantics as
configure()).
- Return type:
Generator[PyCSAMTInterp, None, None]
Examples
>>> with PYCSAMT_INTERP.context("publication", ... section__wt_lw=0.8): ... fig = PlotHydroSection(result).plot()
- pycsamt.api.interp.configure_interp(**kw)[source]#
Configure
PYCSAMT_INTERPusing dotted-path keys.Equivalent to
PYCSAMT_INTERP.configure(**kw).- Parameters:
kw (Any)
- Return type:
None