# SWE normals and percentiles

For every day, the distribution of snow water equivalent (SWE) on that calendar day in up
to 30 previous snow years, and where each day's observed SWE falls in it. A snow year runs
Sep 1–Aug 31 and is named for the year it ends in; unlike the USGS water year (Oct 1–Sep
30), it starts near the annual SWE minimum. The plots label it "SY"; file names call it
the water year (`wy2027`). 2027's normals use 2004–2026 (SNODAS starts in 2003). A snow
year's normals are built once, around Sep 1, and do not change during that year.

| Path | Contents |
|------|----------|
| `gridded/<flavor>/` | Per pixel, as COGs. |
| `zonal/wbd/<flavor>/` | Per watershed and elevation band, as Parquet. |
| `zonal/wbd/raw/` | The yearly watershed SWE series the zonal normals are fit to. |
| `build/` | Working files of an annual build in progress; not for use. |

## Flavors

All three treat SWE as zero-inflated: P(SWE = 0) = p0, and for SWE > 0 the CDF is
p0 + (1 − p0)·F(SWE).

| `<flavor>` | Name | F |
|------------|------|---|
| `ecdf` | Empirical | Empirical CDF of the positive reference values (type 7). |
| `zig` | Fitted | Gamma fit by L-moments; empirical where a pixel has fewer than 4 positive values. |
| `zig_smooth` | Smoothed | Zero-adjusted gamma whose parameters vary smoothly through the year (cyclic P-splines in day of snow year), fit to all days at once. |

Reference years with no valid data at a pixel or band are skipped; at least 10 valid years
are needed when any are missing.

## Percentiles and anomalies

- **Percentile:** the observed SWE's CDF value × 100. Zero SWE maps to p0 / 2 × 100, the
  middle of the zero mass, so a place that is always bare on that date reads 50.
- **Standardized anomaly:** the standard normal quantile of the percentile, clamped to ±4.
- **Quantiles** `q0000` … `q1000` at probabilities 0, 0.01, 0.02, 0.025, 0.05, 0.1, 0.2,
  0.25, 0.3, 0.5, 0.7, 0.75, 0.8, 0.9, 0.95, 0.975, 0.98, 0.99, 1. `q0000` is 0;
  `q1000` is NoData wherever SWE can be positive.

Percentiles for each new date are added nightly against the frozen normals.
