# Data gateway

SnowMapper delivers snow products to the **SAPPHIRE data gateway** as NetCDF files on S3 (bucket
`snow-model-data-source`). The product is one merged **mosaic** of Nepal, Central Asia and
Kazakhstan on a single 500 m grid. The older Nepal and Central Asia feeds are **deprecated**. All
times are UTC unless marked.

## Delivery commitment (mosaic)

!!! info "Moving to the 0.1° (9 km) forecast"
    Nepal, Central Asia, Kazakhstan and the mosaic are moving from the 0.25° to the **0.1° (9 km)**
    ECMWF forecast. ECMWF publishes 0.1° two hours after 0.25°, so the forecast times on this page are
    about two hours later than before, and the forecast commitment moves from init + 10 h to
    init + 12 h. The switch is in progress (17 November 2026). Until it is complete,
    these products still run on 0.25°, about two hours earlier than shown.


| Delivery | Complete on S3 by | Usually | Notes |
|---|---|---|---|
| Reanalysis, day D | **03:00 on day D+7** | ≈ 02:00 (starts as soon as ERA5 is published; retry 14:30) | ERA5T for day D is published at D+6, 00:10–01:40, and day D needs D+1. If ERA5 is late, delivery follows within ≈ 30 min. |
| Forecast from the 00Z run | **12:00** (init + 12 h) | ≈ 10:20 | IFS 0.1° complete ≈ 09:35 |
| Forecast from the 12Z run | **00:00** (init + 12 h) | ≈ 22:20 | IFS 0.1° complete ≈ 21:35 |

**Completion signal.** A day or cycle is complete only when its manifest exists:
`manifests/reanalysis/YYYYMMDD.json` or `manifests/forecasts/YYYYMMDDHH.json`. The manifest is
written after both files have been checked on S3. A cycle that cannot be produced has no manifest;
it is never replaced by an older cycle. Forecast cycles stay on S3 for 14 days, reanalysis from
2025-09-01 onwards. Changes to these times are announced in `#data-gateway` before they take
effect.

## A day on four clocks

When the source data are published and when each delivery lands on S3 on the 0.1° forecast, in UTC
and in Nepal, Kyrgyz and Kazakh time. Both the reanalysis and the 12Z forecast are on S3 before
09:00 in Kathmandu, Bishkek and Almaty, so forecast tools can run before the working day. Shaded bands are the local working day (09:00–18:00); red marks are the
commitment deadlines.

[Figure: 24-hour timeline in UTC, Nepal, Kyrgyz and Kazakh time of source data publication, mosaic deliveries, deadlines and deprecated feeds. See the web page for the drawing.]

## What lands on S3, and when

| Feed | Status | On S3 (UTC) | Content | Prefix |
|---|---|---|---|---|
| Mosaic reanalysis | **operational** | ≈ 02:00, by 03:00 | day D on D+7 | `joel-snow-model-mosaic/reanalysis/` |
| Mosaic forecast | **operational** | ≈ 10:20 · ≈ 22:20 | 00Z and 12Z, IFS 0.1°; promise init + 12 h; kept 14 days | `joel-snow-model-mosaic/forecasts/` |
| Nepal reanalysis | **deprecated** | 03:45 | day files, ≈ 7 days behind | `joel-snow-model-nepal/reanalysis/` |
| Nepal forecast | **deprecated** | 08:15 · 13:12 · 20:15 · 01:12 | 00/06/12/18Z cycles | `joel-snow-model-nepal/forecasts/` |
| Central Asia (aws box) | **deprecated** | 19:40–20:10 | reanalysis day + 10-day forecast | `joel-snow-model/` |
| Kazakhstan | — | none | reaches the gateway only through the mosaic | — |

**Deprecated feeds** are replaced by the mosaic. They are still delivered until the gateway has
switched to the mosaic and the cutover is approved; do not build anything new on them.

On S3 now (17 November 2026): mosaic reanalysis 2025-09-01 → 2026-11-10 and forecast cycles
2026-11-08 12Z, 11-09 00Z, 11-13 00Z, 11-16 00Z and 12Z, and 11-17 00Z. The full format of the
mosaic files is in the [file specification](file-specification.md).

## What one forecast cycle covers

[Figure: Reanalysis until the cut, an IFS bridge, then the 240-hour forecast file from the IFS init. See the web page for the drawing.]

The forecast continues the reanalysis snowpack. It starts from the model state at the reanalysis
cut and bridges to the init with IFS, so history and forecast come from one run. Cycles stay on S3
for 14 days, so the gateway's `snow.operational` series can stitch the first steps of successive
cycles over the ≈ 6-day gap.

## S3 file formats

The Nepal and Central Asia feeds below are deprecated and kept here for reference until the
cutover to the mosaic.

### Mosaic reanalysis (operational, daily)

Prefix `joel-snow-model-mosaic/`

