Documents · Verb reference
stack_radius_diagnostics
Describe how focal stack summaries change across nested support radii.
Callable type: Grammar verb / pipe stage · Browse: Synchrony and comparison
Usage
from cubedynamics import verbs as v
v.stack_radius_diagnostics(*, radii_km=None, stable_tolerance=0.02, stable_min_centers=25)
Arguments
| Argument | Meaning | Default |
|---|---|---|
| radii_km | See implementation docstring below; no parameter-specific description supplied. | None |
| stable_tolerance | See implementation docstring below; no parameter-specific description supplied. | 0.02 |
| stable_min_centers | See implementation docstring below; no parameter-specific description supplied. | 25 |
Accepts
A Dataset produced by v.local_synchrony_stack(...), including center-to-focal distances.
Returns
Nested-radius cold, warm, and Delta counts, moments, robust quantiles, step/derivative fields, and explicitly experimental stable-radius maps.
Order / grammar behavior
Build the unreduced stack first. Requested radii must be increasing and cannot create support outside the source stack; stable-radius fields retain their full experimental rule in metadata.
Minimal example
Run from the repository root after python -m pip install -e '.[vignettes]'. Uses the checked observational PRISM fixture; no network is required.
from pathlib import Path
import xarray as xr
import matplotlib.pyplot as plt
from cubedynamics import pipe, verbs as v
# Frozen, reviewed PRISM observations; run from the repository root.
path = Path("tests/fixtures/real_data/prism_boulder_january_2024.nc")
with xr.open_dataset(path, engine="scipy") as observed:
cube = observed["tmax"].load()
assert cube.attrs["units"] == "degC"
small = cube.isel(y=slice(0, 4), x=slice(0, 4))
temperature = xr.Dataset({"tmin": small, "tmax": small})
stack = (pipe(temperature) | v.local_synchrony_stack(lower_var="tmin", upper_var="tmax", window_days=14, min_t=3, center_y_indices=range(4), center_x_indices=range(4))).unwrap()
result = (pipe(stack) | v.stack_radius_diagnostics(radii_km=(0, 10, 20, 40), stable_min_centers=3)).unwrap()
result["delta_iqr"].isel(y=1, x=1).plot.line(x="radius_km")
plt.show()
Works with
A Dataset produced by v.local_synchrony_stack(...), including center-to-focal distances.
See also
Implementation notes
No additional implementation notes in the current docstring.
Implementation source. Signatures and descriptions on this page are generated from this checkout, not hand-maintained copies.