Repository navigation
Expand file tree
/
Copy pathsnow.html
More file actions
562 lines (553 loc) · 35.3 KB
/
Copy pathsnow.html
File metadata and controls
562 lines (553 loc) · 35.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Snow Cover and Depth · Shawn Corvec</title>
<meta name="description" content="Today's snow cover and depth against normal from NOAA's IMS analysis, ERA5 and, over the US, SNODAS, side by side, with the snow-covered area of each hemisphere and continent.">
<link rel="canonical" href="https://scorvec.com/snow.html">
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
<meta property="og:type" content="website">
<meta property="og:title" content="Snow cover and depth against normal">
<meta property="og:description" content="NOAA IMS, ERA5 and SNODAS snow cover and depth against their normals, compared side by side.">
<meta property="og:url" content="https://scorvec.com/snow.html">
<meta name="twitter:card" content="summary_large_image">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,500;0,8..60,600;1,8..60,400&family=Source+Sans+3:ital,wght@0,400;0,500;0,600;1,400&display=swap" rel="stylesheet">
<link rel="stylesheet" href="/assets/site.css?v=6a44bd129a">
<style>
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.55; }
main { max-width: min(94vw, 1800px); margin: 0 auto; padding: 1.5rem 1.2rem 3rem; }
h1 { font-family: var(--serif); font-weight: 500; font-size: var(--t-h1); line-height: 1.15; margin: 0.4rem 0 0.4rem; }
h2 { font-family: var(--serif); font-weight: 500; font-size: var(--t-h2); margin: 2rem 0 0.5rem; }
.lede { color: var(--ink2); margin: 0 0 1rem; max-width: 90ch; }
.ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.4rem; margin: 0 0 0.8rem; font-size: 0.92rem; color: var(--ink2); }
.ctl fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.ctl legend { float: left; margin-right: 0.4rem; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.7rem; border: 1px solid var(--edge); border-radius: 6px; background: var(--panel); cursor: pointer; font-weight: 500; }
.chip:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); color: var(--ink); }
.chip input { accent-color: var(--accent); margin: 0; }
.ctl select { font: inherit; padding: 0.3rem 0.4rem; border: 1px solid var(--edge); border-radius: 6px; background: var(--panel); max-width: 100%; }
.bar { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin: 0 0 0.8rem; }
.bar button { font: 500 0.86rem var(--sans); color: var(--ink2); background: var(--panel); border: 1px solid var(--edge); border-radius: 6px; padding: 0.3rem 0.65rem; cursor: pointer; }
.bar button:disabled { color: var(--muted); cursor: default; }
.bar input[type=range] { flex: 1 1 12rem; min-width: 8rem; accent-color: var(--accent); }
.bar output { font: 600 0.92rem var(--sans); color: var(--ink); min-width: 9rem; }
.grid { display: grid; grid-template-columns: repeat(var(--n, 1), minmax(0, 1fr)); gap: 12px; }
.grid figure { margin: 0; min-width: 0; position: relative; }
.grid figure img { transition: opacity 0.15s; }
.grid figure.loading img { opacity: 0.7; }
.grid figure.missing img { opacity: 0.15; }
.grid .over { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; padding: 1rem; text-align: center; color: var(--muted); font-size: 0.9rem; }
.grid figure.missing .over { display: flex; }
.grid img { display: block; width: 100%; height: auto; max-height: calc(100vh - 220px); object-fit: contain; background: #fff; }
.grid .gap { display: flex; align-items: center; justify-content: center; min-height: 14rem; background: #f4f3ef; color: var(--muted); font-size: 0.9rem; padding: 1rem; text-align: center; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .tip { position: absolute; pointer-events: none; background: rgba(28,28,26,0.92); color: #fff; font-size: 0.86rem; line-height: 1.35; padding: 0.35rem 0.55rem; border-radius: 4px; display: none; white-space: nowrap; }
.key { display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; font-size: 0.88rem; color: var(--ink2); margin: 0.3rem 0 0; }
.key .kb { font: 500 0.88rem var(--sans); color: var(--ink2); background: var(--panel); border: 1px solid var(--edge); border-radius: 6px; padding: 0.25rem 0.6rem; cursor: pointer; }
.key .kb[aria-pressed=false] { opacity: 0.5; }
.key .kb small { color: var(--muted); font-size: 0.8rem; }
.key .kn { align-self: center; }
.key i { display: inline-block; width: 1.2rem; height: 0.22rem; border-radius: 2px; vertical-align: middle; margin-right: 0.35rem; }
.fine { font-size: 0.86rem; color: var(--muted); margin: 0.7rem 0 0; max-width: 110ch; }
.fine a { color: var(--accent); }
@media (max-width: 760px) {
main { padding: 1rem 16px 2rem; }
.grid { grid-template-columns: 1fr; }
.bar output { min-width: 0; flex-basis: 100%; }
}
</style>
<script src="/assets/frames_root.js?v=37e1429f1f"></script>
<script src="/assets/site.js?v=de9fd94074" defer></script>
<script data-goatcounter="https://scorvec.goatcounter.com/count" async src="https://gc.zgo.at/count.v4.js" integrity="sha384-nRw6qfbWyJha9LhsOtSb2YJDyZdKvvCFh0fJYlkquSFjUxp9FVNugbfy8q1jdxI+" crossorigin="anonymous"></script>
</head>
<body>
<!-- sh:start -->
<a class="skip-link" href="#main">Skip to main content</a>
<header class="sh" id="site-header">
<div class="sh-in">
<a class="sh-brand" href="/">Shawn Corvec</a>
<button class="sh-toggle" type="button" aria-expanded="false" aria-controls="sh-menu">Menu</button>
<nav class="sh-nav" id="sh-menu" aria-label="Site">
<ul class="sh-list">
<li class="sh-item sh-has-menu">
<button class="sh-link sh-menubtn" type="button" aria-expanded="false" aria-controls="sh-g0">Forecasts</button>
<div class="sh-menu sh-menu--cols" id="sh-g0">
<div class="sh-col">
<div>
<h3>Model maps</h3>
<ul>
<li><a href="/models.html"><span class="sh-t">North America, short range</span><span class="sh-d">HRRR, RRFS and RDPS: radar, snow, storms</span></a></li>
<li><a href="/samerica-models.html"><span class="sh-t">South America, to day 10</span><span class="sh-d">IFS control and GDPS, with soundings</span></a></li>
<li><a href="/ens-anomalies.html"><span class="sh-t">Global ensembles</span><span class="sh-d">Four ensembles: anomalies and regimes</span></a></li>
</ul>
</div>
</div>
<div class="sh-col">
<div>
<h3>Days 1–15</h3>
<ul>
<li><a href="/ar.html"><span class="sh-t">Atmospheric rivers</span><span class="sh-d">Moisture plumes, landfall and their odds</span></a></li>
<li><a href="/circulation.html#dt"><span class="sh-t">Jet streams and tropopause</span><span class="sh-d">Tropopause, Pacific and subtropical jets, wave trains</span></a></li>
<li><a href="/circulation.html#wcb"><span class="sh-t">Warm conveyor belts</span><span class="sh-d">Inflow, ascent and outflow in 50 members</span></a></li>
<li><a href="/aam.html"><span class="sh-t">Earth’s angular momentum and day length</span><span class="sh-d">Day length, momentum budget, mountain torques</span></a></li>
<li><a href="/circulation.html#telecon15"><span class="sh-t">Teleconnections</span><span class="sh-d">AO, NAO, PNA and more, calibrated</span></a></li>
</ul>
</div>
</div>
</div>
</li>
<li class="sh-item sh-has-menu">
<button class="sh-link sh-menubtn" type="button" aria-expanded="false" aria-controls="sh-g1">Tropics</button>
<div class="sh-menu sh-menu--cols" id="sh-g1">
<div class="sh-col">
<div>
<h3>ENSO and the MJO</h3>
<ul>
<li><a href="/enso.html"><span class="sh-t">El Niño monitor</span><span class="sh-d">ONI, RONI, the subsurface and winds</span></a></li>
<li><a href="/mjo.html"><span class="sh-t">MJO forecast</span><span class="sh-d">Four ensembles on one phase diagram</span></a></li>
<li><a href="/tropical-waves.html"><span class="sh-t">Tropical waves</span><span class="sh-d">Kelvin and Rossby waves, now and ahead</span></a></li>
</ul>
</div>
</div>
<div class="sh-col">
<div>
<h3>Circulation</h3>
<ul>
<li><a href="/circulation.html#walker"><span class="sh-t">Walker and Hadley cells</span><span class="sh-d">The overturning, its outflow and descent</span></a></li>
<li><a href="/circulation.html#mslp"><span class="sh-t">Pacific pressure and satellite</span><span class="sh-d">Pressure, wind and simulated IR</span></a></li>
<li><a href="/circulation.html#rainfc"><span class="sh-t">Rain forecast, weeks 1–2</span><span class="sh-d">Four ensembles, bias-adjusted, blended</span></a></li>
<li><a href="/circulation.html#troughs"><span class="sh-t">Convergence and monsoon troughs</span><span class="sh-d">Where the low-level wind converges, days 1–15</span></a></li>
</ul>
</div>
</div>
</div>
</li>
<li class="sh-item sh-has-menu">
<button class="sh-link sh-menubtn" type="button" aria-expanded="false" aria-controls="sh-g2">Stratosphere</button>
<div class="sh-menu sh-menu--cols" id="sh-g2">
<div class="sh-col">
<div>
<h3>Forecasts</h3>
<ul>
<li><a href="/ssw.html"><span class="sh-t">SSW outlook</span><span class="sh-d">Is a sudden warming coming?</span></a></li>
<li><a href="/stratosphere.html#vortex"><span class="sh-t">The next two weeks</span><span class="sh-d">The vortex, its waves and the surface</span></a></li>
<li><a href="/stratosphere.html#vortex35"><span class="sh-t">Weeks 3–5 and the season</span><span class="sh-d">GEPS, GEFS, C3S and SEAS5</span></a></li>
<li><a href="/strat-models.html"><span class="sh-t">Stratosphere model maps</span><span class="sh-d">Polar maps at every level, zoomable</span></a></li>
</ul>
</div>
</div>
<div class="sh-col">
<div>
<h3>Analyses and history</h3>
<ul>
<li><a href="/stratosphere.html#qbo"><span class="sh-t">The QBO and today's analyses</span><span class="sh-d">QBO, momentum and the Brewer–Dobson</span></a></li>
<li><a href="/stratosphere.html#shwinters"><span class="sh-t">History and studies</span><span class="sh-d">Every winter and warming since 1980</span></a></li>
</ul>
</div>
</div>
</div>
</li>
<li class="sh-item sh-has-menu">
<button class="sh-link sh-menubtn" type="button" aria-expanded="false" aria-controls="sh-g3">Weeks to seasons</button>
<div class="sh-menu sh-menu--cols" id="sh-g3">
<div class="sh-col">
<div>
<h3>Extended range</h3>
<ul>
<li><a href="/subseasonal.html"><span class="sh-t">GEPS, to day 35</span><span class="sh-d">Canada's extended ensemble</span></a></li>
<li><a href="/gefs.html"><span class="sh-t">GEFS, to day 35</span><span class="sh-d">NOAA's extended ensemble</span></a></li>
</ul>
</div>
</div>
<div class="sh-col">
<div>
<h3>Months and seasons</h3>
<ul>
<li><a href="/monthly-outlook.html"><span class="sh-t">Claude's long-range forecast</span><span class="sh-d">The month and three seasons ahead</span></a></li>
<li><a href="/seasonal.html"><span class="sh-t">Seasonal model forecasts</span><span class="sh-d">Seven C3S systems and CanSIPS</span></a></li>
<li><a href="/enso-forecasts.html"><span class="sh-t">ENSO forecasts</span><span class="sh-d">Niño-3.4 from five centres</span></a></li>
</ul>
</div>
</div>
</div>
</li>
<li class="sh-item sh-has-menu">
<button class="sh-link sh-menubtn" type="button" aria-expanded="false" aria-controls="sh-g4" aria-current="page">Studies and tools</button>
<div class="sh-menu sh-menu--cols" id="sh-g4">
<div class="sh-col">
<div>
<h3>Studies</h3>
<ul>
<li><a href="/enso.html#imp_reg"><span class="sh-t">ENSO impacts on the Americas</span><span class="sh-d">CMIP6 and the observed record</span></a></li>
<li><a href="/mjo.html#mi"><span class="sh-t">MJO impacts</span><span class="sh-d">Each phase, season by season</span></a></li>
<li><a href="/aifs-aam-budget.html"><span class="sh-t">AI models and conservation laws</span><span class="sh-d">Does the AIFS keep the budgets?</span></a></li>
<li><a href="/torque-enso.html"><span class="sh-t">El Niño and angular momentum</span><span class="sh-d">Why the atmosphere spins up</span></a></li>
<li><a href="/solar-strat.html"><span class="sh-t">The solar cycle and the stratosphere</span><span class="sh-d">Three proposed routes, each tested</span></a></li>
<li><a href="/topics/"><span class="sh-t">Explainers</span><span class="sh-d">The physics behind the products</span></a></li>
</ul>
</div>
</div>
<div class="sh-col">
<div>
<h3>Verification</h3>
<ul>
<li><a href="/verification.html"><span class="sh-t">Model verification</span><span class="sh-d">Scorecards, maps and the database</span></a></li>
</ul>
</div>
<div>
<h3>Tools</h3>
<ul>
<li><a href="/skewt/"><span class="sh-t">Sounding explorer</span><span class="sh-d">Radiosondes worldwide, live</span></a></li>
<li><a href="/asos5.html"><span class="sh-t">Five-minute airport observations</span><span class="sh-d">22 major US airports, live</span></a></li>
<li><a href="/snow.html" aria-current="page"><span class="sh-t">Snow cover and depth</span><span class="sh-d">IMS, ERA5 and SNODAS, against normal</span></a></li>
<li><a href="/climate.html"><span class="sh-t">US climate trends</span><span class="sh-d">Every county and month since 1895</span></a></li>
<li><a href="/fci.html"><span class="sh-t">US credit conditions</span><span class="sh-d">Financial conditions, weekly since 1990</span></a></li>
</ul>
</div>
</div>
</div>
</li>
<li class="sh-item sh-has-menu sh-item--me">
<button class="sh-link sh-menubtn sh-me" type="button" aria-expanded="false" aria-controls="sh-me">About</button>
<div class="sh-menu sh-menu--list sh-menu--me" id="sh-me">
<ul>
<li><a href="/about.html">About me</a></li>
<li><a href="/resume.html">Resume</a></li>
<li><a href="/research.html">Publications</a></li>
<li><a href="/guides/">Methods</a></li>
<li class="sh-me-ext"><a href="https://github.com/scorvec">GitHub</a></li>
<li><a href="https://scholar.google.com/citations?user=EYLRCJIAAAAJ&hl=en">Google Scholar</a></li>
<li><a href="https://www.linkedin.com/in/shawn-corvec-35895b231/">LinkedIn</a></li>
</ul>
</div>
</li>
</ul>
</nav>
</div>
</header>
<!-- sh:end -->
<main id="main">
<h1>Snow cover and depth</h1>
<p class="lede">Snow on the ground against normal from NOAA’s IMS analysis, ERA5 and, over the US, SNODAS; tick the datasets to compare them side by side.</p>
<div class="ctl">
<fieldset id="sets"><legend>Datasets</legend>
<label class="chip"><input type="checkbox" value="ims" checked> IMS snow cover</label>
<label class="chip"><input type="checkbox" value="imsf"> IMS snow fraction</label>
<label class="chip"><input type="checkbox" value="era5c" checked> ERA5 snow cover</label>
<label class="chip"><input type="checkbox" value="era5d"> ERA5 snow depth</label>
<label class="chip"><input type="checkbox" value="snodasc"> SNODAS snow cover</label>
<label class="chip"><input type="checkbox" value="snodasd"> SNODAS snow depth</label>
<label class="chip"><input type="checkbox" value="snodasf"> SNODAS snow fraction</label>
</fieldset>
<label>Region <select id="region">
<option value="nh">Northern Hemisphere</option>
<option value="na">North America</option>
<option value="us">Contiguous US</option>
<option value="eu">Eurasia</option>
<option value="sh">Southern Hemisphere</option>
</select></label>
</div>
<div class="bar">
<button id="prev" type="button" aria-label="Previous day">←</button>
<input id="day" type="range" min="0" max="0" value="0" aria-label="Date">
<button id="next" type="button" aria-label="Next day">→</button>
<button id="latest" type="button">Latest</button>
<output id="dayout" for="day"></output>
</div>
<div class="grid" id="maps"></div>
<h2>Snow-covered area</h2>
<div class="chart" id="chart"><div class="tip" id="tip"></div></div>
<div class="key" id="chartkey"></div>
<p class="fine"><a href="/guides/snow.html">How these maps and numbers are built</a></p>
<p class="fine" id="sources">Sources: NOAA/NESDIS and U.S. National Ice Center, IMS Daily Northern Hemisphere Snow and Ice Analysis at 4 km (NSIDC G02156, doi:10.7265/N52R3PMC); NOAA/NWS National Operational Hydrologic Remote Sensing Center, Snow Data Assimilation System (SNODAS) Data Products at NSIDC, Version 1 (G02158, doi:10.7265/N5TB14TC); ERA5 (Hersbach et al. 2020; contains modified Copernicus Climate Change Service information 2026) via ARCO-ERA5 on Google Cloud. NOAA Climate Data Record of Northern Hemisphere Snow Cover Extent, v01r01 (Robinson et al., doi:10.7289/V5N014G9), via NOAA Open Data on AWS. <span id="updated"></span></p>
</main>
<script>
(function () {
"use strict";
var NAME = { ims: "IMS snow cover", imsf: "IMS snow fraction", era5c: "ERA5 snow cover", era5d: "ERA5 snow depth",
snodasc: "SNODAS snow cover", snodasd: "SNODAS snow depth", snodasf: "SNODAS snow fraction" };
var COVERS = { ims: "the Northern Hemisphere", imsf: "the Northern Hemisphere", snodasc: "the contiguous US", snodasd: "the contiguous US", snodasf: "the contiguous US" };
var LINE = { ims: { name: "IMS", colour: "#274b7a" }, era5: { name: "ERA5", colour: "#b4541f" },
snodas: { name: "SNODAS", colour: "#2a8a74" }, cdr: { name: "NOAA weekly record", colour: "#4a4744" } };
var MAN = null, SER = null, DATES = [], OFF = {};
var sets = document.getElementById("sets"), region = document.getElementById("region");
var slider = document.getElementById("day"), out = document.getElementById("dayout");
var maps = document.getElementById("maps");
function chosen() { return [].slice.call(sets.querySelectorAll("input:checked")).map(function (i) { return i.value; }); }
function fmt(d) { // YYYYMMDD -> 5 Dec 2026
var dt = new Date(Date.UTC(+d.slice(0, 4), +d.slice(4, 6) - 1, +d.slice(6, 8)));
return dt.toLocaleDateString("en-GB", { day: "numeric", month: "short", year: "numeric", timeZone: "UTC" });
}
function readHash() {
var h = location.hash.replace(/^#/, "").split("/");
if (h[0]) [].forEach.call(sets.querySelectorAll("input"), function (i) { i.checked = h[0].split(",").indexOf(i.value) >= 0; });
if (h[1] && region.querySelector('option[value="' + h[1] + '"]')) region.value = h[1];
return h[2] || "";
}
function writeHash() {
var d = DATES[+slider.value] || "";
history.replaceState(null, "", "#" + chosen().join(",") + "/" + region.value + (d && +slider.value !== DATES.length - 1 ? "/" + d : ""));
}
// One figure per ticked dataset, kept while the date changes: each new day's map loads off-screen and replaces
// the shown one only once it has arrived, so scrubbing never empties the grid; a day a dataset lacks dims its
// last map under a note. The figures are rebuilt only when the datasets or the region change.
var SLOTS = {}, SLOTKEY = "", WARM = {};
var RATIO = { nh: "836 / 880", sh: "836 / 880", na: "990 / 748", us: "990 / 660", eu: "1100 / 682" };
function frameRel(p, d) { return "assets/snow/anim/maps/" + p + "_" + region.value + "_" + d + ".webp"; }
function loadFrame(im, p, d, onFail) {
var rel = frameRel(p, d);
if (window.frameLoad) window.frameLoad(im, rel, "", rel, onFail || null, MAN.frames_sha); else im.src = "/" + rel;
}
function warm(p, d) {
var k = p + "/" + region.value + "/" + d;
if (WARM[k]) return;
var im = new Image();
im.decoding = "async";
loadFrame(im, p, d);
WARM[k] = im;
}
function buildSlots(ch) {
maps.innerHTML = "";
SLOTS = {};
if (!ch.length) { maps.innerHTML = '<div class="gap">Tick a dataset to see its map.</div>'; return; }
ch.forEach(function (p) {
var fig = document.createElement("figure"), pm = MAN.products[p] || { regions: [], dates: [] };
if (pm.regions.indexOf(region.value) < 0) {
fig.innerHTML = '<div class="gap">' + NAME[p] + " covers " + COVERS[p] + " only.</div>";
} else {
var im = new Image(), over = document.createElement("div");
im.decoding = "async";
im.style.aspectRatio = RATIO[region.value]; // holds the space until the first map arrives
over.className = "over";
fig.appendChild(im);
fig.appendChild(over);
SLOTS[p] = { fig: fig, img: im, over: over, dates: pm.dates, want: null };
}
maps.appendChild(fig);
});
}
function showDay(p, d) {
var s = SLOTS[p], last = s.dates.length ? s.dates[s.dates.length - 1] : null;
s.want = d;
if (s.dates.indexOf(d) < 0) { // dimmed under a note: the dataset's latest map when it has not reached the day
s.over.textContent = NAME[p] + (last && last < d ? " reaches " + fmt(last) + " so far." : " has no map for this day.");
s.fig.className = "missing";
if (last && last < d) swap(s, p, last, d, "missing");
return;
}
s.fig.className = s.img.getAttribute("src") ? "loading" : "";
swap(s, p, d, d, "");
}
// load the map of day `dd` off-screen and show it once it arrives, if day `want` is still the one asked for
function swap(s, p, dd, want, cls) {
var nx = new Image();
nx.decoding = "async";
nx.addEventListener("load", function () {
if (s.want !== want) return; // a later day was asked for meanwhile
s.img.src = nx.src;
s.img.style.aspectRatio = "";
s.img.alt = NAME[p] + ", " + region.options[region.selectedIndex].text + ", " + fmt(dd);
s.fig.className = cls;
});
loadFrame(nx, p, dd, function () {
if (s.want !== want || cls) return;
s.over.textContent = NAME[p] + ": the map for " + fmt(dd) + " did not load.";
s.fig.className = "missing";
});
}
function drawMaps() {
var i = +slider.value, d = DATES[i], ch = chosen();
out.textContent = d ? fmt(d) : "";
document.getElementById("prev").disabled = i <= 0;
document.getElementById("next").disabled = i >= DATES.length - 1;
maps.style.setProperty("--n", Math.max(1, Math.min(ch.length, region.value === "nh" || region.value === "sh" ? 3 : 2)));
var key = ch.join(",") + "/" + region.value;
if (key !== SLOTKEY) { SLOTKEY = key; buildSlots(ch); }
Object.keys(SLOTS).forEach(function (p) {
showDay(p, d);
[-2, -1, 1, 2].forEach(function (k) { // the neighbouring days, so stepping and scrubbing land on cached maps
var dd = DATES[i + k];
if (dd && SLOTS[p].dates.indexOf(dd) >= 0) warm(p, dd);
});
});
}
// ── the area chart: each dataset's departure from its own normal for the date, its 10th-90th band shaded ──────
function slot(iso) { // 0..365 on a 366-slot calendar (29 Feb = 59, 1 Mar = 60 in every year)
var y = +iso.slice(0, 4), m = +iso.slice(5, 7), dd = +iso.slice(8, 10);
var doy = Math.round((Date.UTC(y, m - 1, dd) - Date.UTC(y, 0, 1)) / 864e5);
var leap = (y % 4 === 0 && y % 100 !== 0) || y % 400 === 0;
return !leap && doy >= 59 ? doy + 1 : doy;
}
function drawChart() {
var box = document.getElementById("chart"), tip = document.getElementById("tip"), key = document.getElementById("chartkey");
[].slice.call(box.querySelectorAll("svg")).forEach(function (s) { s.remove(); });
var avail = ["ims", "era5", "snodas", "cdr"].filter(function (k) { return SER.datasets[k] && SER.datasets[k][region.value] && SER.bands[k]; });
var keys = avail.filter(function (k) { return !OFF[k]; });
tip.style.display = "none";
key.innerHTML = "";
avail.forEach(function (k) {
var b = document.createElement("button"), y = SER.years[k];
b.type = "button"; b.className = "kb"; b.setAttribute("aria-pressed", OFF[k] ? "false" : "true");
b.innerHTML = '<i style="background:' + LINE[k].colour + '"></i>' + LINE[k].name + " <small>normal " + y[0] + "–" + y[1] + "</small>";
b.addEventListener("click", function () { OFF[k] = !OFF[k]; drawChart(); });
key.appendChild(b);
});
if (avail.length) { var n = document.createElement("span"); n.className = "kn"; n.textContent = "Shading: each one’s 10th–90th percentiles; dots: days outside them."; key.appendChild(n); }
if (!keys.length) return;
var tEnd = -Infinity;
keys.forEach(function (k) { var d = SER.datasets[k].dates; tEnd = Math.max(tEnd, Date.parse(d[d.length - 1])); });
var tStart = tEnd - 150 * 864e5;
var lines = keys.map(function (k) {
var s = SER.datasets[k], b = SER.bands[k][region.value];
return { k: k, pts: s.dates.map(function (iso, i) {
var q = b[slot(iso)], v = s[region.value][i], t = Date.parse(iso);
if (!q || t < tStart) return null;
return { iso: iso, i: i, t: t, v: v, lo: (q[0] - q[1]) / 1e6, hi: (q[2] - q[1]) / 1e6, a: (v - q[1]) / 1e6, n: q[1] };
}).filter(Boolean) };
}).filter(function (L) { return L.pts.length; });
if (!lines.length) return;
var W = Math.max(320, box.clientWidth), H = Math.round(Math.min(420, Math.max(260, W * 0.36)));
var m = { l: 52, r: 14, t: 12, b: 30 }, t0 = Infinity, t1 = -Infinity, y0 = 0, y1 = 0;
lines.forEach(function (L) { L.pts.forEach(function (p) {
t0 = Math.min(t0, p.t); t1 = Math.max(t1, p.t);
y0 = Math.min(y0, p.a, p.lo); y1 = Math.max(y1, p.a, p.hi);
}); });
var pad = (y1 - y0) * 0.08 || 0.5; y0 -= pad; y1 += pad;
function X(t) { return m.l + (W - m.l - m.r) * (t - t0) / Math.max(1, t1 - t0); }
function Y(v) { return m.t + (H - m.t - m.b) * (y1 - v) / (y1 - y0); }
var ns = "http://www.w3.org/2000/svg", svg = document.createElementNS(ns, "svg");
svg.setAttribute("viewBox", "0 0 " + W + " " + H);
svg.setAttribute("role", "img");
svg.setAttribute("aria-label", "Snow-covered area against normal, " + region.options[region.selectedIndex].text);
function el(tag, at) { var e = document.createElementNS(ns, tag); for (var a in at) e.setAttribute(a, at[a]); svg.appendChild(e); return e; }
var step = Math.pow(10, Math.floor(Math.log10((y1 - y0) / 4))), ticks = [];
[1, 2, 5, 10].some(function (f) { if ((y1 - y0) / (step * f) <= 6) { step *= f; return true; } });
for (var v = Math.ceil(y0 / step) * step; v <= y1; v += step) ticks.push(+v.toFixed(6));
ticks.forEach(function (v) {
el("line", { x1: m.l, x2: W - m.r, y1: Y(v), y2: Y(v), stroke: v === 0 ? "#9a958c" : "#e4e2dc", "stroke-width": 1 });
el("text", { x: m.l - 6, y: Y(v) + 4, "text-anchor": "end", "font-size": 12, fill: "#6f6b64" }).textContent = (v > 0 ? "+" : "") + v.toLocaleString("en-GB", { maximumFractionDigits: 2 });
});
el("text", { x: 4, y: m.t + 4, "font-size": 12, fill: "#6f6b64", transform: "rotate(-90 4 " + (m.t + 4) + ")", "text-anchor": "end" }).textContent = "million km² against normal";
var mon = new Date(t0); mon = Date.UTC(mon.getUTCFullYear(), mon.getUTCMonth() + 1, 1);
for (; mon <= t1; mon = Date.UTC(new Date(mon).getUTCFullYear(), new Date(mon).getUTCMonth() + 1, 1)) {
el("line", { x1: X(mon), x2: X(mon), y1: H - m.b, y2: H - m.b + 4, stroke: "#9a958c" });
el("text", { x: X(mon) + 3, y: H - 8, "font-size": 12, fill: "#6f6b64" }).textContent = new Date(mon).toLocaleDateString("en-GB", { month: "short", timeZone: "UTC" });
}
lines.forEach(function (L) {
var c = LINE[L.k].colour;
el("path", { d: L.pts.map(function (p, i) { return (i ? "L" : "M") + X(p.t).toFixed(1) + " " + Y(p.hi).toFixed(1); }).join("") +
L.pts.slice().reverse().map(function (p) { return "L" + X(p.t).toFixed(1) + " " + Y(p.lo).toFixed(1); }).join("") + "Z", fill: c, "fill-opacity": 0.1, stroke: "none" });
});
lines.forEach(function (L) {
var c = LINE[L.k].colour;
el("path", { d: L.pts.map(function (p, i) { return (i ? "L" : "M") + X(p.t).toFixed(1) + " " + Y(p.a).toFixed(1); }).join(""), fill: "none", stroke: c, "stroke-width": 2, "stroke-linejoin": "round" });
L.pts.forEach(function (p) {
var out = p.a > p.hi || p.a < p.lo;
if (out || L.k === "cdr") el("circle", { cx: X(p.t), cy: Y(p.a), r: out ? 3 : 2.2, fill: out ? c : "#fff", stroke: c, "stroke-width": 1.4 });
});
});
var cross = el("line", { y1: m.t, y2: H - m.b, stroke: "#9a958c", "stroke-dasharray": "3 3", visibility: "hidden" });
var hit = el("rect", { x: m.l, y: m.t, width: W - m.l - m.r, height: H - m.t - m.b, fill: "transparent" });
function hide() { cross.setAttribute("visibility", "hidden"); tip.style.display = "none"; }
hit.addEventListener("pointermove", function (ev) {
var r = svg.getBoundingClientRect(), x = (ev.clientX - r.left) * W / r.width;
var t = t0 + (x - m.l) / (W - m.l - m.r) * (t1 - t0), rows = [], tx = null;
lines.forEach(function (L) {
var best = null; L.pts.forEach(function (p) { if (!best || Math.abs(p.t - t) < Math.abs(best.t - t)) best = p; });
if (!best || Math.abs(best.t - t) > (L.k === "cdr" ? 4 : 1.5) * 864e5) return;
if (!tx || Math.abs(best.t - t) < Math.abs(tx.t - t)) tx = best;
var where = best.a > best.hi ? ", above its usual range" : best.a < best.lo ? ", below its usual range" : "";
rows.push("<b>" + LINE[L.k].name + "</b> " + (best.v / 1e6).toFixed(2) + " million km² (normal " + (best.n / 1e6).toFixed(2) + where + ")" +
(L.k === "cdr" ? rank(best) : ""));
});
if (!tx) { hide(); return; }
cross.setAttribute("x1", X(tx.t)); cross.setAttribute("x2", X(tx.t)); cross.setAttribute("visibility", "visible");
tip.innerHTML = fmt(tx.iso.replace(/-/g, "")) + "<br>" + rows.join("<br>");
tip.style.display = "block";
var left = (X(tx.t) / W) * r.width + 12;
if (left + tip.offsetWidth > box.clientWidth) left -= tip.offsetWidth + 24;
tip.style.left = Math.max(0, left) + "px"; tip.style.top = "8px";
});
hit.addEventListener("pointerleave", hide);
box.insertBefore(svg, tip);
}
// the weekly record's rank for the week: each year's week nearest the same date, largest first
function rank(p) {
var s = SER.datasets.cdr, v = s[region.value], sl = slot(p.iso), best = {};
s.dates.forEach(function (iso, i) {
var d = Math.abs(slot(iso) - sl); d = Math.min(d, 366 - d);
var y = iso.slice(0, 4);
if (d <= 3 && (!best[y] || d < best[y].d)) best[y] = { d: d, v: v[i] };
});
var ys = Object.keys(best), above = ys.filter(function (y) { return best[y].v > p.v; }).length;
var n = above + 1, sfx = n % 10 === 1 && n % 100 !== 11 ? "st" : n % 10 === 2 && n % 100 !== 12 ? "nd" : n % 10 === 3 && n % 100 !== 13 ? "rd" : "th";
return "<br> " + n + sfx + " largest of " + ys.length + " years for the week (since " + ys.sort()[0] + ")";
}
function dates() {
var all = {};
Object.keys(MAN.products).forEach(function (p) { MAN.products[p].dates.forEach(function (d) { all[d] = 1; }); });
return Object.keys(all).sort();
}
function step(n) { slider.value = Math.max(0, Math.min(DATES.length - 1, +slider.value + n)); drawMaps(); writeHash(); }
function redraw() { drawMaps(); drawChart(); writeHash(); }
Promise.all([
fetch("/assets/snow/anim/snow_manifest.json", { cache: "no-cache" }).then(function (r) { return r.json(); }),
fetch("/assets/snow/snow_series.json", { cache: "no-cache" }).then(function (r) { return r.json(); })
]).then(function (res) {
MAN = res[0]; SER = res[1]; DATES = dates();
var want = readHash();
slider.max = Math.max(0, DATES.length - 1);
slider.value = DATES.indexOf(want) >= 0 ? DATES.indexOf(want) : DATES.length - 1;
document.getElementById("updated").textContent = "Updated " + MAN.updated.replace("T", " ") + ".";
sets.addEventListener("change", function () { drawMaps(); writeHash(); });
region.addEventListener("change", redraw);
slider.addEventListener("input", function () { drawMaps(); writeHash(); });
document.getElementById("prev").addEventListener("click", function () { step(-1); });
document.getElementById("next").addEventListener("click", function () { step(1); });
document.getElementById("latest").addEventListener("click", function () { step(DATES.length); });
var rt; window.addEventListener("resize", function () { clearTimeout(rt); rt = setTimeout(drawChart, 150); });
window.addEventListener("hashchange", function () { // a link edited or pasted in place (writeHash itself fires none)
var w = DATES.indexOf(readHash());
slider.value = w >= 0 ? w : DATES.length - 1;
redraw();
});
redraw();
}).catch(function () {
maps.innerHTML = '<div class="gap">The snow maps could not be loaded. Try again shortly.</div>';
});
})();
</script>
<!-- sf:start -->
<footer class="sf">
<div class="sf-in">
<div class="sf-group">
<p class="sf-h" role="heading" aria-level="2">This site</p>
<ul>
<li><a href="/">Home</a></li>
<li><a href="/topics/">Explainers</a></li>
<li><a href="/guides/">Methods</a></li>
<li><a href="/stats.html">Visitor stats</a></li>
</ul>
<p class="sf-disclaimer">This data has not been checked for accuracy, may not update reliably and should not be used operationally.</p>
</div>
<div class="sf-group sf-group--me">
<p class="sf-h" role="heading" aria-level="2">Shawn Corvec</p>
<ul>
<li><a href="/about.html">About</a></li>
<li><a href="/resume.html">Resume</a></li>
<li><a href="/research.html">Publications</a></li>
<li><a href="https://github.com/scorvec" rel="noopener">GitHub</a></li>
<li><a href="https://www.linkedin.com/in/shawn-corvec-35895b231/" rel="noopener">LinkedIn</a></li>
<li><a href="https://scholar.google.com/citations?user=EYLRCJIAAAAJ&hl=en" rel="noopener">Google Scholar</a></li>
</ul>
</div>
</div>
</footer>
<!-- sf:end -->
</body>
</html>