| Field | Value |
|---|---|
| **Keys** | `reanalysis/param={swe,rof}/run_date=YYYYMMDD/{p}_YYYYMMDD.nc`, manifest `manifests/reanalysis/YYYYMMDD.json` |
| **Grid** | 7124 × 11577; 38–90 E, 25–57 N, 500 m, aligned to the Nepal grid; NaN outside domains |
| **Time axis** | 8 × 3 h stamped 00, 03 … 21 (window start); SWE is the state at the stamp (`time: point`); ROF is the sum over [t, t+3 h) with `time_bnds` |
| **Encoding** | int16 · scale swe 1, rof 0.1 · fill −32768 · zlib 5 + shuffle · chunks (8, 256, 256) · CF-1.5; attributes `glacier_mask=none` and, on files delivered so far, `status=test`; Kazakhstan open-loop |
| **Size** | ≈ 60 MB/day, 21.9 GB per hydro year |
| **Cadence** | daily, as soon as ERA5 is published (polled every 10 min from 00:00), retry 14:30; day D complete by D+7 03:00 |

### Mosaic forecast (operational, 00Z + 12Z)

Prefix `joel-snow-model-mosaic/`

| Field | Value |
|---|---|
| **Keys** | `forecasts/param={swe,rof}/run_date=YYYYMMDD/run_hour={0,12}/{p}_YYYYMMDD_HHz.nc`, manifest `manifests/forecasts/YYYYMMDDHH.json`; kept 14 days |
| **Grid** | 7124 × 11577 |
| **Time axis** | 80 × 3 h, +0 h … +237 h, hours since init; same window rules; SWE at +240 h not included |
| **Encoding** | as the mosaic reanalysis; chunks (80, 256, 256) |
| **Size** | 0.58 GB per cycle (swe 343 MB, rof 235 MB, 2026-11-16 00Z) |
| **Cadence** | 2 cycles a day, IFS 0.1°; ≈ 45 min after release (00Z ≈ 10:20, 12Z ≈ 22:20); promise init + 12 h |

### Nepal reanalysis (deprecated)

Prefix `joel-snow-model-nepal/`

| Field | Value |
|---|---|
| **Keys** | `reanalysis/param={swe,hs,rof}/run_date=YYYYMMDD/{p}_YYYYMMDD.nc`; WY2002 → present |
| **Grid** | 966 × 1923, lat/lon, 500 m |
| **Time axis** | 24 × 1 h, 00 … 23, hours since day; SWE `time: point` |
| **Encoding** | int16 · scale swe 1, hs 0.001, rof 0.1 · fill −32768 · zlib 5 + shuffle · chunks (nt, 256, 256) · CF-1.5; glacier units (frac_excluded ≥ 0.5) masked |
| **Size** | swe 11.7, hs 15.7, rof 1.6 MB/day (November) |
| **Cadence** | daily push 03:45; data ≈ 7 days behind |

### Nepal forecast (deprecated)

Prefix `joel-snow-model-nepal/`

| Field | Value |
|---|---|
| **Keys** | `forecasts/param={swe,hs,rof}/run_date=YYYYMMDD/run_hour={0,6,12,18}/{p}_YYYYMMDD_HHz.nc`; a newer cycle overwrites keys |
| **Grid** | 966 × 1923 |
| **Time axis** | 00/12Z: 241 × 1 h (0 … 240 h); 06/18Z: 145 × 1 h (0 … 144 h); hours since init |
| **Encoding** | as the Nepal reanalysis; IFS 0.25° 3 h/6 h interpolated to 1 h |
| **Size** | swe ≈ 66 MB per 00Z cycle; ≈ 270 MB/day swe + rof over 4 cycles |
| **Cadence** | 4 cycles a day, on S3 6–13 min after the :07 poll (00Z ≈ 08:15, 12Z ≈ 20:15) |

### Central Asia reanalysis (deprecated, aws box)

Prefix `joel-snow-model/`

| Field | Value |
|---|---|
| **Keys** | `{SWE,HS,ROF}/YYYY/YYYYMM/{P}_YYYYMMDD.nc`, plus per-HRU CSVs under `YYYY/{SWE,HS,ROF}/` |
| **Grid** | 1872 × 3623 |
| **Time axis** | one daily field, 2-D (no time axis) |
| **Encoding** | float32 · fill −9999 · zlib 4 + shuffle (GDAL + CDO) |
| **Size** | 3–5 MB/day |
| **Cadence** | daily, cron 15:50; lands 19:40–20:10; ≈ 6 days behind |

### Central Asia forecast (deprecated, aws box)

Prefix `joel-snow-model/`

| Field | Value |
|---|---|
| **Keys** | `forecast/{SWE,HS,ROF}/YYYY/YYYYMM/{P}_YYYYMMDD.nc` |
| **Grid** | 1872 × 3623 |
| **Time axis** | 10 × 1 day, days since run date |
| **Encoding** | float32 · fill −9999 · zlib 4 |
| **Size** | 30–38 MB per parameter |
| **Cadence** | daily with the reanalysis; lands 19:40–20:10 |

### Kazakhstan

No S3 product of its own. It runs on compute (twice a day, on each ECMWF release, with data
assimilation) and on the Kazhydromet partner box, is published on the dashboards, and enters the
gateway through the mosaic.

Compute's own Central Asia run does not push to S3. Storage on the mosaic
prefix: about 25 GB of reanalysis today (growing ≈ 60 MB/day) plus 14 days of cycles (≈ 16 GB),
roughly $1 a month.
