Documents · Verb reference
panel_change_diagnostics
Compare adjacent cold, warm, and Delta synchrony landscapes.
Callable type: Grammar verb / pipe stage · Browse: Synchrony and comparison
Usage
from cubedynamics import verbs as v
v.panel_change_diagnostics(*, adjacency=4, deadband=0.02, near_tie_epsilon=0.005)
Arguments
| Argument | Meaning | Default |
|---|---|---|
| adjacency | See implementation docstring below; no parameter-specific description supplied. | 4 |
| deadband | See implementation docstring below; no parameter-specific description supplied. | 0.02 |
| near_tie_epsilon | See implementation docstring below; no parameter-specific description supplied. | 0.005 |
Accepts
A Dataset produced by v.local_synchrony_stack(...), retaining cold, warm, Delta, center-index, distance, and direction fields.
Returns
A summary Dataset with one row per adjacent-center comparison and separate cold, warm, and Delta magnitude, rank, sign, distribution, gradient, valid-count, range, and near-tie diagnostics.
Order / grammar behavior
Build the unreduced stack first. Interpret Spearman with dynamic-range and near-tie context; this verb intentionally does not create one universal panel-change scalar.
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.panel_change_diagnostics(deadband=0.02)).unwrap()
result[["delta_spearman", "delta_rmse", "delta_sign_disagreement"]].to_dataframe().plot.scatter(x="delta_rmse", y="delta_spearman")
plt.show()
Works with
A Dataset produced by v.local_synchrony_stack(...), retaining cold, warm, Delta, center-index, distance, and direction fields.
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.