#!/usr/bin/env python3 """Recompute the numbers marked "Our analysis" on factchecked.science/mars-hcl-volcanism/. Standard library only. Everything except the marsquake check uses numbers printed in the paper, Trokhimovskiy et al. (2026), Science Advances 12, eaeb9422, CC BY 4.0, which are copied below with their locators, plus a few published constants: 1. the eight detections of Table S1: Earth dates from their solar longitudes, distances from Alba Mons's centre, and the latitude-longitude box they span; and the solar longitudes of June to August 2025, our reading of the paper's "terrestrial summer 2025" for Mars year 38; 2. the size of the source: the paper's own budget (pp. 3-5) re-run, and how it scales with the HCl lifetime; 3. the SO2 that Earth-like volcanic gas would carry with the paper's HCl, beside ACS's 20-ppbv SO2 limit; 4. with --fetch-mqs only: the InSight Marsquake Service catalogue V14 (doi:10.12686/a21), fetched by URL under a plain client name, checked against the SHA-256 of the copy we used, and searched for located events near Alba Mons; it also gives the catalogue's largest event distance from InSight. Section 3's word counts are not recomputed here: they come from a search of the paper's and supplement's text. Usage: python3 mars_hcl_numbers.py [--fetch-mqs] [out.json] (default: mars_hcl_numbers.json next to this file) """ import datetime as dt import hashlib import json import math import re import sys import urllib.request import xml.etree.ElementTree as ET from pathlib import Path R_MARS = 3389.5 # km, sphere used for distances ALBA = (41.08, 249.29) # Alba Mons centre, USGS Gazetteer of Planetary Nomenclature, feature 14306 (N, E) SOL = 88775.244 # s M_HCL, M_SO2, M_AIR = 36.461, 64.066, 43.34 # g/mol; air is CO2-dominated G = 3.711 # m/s^2 # Table S1 of the paper (SM p. 15): latitude and longitude at a tangent altitude of 10 km, surface elevation of the # sub-detection site (km, relative to the areoid) and local time (h). Longitudes are east-positive (west negative). TABLE_S1 = [ # n, orbit, Ls, MY, lat, lon, elevation_km, local_time_h (1, 8886, 109.45, 35, 65.83, -117.05, -3.7, 23.23), (2, 9034, 115.01, 35, 45.71, -97.45, -0.3, 19.68), (3, 25615, 107.56, 37, 55.45, -99.77, -1.4, 3.3), (4, 25652, 108.94, 37, 61.96, -96.69, -3.2, 2.27), (5, 25689, 110.32, 37, 65.59, -96.55, -3.6, 1.03), (6, 25701, 110.77, 37, 66.19, -87.25, -3.9, 0.6), (7, 25887, 117.79, 37, 48.31, -96.44, -0.4, 19.8), (8, 25912, 118.75, 37, 43.04, -99.12, 0.2, 19.47), ] def gc_km(a, b): p1, l1, p2, l2 = map(math.radians, (a[0], a[1], b[0], b[1])) c = math.sin(p1) * math.sin(p2) + math.cos(p1) * math.cos(p2) * math.cos(l2 - l1) return R_MARS * math.acos(max(-1.0, min(1.0, c))) def ls_of_jd(jd_tt): """Mars solar longitude, Allison & McEwen (2000), Planet. Space Sci. 48, 215, as in NASA GISS Mars24.""" d = jd_tt - 2451545.0 m = math.radians(19.3871 + 0.52402073 * d) a_fms = 270.3871 + 0.524038496 * d amp = [0.0071, 0.0057, 0.0039, 0.0037, 0.0021, 0.0020, 0.0018] tau = [2.2353, 2.7543, 1.1177, 15.7866, 2.1354, 2.4694, 32.8493] phi = [49.409, 168.173, 191.837, 21.736, 15.704, 95.528, 49.095] pbs = sum(amp[i] * math.cos(math.radians(0.985626 * d / tau[i] + phi[i])) for i in range(7)) v_m = ((10.691 + 3.0e-7 * d) * math.sin(m) + 0.623 * math.sin(2 * m) + 0.050 * math.sin(3 * m) + 0.005 * math.sin(4 * m) + 0.0005 * math.sin(5 * m) + pbs) return (a_fms + v_m) % 360.0 def jd_tt(t): return t.timestamp() / 86400.0 + 2440587.5 + 69.184 / 86400.0 def date_at(ls, start): t = start while ls_of_jd(jd_tt(t)) < ls: t += dt.timedelta(minutes=30) return t.strftime('%Y-%m-%d') def detections(): starts = {35: dt.datetime(2019, 9, 1, tzinfo=dt.timezone.utc), 37: dt.datetime(2023, 6, 1, tzinfo=dt.timezone.utc)} rows = [] for n, orbit, ls, my, lat, lon, elev, lt in TABLE_S1: rows.append(dict(n=n, orbit=orbit, MY=my, Ls=ls, date_utc=date_at(ls, starts[my]), lat=lat, lon=lon, elevation_km=elev, local_time_h=lt, km_from_alba_centre=round(gc_km((lat, lon % 360), ALBA)))) lats = [r['lat'] for r in rows] lons = [r['lon'] for r in rows] box = R_MARS ** 2 * math.radians(max(lons) - min(lons)) * (math.sin(math.radians(max(lats))) - math.sin(math.radians(min(lats)))) season = {f'MY{my} Ls {ls}': date_at(ls, start) for my, ls, start in ( (36, 107, dt.datetime(2021, 8, 1, tzinfo=dt.timezone.utc)), (36, 113, dt.datetime(2021, 8, 1, tzinfo=dt.timezone.utc)), (35, 100, dt.datetime(2019, 9, 1, tzinfo=dt.timezone.utc)), (35, 120, dt.datetime(2019, 9, 1, tzinfo=dt.timezone.utc)), (37, 100, dt.datetime(2023, 6, 1, tzinfo=dt.timezone.utc)), (37, 120, dt.datetime(2023, 6, 1, tzinfo=dt.timezone.utc)))} return dict(rows=rows, lat_range=[min(lats), max(lats)], lon_range=[min(lons), max(lons)], box_km2=round(box), km_from_alba_range=[min(r['km_from_alba_centre'] for r in rows), max(r['km_from_alba_centre'] for r in rows)], elevation_range_km=[min(r['elevation_km'] for r in rows), max(r['elevation_km'] for r in rows)], season_dates_utc=season, my38_terrestrial_summer_2025_ls=summer_2025()) def summer_2025(): """The paper dates its Mars-year-38 detections only to "terrestrial summer 2025" (p. 2). Read as 1 June to 31 August 2025 (UTC), that is the span from the Ls of 1 June to the Ls of 1 September, drawn on our timeline.""" return {d: round(ls_of_jd(jd_tt(dt.datetime(*map(int, d.split('-')), tzinfo=dt.timezone.utc))), 2) for d in ('2025-06-01', '2025-09-01')} def budget(): """The paper's budget (pp. 3-5) with its own inputs, and the same with other lifetimes.""" m_atm = 2.5e16 # kg, the paper's figure (pp. 3, 5) hcl = {'molar': 1e-9 * (M_HCL / M_AIR) * 0.01 * m_atm, 'as_mass_fraction': 1e-9 * 0.01 * m_atm} # ~1 ppbv in 1% taus = {'1 h': 3600, '6 h': 6 * 3600, '24 h': 86400, '1 sol': SOL, '3 sols': 3 * SOL, '10 days': 864000} grid = {k: {how: round(m / t, 3) for how, m in hcl.items()} for k, t in taus.items()} peri = {'molar': 5e-9 * (M_HCL / M_AIR) * 0.25 * m_atm, 'as_mass_fraction': 5e-9 * 0.25 * m_atm} # 5 ppbv in 25% col_kg_per_km2 = 600 / G * 1e6 # full column at 600 Pa area_full = 0.01 * m_atm / col_kg_per_km2 h = 8.314462 * 210 / (M_AIR / 1000 * G) area_low10 = area_full / (1 - math.exp(-10000 / h)) arc_cl_mol_per_yr = 1.54e11 # Fischer (2008), Geochem. J. 42, 21, Table 4: global arc Cl flux return dict( aphelion_hcl_mass_kg={k: round(v) for k, v in hcl.items()}, aphelion_rate_kg_s_by_lifetime=grid, perihelion_hcl_mass_kg={k: round(v) for k, v in peri.items()}, perihelion_rate_kg_s_at_2_sols={k: round(v / (2 * SOL), 1) for k, v in peri.items()}, perihelion_lifetime_sols_implied_by_180_kg_s={k: round(v / 180 / SOL, 2) for k, v in peri.items()}, area_km2_one_percent_of_atmosphere={'full columns at 600 Pa': round(area_full), 'lowest 10 km only': round(area_low10)}, earth_arc_hcl_kg_s=round(arc_cl_mol_per_yr * M_HCL / 1000 / (365.25 * 86400), 1)) def so2_for_hcl(): """SO2 carried with the paper's HCl at Earth-like ratios, beside ACS's best 1-sigma limit of 20 ppbv.""" out = {} pm = (0.1 * M_SO2 / M_HCL, 0.9 * M_SO2 / M_HCL) # HCl/SO2 mass 0.1-0.9 (Pyle & Mather 2009, as cited by Braude et al. 2022) -> molar for q in (1.0, 1.5): # ~1 ppbv (p. 4) and the 1.5-ppbv maximum (p. 2) out[f'{q} ppbv HCl'] = { 'Pyle & Mather ratios': [round(q / pm[1], 2), round(q / pm[0], 2)], 'SO2 5-10 x HCl (Olsen et al. 2024b, sec. 3.2)': [5 * q, 10 * q], 'global arc ratio, molar HCl/SO2 0.49 (Fischer 2008, Table 4)': round(q / (1.54e11 / 3.15e11), 2), "the paper's own case, 1-4 x (SM p. 13)": [1 * q, 4 * q]} out['ACS best 1-sigma SO2 limit, ppbv (Braude et al. 2022)'] = 20 return out MQS_URL = 'https://www.seis-insight.eu/static/mqs-catalogs/v14/events_extended_multiorigin_v14_2023-01-01.xml' MQS_SHA256 = '06b1af486bb912ac8b6e0af57c442433ddb20b065267d5a39c2509f09072c1ba' def marsquakes(): req = urllib.request.Request(MQS_URL, headers={'User-Agent': 'factchecked-research/1.0'}) raw = urllib.request.urlopen(req, timeout=300).read() sha = hashlib.sha256(raw).hexdigest() if re.search(rb'