#!/usr/bin/env python3 """Fetch every input of the florida-aurora-cycle-25 check into /downloads/, under the plain client name. python3 -I fetch_inputs.py Then run the other scripts with /downloads (see the page's "Repeat our numbers" section). Standard library only. What is fetched, and on what terms: - S0 News research note 004: its text export and the nine CSVs of its public data folder. They carry no licence, so they are fetched here by URL and never hosted with the page. They are data: parsed, never run. - GFZ's Kp since 1932 (Matzka et al. 2021, doi:10.5880/Kp.0001), CC BY 4.0. The file grows daily. - WDC for Geomagnetism, Kyoto: 89 monthly pages of the hourly Dst index (doi:10.17593/14515-74000), final or provisional only. Scientific, non-commercial use, with acknowledgement of the WDC and of the observatories that supply its data. The WDC asks to be contacted before its real-time values are published: this script fetches no real-time page, and refuses to save one. Kyoto makes provisional months final over time; a provisional address that has moved is reported, and the script goes on. - gufm1, IGRF-14 and COV-OBS.x2 coefficient files, and WDC-SILSO's table of cycle minima (CC BY-NC 4.0). Each file is compared with the copy we used on 11 November 2026, by SHA-256, and the script says where it differs. It stops at the first refusal (HTTP 403 or 429) and never retries another way. Kyoto's pages are fetched two seconds apart. """ import hashlib import sys import time import urllib.error import urllib.request from pathlib import Path UA = "factchecked-research/1.0" DRIVE = "https://drive.google.com/uc?export=download&id=" KYOTO = "https://wdc.kugi.kyoto-u.ac.jp/dst_%s/%s/index.html" # (relative path, URL, SHA-256 of the copy we used on 2026-11-11) FILES = [ ("s0-note-004/export.txt", "https://docs.google.com/document/d/1GU__W2gV3yRmol6Vi7WhsPqimoMHHkupGyUhTULJ6-Y/export?format=txt", "bd540a53ba5a86a7d06fe60f78c66b39e0ea22b78af1cab6c5d625e99fd0388f"), ("s0-note-004-drive/PathA_events.csv", DRIVE + "1yhYoo9UKEMfFUkk4XN8VHnD_OcKWjouf", "dbb278fea1576bd243062c70e8c892c0920d658ed79b77892e5cf01b05d5002f"), ("s0-note-004-drive/PathB_events.csv", DRIVE + "1W7SxJM7BxEn0g9cug2POizOLqKMox5Qq", "fdf8768ff153f3d903b2b946612203ed1fa388d65f09272452c0e595748e8acb"), ("s0-note-004-drive/Storms_all_strata_24h.csv", DRIVE + "1uwQA31l9dTYb2Fud5XeQwJAjxCtdbw1x", "8a76ffe63a073e39145530bae54f76fe35cdb931db7e21c1ff2420f9b859654b"), ("s0-note-004-drive/Storms_all_strata_48h.csv", DRIVE + "1ltPkCTgaoNRzVeiIp25pmQncrXxkMKC-", "f42ea5fcb9bfd667df04d0351f40cc01e812ab66d21ce623c0aefd8dc2fb12fb"), ("s0-note-004-drive/Storms_Kp9minus_24h.csv", DRIVE + "17b6D8gZoNJvlMRme4eoROwGSCBH1tXtO", "8a76ffe63a073e39145530bae54f76fe35cdb931db7e21c1ff2420f9b859654b"), ("s0-note-004-drive/TABLE1_rates.csv", DRIVE + "1_8QauP4eViVsn8JM-zlFbaJCrgZ8yJbo", "1c1f82bb5e8f651ca89a388f3c372982641a0e421f8541660e6d206387cfacbc"), ("s0-note-004-drive/TABLE2_fisher.csv", DRIVE + "1yakNqzvkK-IbXGqDEYjNlNa2fRyevNcY", "8afafdb79a0ad24bd5ab8644a4b9768f2862ebd458384f563a5e84612b00d86c"), ("s0-note-004-drive/TABLE2_fisher_full.csv", DRIVE + "1X9wU07cTfrc6rvFcuoPTWty1CjmE_JGI", "1979952535bdf7a96d6dc0fe6eb45585747a2cb3c74a667b0236a3b177dbe417"), ("s0-note-004-drive/TABLE_lambda_by_cycle.csv", DRIVE + "1GXzPzTmFtztl3MnkcTyOWZT4XPbad4Ak", "9f915eb38e88b59eaf2bcf80c557d0788f561217c032798dc6e53e36a20a958a"), ("gfz-kp/Kp_ap_Ap_SN_F107_since_1932.txt", "https://kp.gfz.de/app/files/Kp_ap_Ap_SN_F107_since_1932.txt", "dd30b260d0c36c3efaf8149e5d4313794b362bfe8b568ad5360644260409cfac"), ("field-models/gufm1.txt", "https://geomag.colorado.edu/images/GUFM/gufm1.txt", "135716e3962947dcb41e107f36d8bb3d4633902602107ee8c4ef583fcd6670b1"), ("field-models/igrf14coeffs.txt", "https://www.ngdc.noaa.gov/IAGA/vmod/coeffs/igrf14coeffs.txt", "8f8d88403028fc4ee92c4f38d97b46e0a87e2cfc496045b43c9e26c1d6b0903c"), ("field-models/COV-OBS.x2-int", "https://www.spacecenter.dk/files/magnetic-models/COV-OBSx2/COV-OBS.x2-int", "6c588becf4e3896b07be80c3f24697d299432120a7f4ab1139a914395f9d2a17"), ("silso/cyclesminmax.html", "https://www.sidc.be/SILSO/cyclesminmax", "7bf61f7bcb9dc709fda9ec2f28c885eb9ff3642783103feb3284dd9a8b270038"), ] # Kyoto's monthly pages as we read them: kind, YYYYMM, SHA-256. Every month from 1986 with a three-hour Kp of 8- or # more, its neighbours, and the months of the events before 1986. Final to 2020-12, provisional 2021-01 to 2026-09. KYOTO_MONTHS = """ final 195802 f30dd4cc0ce83033bad831f761ef886a02c591e373750a7ebdad5ffd5936e490 final 195911 0618b44b91a77ff438cc5a2aaaa945a9fd1d360775692f6d91bb8d6da9a6e307 final 196903 def2db46c7a8e5876d7b93486df104448ee02d7433e5d393e1e99515a9831e73 final 198103 e568715700e7c4399bfe50fc0af8bd44c25400732b7e5de34e7d33493fe5f576 final 198104 ebcc30caaaf009426364ebb1a2248d8d7853f66fb307fa6bc183996a6b46e5d5 final 198209 b7999ddf5f001c0cbfcb2fe277036670b9e474268b4341b5edfafe2858715d29 final 198602 c2759428c7b39f0b3fa7d686ef7029cf502c69d2f332945c74016f38e9a40ae8 final 198609 004a639f83dc35f322e222a1b10f816046241427a0f988d08f688662dff8c0c9 final 198803 7d8ac9676f3235ed5edc636b2382a508b830a8213a42404c58d0981f290263d1 final 198804 c0370464f2ae647a96be4043bc3415359a588f8a6bec1bd36226a6bed7d8a948 final 198810 8a7ba2c0c17a1d3e5779834e2bbc928a4ae270cfaa0cd0b723a53bc36cf58fa5 final 198903 f364bec949515140bfaa4e4c27b1fda10298be06bd5948b8607147b0e6d2e835 final 198909 cf2b7a2207146da71941d51d9e1e7235e94ec68c3303721383cd42355f25b0c1 final 198910 549267c462b844443cb837be1f2e2b9ec9ce2502cc235ef4cb86906b51e72f2a final 198911 82669b862a16abea1d357500e0ca0f0a30de275cfaa47cd4562397f64b4feff3 final 199003 070e620c2a45e985b55ad8689c71568ad82bd1262da89434a984a9d8f0651e9f final 199004 b9ebf122e16d5766a79f8cd06a179d8460794e7bad5a30eca00006f2553ee043 final 199006 9ae74ab334f2354412c19c38e9f82300b1c9449f4a1712c1e4c7bf2bf16e97a2 final 199007 eea377c1898fd66e705268f9e6084117aecfa65defc0723d823d8366106340f0 final 199103 e67d53741f2fc9936f5ed79a725da9ba97904b62b788f1e61e30ff2d879107dc final 199106 f093178e168d46fe68c670fa733feed00523b2468c4f4422a1877389d1b81308 final 199107 311e57e9e095d582892e2b97dab3676e7546c425abf2cfc9e9c81c1e5a211dca final 199108 59a7b540b6aae3bbe194faabf475369242e329c21bc6b1543635f16b03aaec3e final 199110 251802c771a58c8c0768c5b2a5b177a579baa4064436f2d48890f7388af80225 final 199111 82e26d6f6913e1f6883acba4d5fdad5b4da80948c9212154464fc92f485659ec final 199201 b5ac22dc2dffb9860091d7d02c59398af2c9a3c270df4ead887405dfa73fd167 final 199202 b9c58e1ca00f77cec1e02b3e333f5cacfded3177a14a7d159826e406651567ec final 199205 399a57a5e8bcd3cefea38af8bcd75c4aeabb4aeab2e6e3da4babd60b38816e49 final 199208 672be8ba8cbcc30e15d8fdce77db1fc030ea95fda091e3b1173c5f0eaab958c8 final 199304 cf112e5b67c79f2b69800863bb262c5696f540b82d45d42b3f2d925d0f51b993 final 199309 3efef66e0c0e4e72f4ac313866ec5e41ae2d5ea78a01cf9402b6a114220a3162 final 199402 0fe833c2e898616ee4f83855c1bfb379255beb8be820540262252e39b9f88d99 final 199404 97245c6a8deba42d709f0869f00c0fb5575f02c795304ea5d89f05fbc23ecba8 final 199504 e5b5dfd3bfc79db0206123398f42ae2e1812ee5cb7b1c8f5e2f5ab039882a3cb final 199805 a3e307c9d92162fc8c79dbc3e49cc3898d1af430156b1c434690a4ddbe728362 final 199808 55c70fc718ce7a38c8d971bcc98c4ee24593d602768c2cc874542076989cda61 final 199809 1b5f9f2fac27956092dc08414ee9869b2f562b592cbdc5125566513892f7eca9 final 199811 181e92c6adcaa6eac26c08f721cd7e2dfcb5f58fa17249f62c9726cceac53433 final 199907 505e577e5bed4171e31ce34fe284a0e36f4eb53ad27c29560fbc64788a4eb659 final 199908 3b53c6076dc82d4a330e69069fcc6a382d1c96e4fb7bfb660ef182d3fffd6d2b final 199909 78de6c2f7ca20d1abefd74e0e6605d847945063d5e2fcb74a23329e339f64106 final 199910 1c6308ac3d95193efd47a3e5ed3209eb7de8e42ab3d41d832c137748c901ac9f final 200004 92b2aefd00747596c5df03955fd8f40b24e021483329b8722f429df744b1db0e final 200005 73b4268b51c08a1c97f427c3e5d9b30405e65540de6e0e395bd5e8ccb2992f5c final 200007 d15ce8cd2100821f46023bbd0294419b9edb902f8b8d09ebfd194b5b2fb7d478 final 200008 edb887117990b76315354c1c5f4f5a3fa040f85a74b6bf759dca6b17743657dd final 200009 644cc91d43e46d9ce4be3e6b9d5fb551cb936b1fc7581280fd26729def14e1ab final 200010 1f70a5891bcb8261d6ad054d2d1b6193f244b95328c231cc5a81162ae27c356e final 200103 d9f0f526f0778a5dad0d501f8b289587d4eef31ae047fc8ba727cc38953c2e8f final 200104 f816ec16bb04229fcf65f7a49e0e297b06785349f55c5054b7fd16636ec8b0ae final 200110 401757d60505232131aec929ffbe8ca5e1d0ea84f8da7f202e2d1832a623cc6a final 200111 e8fd085c95ef868439dbd48819ed2bfc494fcdd547d7c0aebff643e4a9b768e9 final 200205 a91830b71c58d69015af695a7c0d66942e6a8ede5db6440169cd429b6894e2c1 final 200305 8c7e757025b05de2beacb51c67e97b35d5c167390d6e668cf43b52263cb66f10 final 200306 d67315f4fc0302da1e3e28094fa328daa698511eb3ce9863452731a38d5191ba final 200310 29c28fdeca81163098fe9f09c8286c3eece961acf942f29db155d5cb28acd0bb final 200311 7e1f7fdd7bcb53c802f9f2358f78a6446b6740b6f06143e585dcc1cd380e0ebb final 200407 f3d34f0a95b333429dc8c77ffb5be61ce8442613f0550f04d9d32b2ce4a1c535 final 200411 41e27ac88596a8ba2207665c14fa4c8fbafb83385fd7ae53939fd78f9b0732dd final 200501 54c913852839d5a2eae79dab1cb4a06e2aed4b0d8490571dc2315e3cadb1e26b final 200505 fc580a6dd9b6e5247fcb2c8848f67fbbf5ef9402973e6d4ca87c1f29bddc4736 final 200506 8d37773726e5853675e8f3e61a7e07ddbd268e8a6be5482a5c0146d7af3c6079 final 200508 423856da7bcac1d7b60b157d050027dc8a1c6fc238cf266a4ad38fffaf3a3d8a final 200509 8e1edeee8c089beb5a01f7e2f2d95a396b62603b89fdc20df5b00fb453f149d0 final 200612 f2042a2c5fb76993a1c20ef637ed6b23da8ecfa510b8b25210f4c081db36f821 final 201004 4389de83549ea2998f7bc1096118beb36a43a2e5d377016bbd2a236d6a9566ae final 201108 01fc90aef594bea7d87fcb1395b558ef19e6389cf984c31b2ceaf81c71e96c1b final 201203 7adcceec7157a2fdbbd9145c534921254fdf6cc7adc3bbcfc44463e0e16f74b2 final 201309 3cb678fca5b54335919f18fd17871d67de16f6a46cf2ec8a8d2897392bff9280 final 201310 d582b3b7c3c8efadb0ffd4cb101021a6498b49e84b33ea9217fc7855f7da19c5 final 201503 ce59c3be06dd17fda06006a1483b87ca45b283d078a326227b38aa0deb3c88ff final 201506 d994447121ea45e29736cdde2f087c711f9faa19d54ad178d3ce1898927defa2 final 201709 bac66c0aac475dc8053f5fa78a7ac8aeb8b9d42b7d782de50682e3677ac9c816 provisional 202111 4fcb428bd2139bbdd97a7eae895fd0a29e569681a1de22cf02ad883055c18729 provisional 202303 5dd6946a63c1127b3c6823d88bdf7c0cfae7edaabee95fb5c1d2c62f20370f7b provisional 202304 fa946f2a9b10dbcfbb5ad8aa12e4e351d8c30b118569b3eef60d2a606d45d685 provisional 202403 0ee262e2ae5120158fe1918946f84ad3b8dfa5adaaa83c7be89da10480e24ec8 provisional 202405 47ea880fd9497dfade52e9dca44388e9a6473bc264075083009907d06a11ef36 provisional 202406 2bf12c68dfaa5de93991c49288803afafd33ccd979eb8087f0b0ec527882c7a1 provisional 202407 012a65091714586157c95963f6da8e0151b5d46a1148681802999c159b5e51ee provisional 202408 1ef1e33968e3df58fa578561ec1e3f768058bd486c55cbc9810f941f1e556d91 provisional 202410 0d990a406a6a05b30b14df71b71c99069d40803dca0416a30190b98029b0acaa provisional 202412 74566f56f9fdfeedb438fc2229e1f2738de1f4af54fe33231646620fdd294f2d provisional 202501 e8802a439bcbea3434e7689bb0a0e9c17d53e04ef46e6fe51fa3b609187c038a provisional 202504 0fec80e68ca9a36efedc9a3ee4e631d1b17d9bb2eb2f26aa48a8cc6292f910dd provisional 202505 5a6992bbd08f3743b7af32d3dd9a559321ee669cf3a6c62ec209e0326261c28f provisional 202506 c1d5dc1e79c9b963956e504ca320b930a4b55c122eb32b72adbbe22d1d7b9507 provisional 202511 2e4383a43716bf8f24fba3ceaa2ce61d8e581b83b7f8b8f6cbbc308528041035 provisional 202601 1c5360ef2fc2cacdcae87afda59a12d76f031051ebd9e9c85da35d5c5277ea6d """ def fetch(url): req = urllib.request.Request(url, headers={"User-Agent": UA}) try: with urllib.request.urlopen(req, timeout=180) as r: return r.read() except urllib.error.HTTPError as e: if e.code in (403, 429): sys.exit(f"Refused ({e.code}) at {url}: stopping, as the page's rules ask. Nothing was retried.") if e.code == 404: return None raise def save(base, rel, data): out = base / rel out.parent.mkdir(parents=True, exist_ok=True) out.write_bytes(data) def main(): if len(sys.argv) != 2: sys.exit(__doc__) base = Path(sys.argv[1]) / "downloads" same = changed = 0 for rel, url, ours in FILES: data = fetch(url) if data is None: print(f"{rel:46s} not found at {url}") continue save(base, rel, data) h = hashlib.sha256(data).hexdigest() ok = h == ours same, changed = same + ok, changed + (not ok) print(f"{rel:46s} {len(data):>9,} bytes {h[:12]} {'same as ours' if ok else 'differs from ours (expected for files that update)'}") for line in KYOTO_MONTHS.split("\n"): if not line.strip(): continue kind, ym, ours = line.split() rel = f"kyoto-dst/dst_{kind}_{ym}.html" data = fetch(KYOTO % (kind, ym)) time.sleep(2) if data is None: print(f"{rel:46s} not at its {kind} address any more: Kyoto has probably made the month final; fetch dst_final/{ym} by hand") continue text = data.decode("utf-8", "replace").upper() if "REAL-TIME" in text or "QUICKLOOK" in text or ("(FINAL)" not in text and "(PROVISIONAL)" not in text): print(f"{rel:46s} is not marked final or provisional: not saved") continue save(base, rel, data) h = hashlib.sha256(data).hexdigest() ok = h == ours same, changed = same + ok, changed + (not ok) print(f"{rel:46s} {len(data):>9,} bytes {h[:12]} {'same as ours' if ok else 'differs from ours'}") print(f"Done: {same} files the same as ours, {changed} different. Next: reproduce_note.py, storm_lists.py, geometry.py, " "figure3.py, baseline_tests.py and charts.py, each with the downloads folder (see each script's first lines).") if __name__ == "__main__": main()