2.27.2.10. pycsamt.pipeline._preview#
Random-station raw-vs-processed preview for method-aware presets.
pick_preview_stations() deterministically samples a handful of station
names from a Sites collection; plot_raw_preview() and
plot_processed_preview() reuse the existing
pycsamt.emtools.plot.plot_raw_sites_1d() (which already supports both
raw and processed rendering via its raw flag — no new plotting code was
needed) to draw the same stations before and after processing.
Both plot functions are registered as QC hooks on the preview category
steps (PRE001/PRE002) — placed first and last in a preset
respectively — but are also plain, directly callable functions for anyone
who wants a custom station count or explicit station list outside the
pipeline, since a QC hook is always invoked as fn(sites) with no way to
forward extra keyword arguments (see pycsamt.pipeline._smart_qc for
the same constraint).
Both steps re-derive the station selection independently with the same default seed, so if an intermediate processing step drops one of the previewed stations, the “after” plot’s reselection (drawn from the smaller surviving set, same seed) can end up choosing a different station than the “before” plot. This is a deliberate trade-off: solving it exactly would require carrying state across step boundaries, which the pipeline’s otherwise-stateless step-execution model does not support.
Functions
|
Deterministically pick up to n station names from sites. |
|
Processed 1-D rho/phase panels for the same deterministic station subset. |
|
Raw 1-D rho/phase panels for a deterministic random station subset. |
- pycsamt.pipeline._preview.pick_preview_stations(sites, *, n=3, random_state=0)[source]
Deterministically pick up to n station names from sites.
Uses the same station-name resolution as every other
emtoolsplotting function (pycsamt.emtools._core._name()), so the returned names match whatplot_raw_sites_1d(sites, stations=...)expects.
- pycsamt.pipeline._preview.plot_raw_preview(sites, *, n=3, random_state=0)[source]
Raw 1-D rho/phase panels for a deterministic random station subset.