#!/usr/bin/env python3 """Addenda G5 and G6 of RULES_photo_geometry.txt: the direction test of /march-2023-storm/ put to two more photographs, the one over Rosemary Hill Observatory, Florida, in the storm of 6-7 April 2000, and the ones from near Key West on 20 January 2026. Fact-Checked Science, "Our analysis". Standard library only. Run: python3 -I -X utf8 photo_geometry_others.py RULES_photo_geometry.txt DOWNLOADS_FOLDER CHAOS_SPLINE_FILE OUT_FOLDER DOWNLOADS_FOLDER holds horizons_2000_/horizons_.txt for moon, mars, jupiter and saturn: JPL Horizons' positions for the site, 6-7 April 2000 (apparent azimuth and elevation without refraction, every ten minutes). It writes OUT_FOLDER/photo_geometry_others.json and .log, with the SHA-256 of the rules and inputs. The photograph itself is not an input. The pixel positions below were measured once from the copy named in POINTS_FROM (centroids of the bright points that stand out from a smoothed background); the photograph is someone else's and is read, not hosted. The helpers come from photo_geometry.py and chaos_reader.py, beside this file. """ import datetime as dt import hashlib import json import math import os import sys HERE = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, HERE) import chaos_reader as FL # noqa: E402 (our own module, same folder) import photo_geometry as PG # noqa: E402 (our own module, same folder) rad, deg = math.radians, math.degrees R = PG.R # ---------------------------------------------------------------------------------------------- G5 inputs SITE_2000 = ("Rosemary Hill Observatory", 29.40, -82.59) # as aurora_numbers.py of /s0-news-2026-11-01/ has it EPOCH_2000 = 2000.26 EDGES_2000 = [("a", 48.8, "Love et al.'s model at -292 nT, as /s0-news-2026-11-01/ hosts it"), ("b", 52.1, "the satellite edge of Love et al.'s Table 2 for this storm (6 April 2000, 297 nT)"), ("c", 40.0, "the lowest satellite edge in that table for another storm of 250-350 nT (9 February 1986, 276 nT)")] HEIGHTS = (250, 400, 500, 950) POINTS_FROM = ("reyes1.jpg, 636 x 436 pixels, SHA-256 cadac984066def9e3455e7e65c881d8fc37a81ca6fec39828dc4c7a6ef6b5cb6, as archived by the " "Internet Archive from NASA's story of 25 April 2000 (science.nasa.gov/headlines/y2000/ast25apr_1m.htm)") IMAGE_W, IMAGE_H = 636, 436 # What the gallery entry of NASA's story says is in the frame: Mars, Jupiter, Saturn, the Moon and the Pleiades. # Pixel positions (x to the right, y down) of the points used; the first three fix the frame, the rest check it. MOON_PX = (21.0, 321.9) SATURN_PX = (76.6, 316.4) ALCYONE_PX = (166.1, 51.9) LOW_PLANET_PX = (108.1, 419.2) # Jupiter or Mars, a degree apart, low at the left OTHER_POINTS = [(69.1, 74.2), (313.6, 21.3), (345.2, 19.6), (459.0, 18.0), (533.5, 37.9), (574.2, 65.6), (632.0, 44.5), (479.2, 95.4), (506.4, 96.7), (473.4, 121.0), (496.0, 136.4), (597.0, 148.5), (487.0, 171.0), (528.2, 186.3), (628.1, 287.5), (163.4, 45.3), (164.9, 57.6), (173.8, 57.8), (169.5, 62.4), (182.0, 57.5), (153.0, 51.5)] # J2000 right ascension (hours) and declination (degrees) of the stars tried against those points STARS = { "Alcyone": (3 + 47 / 60 + 29.1 / 3600, 24 + 6 / 60 + 18 / 3600), "Atlas": (3 + 49 / 60 + 9.7 / 3600, 24 + 3 / 60 + 12 / 3600), "Electra": (3 + 44 / 60 + 52.5 / 3600, 24 + 6 / 60 + 48 / 3600), "Maia": (3 + 45 / 60 + 49.6 / 3600, 24 + 22 / 60 + 4 / 3600), "Merope": (3 + 46 / 60 + 19.6 / 3600, 23 + 56 / 60 + 54 / 3600), "Taygeta": (3 + 45 / 60 + 12.5 / 3600, 24 + 28 / 60 + 2 / 3600), "Pleione": (3 + 49 / 60 + 11.2 / 3600, 24 + 8 / 60 + 12 / 3600), "Mirfak": (3 + 24 / 60 + 19.4 / 3600, 49 + 51 / 60 + 40 / 3600), "Algol": (3 + 8 / 60 + 10.1 / 3600, 40 + 57 / 60 + 20 / 3600), "zeta Per": (3 + 54 / 60 + 7.9 / 3600, 31 + 53 / 60 + 1 / 3600), "epsilon Per": (3 + 57 / 60 + 51.2 / 3600, 40 + 0 / 60 + 37 / 3600), "gamma Per": (3 + 4 / 60 + 47.8 / 3600, 53 + 30 / 60 + 23 / 3600), "delta Per": (3 + 42 / 60 + 55.5 / 3600, 47 + 47 / 60 + 15 / 3600), "rho Per": (3 + 5 / 60 + 10.6 / 3600, 38 + 50 / 60 + 25 / 3600), "nu Per": (3 + 45 / 60 + 11.6 / 3600, 42 + 34 / 60 + 43 / 3600), "kappa Per": (3 + 9 / 60 + 29.8 / 3600, 44 + 51 / 60 + 27 / 3600), "omicron Per": (3 + 44 / 60 + 19.1 / 3600, 32 + 17 / 60 + 18 / 3600), "xi Per": (3 + 58 / 60 + 57.9 / 3600, 35 + 47 / 60 + 28 / 3600), "iota Per": (3 + 9 / 60 + 4.0 / 3600, 49 + 36 / 60 + 48 / 3600), "theta Per": (2 + 44 / 60 + 11.9 / 3600, 49 + 13 / 60 + 43 / 3600), "16 Per": (2 + 50 / 60 + 35.1 / 3600, 38 + 19 / 60 + 7 / 3600), "tau Per": (2 + 54 / 60 + 15.5 / 3600, 52 + 45 / 60 + 45 / 3600), "eta Per": (2 + 50 / 60 + 41.8 / 3600, 55 + 53 / 60 + 44 / 3600), "Hamal": (2 + 7 / 60 + 10.4 / 3600, 23 + 27 / 60 + 45 / 3600), "Sheratan": (1 + 54 / 60 + 38.4 / 3600, 20 + 48 / 60 + 29 / 3600), "41 Ari": (2 + 49 / 60 + 59.0 / 3600, 27 + 15 / 60 + 38 / 3600), "beta Tri": (2 + 9 / 60 + 32.6 / 3600, 34 + 59 / 60 + 14 / 3600), "alpha Tri": (1 + 53 / 60 + 4.9 / 3600, 29 + 34 / 60 + 44 / 3600), "gamma Tri": (2 + 17 / 60 + 18.9 / 3600, 33 + 50 / 60 + 50 / 3600), "Almach": (2 + 3 / 60 + 54.0 / 3600, 42 + 19 / 60 + 47 / 3600), "51 And": (1 + 37 / 60 + 59.6 / 3600, 48 + 37 / 60 + 42 / 3600), "Aldebaran": (4 + 35 / 60 + 55.2 / 3600, 16 + 30 / 60 + 33 / 3600), "epsilon Tau": (4 + 28 / 60 + 37.0 / 3600, 19 + 10 / 60 + 50 / 3600), "37 Tau": (4 + 4 / 60 + 41.7 / 3600, 22 + 4 / 60 + 55 / 3600), "lambda Tau": (4 + 0 / 60 + 40.8 / 3600, 12 + 29 / 60 + 25 / 3600), "Capella": (5 + 16 / 60 + 41.4 / 3600, 45 + 59 / 60 + 53 / 3600), "iota Aur": (4 + 56 / 60 + 59.6 / 3600, 33 + 9 / 60 + 58 / 3600), "epsilon Aur": (5 + 1 / 60 + 58.1 / 3600, 43 + 49 / 60 + 24 / 3600), "eta Aur": (5 + 6 / 60 + 30.9 / 3600, 41 + 14 / 60 + 4 / 3600), "zeta Aur": (5 + 2 / 60 + 28.7 / 3600, 41 + 4 / 60 + 33 / 3600), "Elnath": (5 + 26 / 60 + 17.5 / 3600, 28 + 36 / 60 + 27 / 3600), "Menkar": (3 + 2 / 60 + 16.8 / 3600, 4 + 5 / 60 + 23 / 3600), } # ---------------------------------------------------------------------------------------------- G6 inputs SITE_2026 = ("Key West", 24.56, -81.78) EPOCH_2026 = 2026.05 def sha(path): with open(path, "rb") as f: return hashlib.sha256(f.read()).hexdigest() def read_horizons(path): """{datetime: (ra_deg, dec_deg, az_deg, el_deg)} from a Horizons observer table in CSV form.""" rows, on = {}, False months = {m: i + 1 for i, m in enumerate("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split())} with open(path, encoding="utf-8") as f: for line in f: if line.startswith("$$SOE"): on = True elif line.startswith("$$EOE"): on = False elif on: p = [x.strip() for x in line.split(",")] d, hm = p[0].split() y, mon, day = d.split("-") t = dt.datetime(int(y), months[mon], int(day), int(hm[:2]), int(hm[3:5])) rows[t] = (float(p[3]), float(p[4]), float(p[5]), float(p[6])) return rows def pole_at(chaos, t): """Geomagnetic (dipole-axis) north pole from CHAOS at decimal year t, as in dipole_pace.py.""" g, h = chaos.gh(t, 0, 1) a, b, c = g[1][0], g[1][1], h[1][1] m = math.sqrt(a * a + b * b + c * c) x, y, z = -b / m, -c / m, -a / m return deg(math.asin(z)), deg(math.atan2(y, x)) def cd_lat(lat_gc, lon, pole): p, pp, dl = rad(lat_gc), rad(pole[0]), rad(lon - pole[1]) return deg(math.asin(math.sin(p) * math.sin(pp) + math.cos(p) * math.cos(pp) * math.cos(dl))) def edge_light(lat, lon, pole, edge, h): """G2's question: for every azimuth, the elevation of light at height h at the nearest point of the edge.""" glat = PG.geocentric(lat) best = {} for az in range(0, 360): found, d = None, 0.0 while d <= 40.0: la, lo = PG.dest(glat, lon, az, d) if cd_lat(la, lo, pole) >= edge: found = d break d += 0.05 best[az] = PG.elevation(found, h) if found is not None else None return best def span(azs): if not azs: return None if len(azs) == 360: return [0, 359] s = sorted(azs, key=lambda a: (a + 180) % 360) return [s[0], s[-1]] def unit(az, alt): a, e = rad(az), rad(alt) return (math.cos(e) * math.sin(a), math.cos(e) * math.cos(a), math.sin(e)) def camera(p): """Axes of a pinhole camera pointed at azimuth p[0], altitude p[1], rolled by p[2] degrees; p[3] is its focal length in pixels.""" az0, alt0, roll, F = p f = unit(az0, alt0) r0 = (math.cos(rad(az0)), -math.sin(rad(az0)), 0.0) u0 = (r0[1] * f[2] - r0[2] * f[1], r0[2] * f[0] - r0[0] * f[2], r0[0] * f[1] - r0[1] * f[0]) c, s = math.cos(rad(roll)), math.sin(rad(roll)) r = tuple(c * a + s * b for a, b in zip(r0, u0)) u = tuple(-s * a + c * b for a, b in zip(r0, u0)) return f, r, u, F def project(p, az, alt): f, r, u, F = camera(p) v = unit(az, alt) z = sum(a * b for a, b in zip(v, f)) if z <= 0.05: return None return (IMAGE_W / 2 + F * sum(a * b for a, b in zip(v, r)) / z, IMAGE_H / 2 - F * sum(a * b for a, b in zip(v, u)) / z) def unproject(p, x, y): """Azimuth and altitude of the direction that falls on pixel (x, y).""" f, r, u, F = camera(p) a, b = (x - IMAGE_W / 2) / F, -(y - IMAGE_H / 2) / F v = tuple(f[i] + a * r[i] + b * u[i] for i in range(3)) n = math.sqrt(sum(c * c for c in v)) return deg(math.atan2(v[0], v[1])) % 360.0, deg(math.asin(v[2] / n)) def nelder_mead(fun, x0, steps, iters=4000, tol=1e-10): n = len(x0) sim = [list(x0)] + [[x0[j] + (steps[j] if j == i else 0.0) for j in range(n)] for i in range(n)] val = [fun(s) for s in sim] for _ in range(iters): order = sorted(range(n + 1), key=lambda i: val[i]) sim, val = [sim[i] for i in order], [val[i] for i in order] if abs(val[-1] - val[0]) < tol: break cen = [sum(s[j] for s in sim[:-1]) / n for j in range(n)] refl = [cen[j] + (cen[j] - sim[-1][j]) for j in range(n)] fr = fun(refl) if fr < val[0]: exp = [cen[j] + 2.0 * (cen[j] - sim[-1][j]) for j in range(n)] fe = fun(exp) sim[-1], val[-1] = (exp, fe) if fe < fr else (refl, fr) elif fr < val[-2]: sim[-1], val[-1] = refl, fr else: con = [cen[j] + 0.5 * (sim[-1][j] - cen[j]) for j in range(n)] fc = fun(con) if fc < val[-1]: sim[-1], val[-1] = con, fc else: sim = [sim[0]] + [[sim[0][j] + 0.5 * (s[j] - sim[0][j]) for j in range(n)] for s in sim[1:]] val = [val[0]] + [fun(s) for s in sim[1:]] i = min(range(n + 1), key=lambda k: val[k]) return sim[i], val[i] def fit(pairs, start, roll_free=True): """Least-squares camera through pairs of ((az, alt), (x, y)).""" def cost(p): q = list(p) if roll_free else [p[0], p[1], 0.0, p[2]] s = 0.0 for (az, alt), (x, y) in pairs: xy = project(q, az, alt) if xy is None: return 1e12 s += (xy[0] - x) ** 2 + (xy[1] - y) ** 2 return s if roll_free: p, v = nelder_mead(cost, start, [5.0, 5.0, 5.0, 100.0]) p, v = nelder_mead(cost, p, [1.0, 1.0, 1.0, 20.0]) else: p3, v = nelder_mead(cost, [start[0], start[1], start[3]], [5.0, 5.0, 100.0]) p3, v = nelder_mead(cost, p3, [1.0, 1.0, 20.0]) p = [p3[0], p3[1], 0.0, p3[2]] return p, math.sqrt(v / len(pairs)) def main(): rules, downloads, chaos_path, outdir = sys.argv[1:5] log = [] def say(*a): s = " ".join(str(x) for x in a) print(s) log.append(s) say("photo_geometry_others.py run at", dt.datetime.now(dt.timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")) say("rules ", sha(rules), os.path.basename(rules)) say("CHAOS ", sha(chaos_path), os.path.basename(chaos_path)) hz = {} for body in ("moon", "mars", "jupiter", "saturn"): path = os.path.join(downloads, f"horizons_2000_{body}", f"horizons_{body}.txt") hz[body] = read_horizons(path) say("input ", sha(path), f"horizons_2000_{body}/horizons_{body}.txt", len(hz[body]), "rows") chaos = FL.Chaos(chaos_path, "CHAOS-8.7") out = {"what": "The direction test of RULES_photo_geometry.txt, addenda G5 and G6 (factchecked.science, Our analysis)"} # ------------------------------------------------------------------------------------------ G5 name, lat, lon = SITE_2000 pole = pole_at(chaos, EPOCH_2000) site_cd = cd_lat(PG.geocentric(lat), lon, pole) say(f"\nG5 {name}, {lat} N, {-lon} W; dipole-axis pole at {EPOCH_2000}: {pole[0]:.3f} N, {-pole[1]:.3f} W; centred-dipole latitude {site_cd:.2f}") g5 = {"place": {"name": name, "lat": lat, "lon": lon}, "pole_2000.26": [round(pole[0], 3), round(pole[1], 3)], "site_cd_lat": round(site_cd, 2), "what_the_entries_fix": { "caption_on_the_gallery_index_of_Spaceweather.com": "the place and the date, 6 April 2000; no direction, no time", "gallery_entry_in_the_story_of_NASA_as_archived": ("the objects in the frame: Mars, Jupiter, Saturn, the Moon and the Pleiades, with a red auroral sky glow; " "a 50 mm lens at f/1.7, 400 ISO film, 25 seconds; no direction in words, no time"), "the_photograph": ("the Moon, Saturn, Jupiter, five stars of the Pleiades, five of Perseus and Almach, placed to about a pixel by a pinhole camera of " "four parameters; a tower that stands upright in the frame"), "the_red_light_by_eye": "strongest at the right edge and upper right of the frame, fading leftward to blue by the Moon and the Pleiades"}, "points_from": POINTS_FROM, "edges": {}} light = {} for key, edge, why in EDGES_2000: for h in HEIGHTS: best = edge_light(lat, lon, pole, edge, h) light[(key, h)] = best above0 = [a for a, e in best.items() if e is not None and e > 0] above5 = [a for a, e in best.items() if e is not None and e > 5] emax = max(e for e in best.values() if e is not None) azmax = max(best, key=lambda a: best[a] if best[a] is not None else -99) g5["edges"][f"{key}_edge{edge}_h{h}"] = {"why": why, "max_elevation": round(emax, 1), "at_azimuth": azmax, "above_horizon_azimuths": span(above0), "above_5deg_azimuths": span(above5)} say(f" edge ({key}) {edge:4.1f}, {h:3d} km: highest {emax:5.1f} at azimuth {azmax:3d}; above the horizon over {span(above0)}, 5 degrees up over {span(above5)}") # Where the frame looks: fit a camera through the Moon, Saturn and Alcyone at each ten-minute step, roll free and roll zero say("\n the frame, by the Moon, Saturn and the Pleiades (camera fitted at each time; residuals in pixels)") times = sorted(t for t in hz["moon"] if hz["moon"][t][3] > 3.0 and t >= dt.datetime(2000, 4, 7, 0, 0)) ra_a, dec_a = STARS["Alcyone"] trials = [] for t in times: moon, sat = hz["moon"][t], hz["saturn"][t] alc = PG.altaz(ra_a, dec_a, t, lat, lon) pairs = [((moon[2], moon[3]), MOON_PX), ((sat[2], sat[3]), SATURN_PX), ((alc[1], alc[0]), ALCYONE_PX)] start = [moon[2] + 18.0, moon[3] + 6.0, 0.0, 1100.0] p, rms = fit(pairs, start, True) p0, rms0 = fit(pairs, start, False) # the low planet as a check, against Jupiter and against Mars chk = {} for b in ("jupiter", "mars"): xy = project(p, hz[b][t][2], hz[b][t][3]) chk[b] = None if xy is None else round(math.hypot(xy[0] - LOW_PLANET_PX[0], xy[1] - LOW_PLANET_PX[1]), 1) trials.append((t, p, rms, p0, rms0, chk)) say(f" {t:%H:%M} UT Moon az {moon[2]:6.1f} alt {moon[3]:5.1f} | roll free: axis az {p[0] % 360:6.1f} alt {p[1]:5.1f} roll {p[2]:6.1f} F {p[3]:6.0f} rms {rms:5.2f}" f" | roll 0: rms {rms0:6.2f} | low planet off Jupiter {chk['jupiter']} px, off Mars {chk['mars']} px") out["G5"] = g5 g5["trials"] = [{"ut": f"{t:%Y-%m-%d %H:%M}", "axis_az": round(p[0] % 360, 1), "axis_alt": round(p[1], 1), "roll": round(p[2], 1), "focal_px": round(p[3]), "rms_px": round(rms, 2), "rms_px_roll0": round(rms0, 2), "low_planet_px_off": chk} for t, p, rms, p0, rms0, chk in trials] # The time, two ways: by the Moon's place among Saturn and the Pleiades (smallest residual with roll free), and by a level # camera (the tower stands upright in the frame). Then the frame, fitted through every identified object at both times. t_moon = min(trials, key=lambda r: r[2])[0] t_level = min(trials, key=lambda r: abs(r[1][2]))[0] say(f"\n time by the Moon among Saturn and the Pleiades: {t_moon:%H:%M} UT; by a level camera: {t_level:%H:%M} UT") g5["time_by_moon_UT"] = f"{t_moon:%Y-%m-%d %H:%M}" g5["time_by_level_camera_UT"] = f"{t_level:%Y-%m-%d %H:%M}" sun = {} for t in (t_moon, t_level): ra_s, dec_s = PG.sun_radec(t) sun[f"{t:%H:%M}"] = round(PG.altaz(ra_s, dec_s, t, lat, lon)[0], 1) g5["sun_altitude"] = sun say(" Sun's altitude at those times:", sun) IDENT = [("Moon", MOON_PX), ("Saturn", SATURN_PX), ("Jupiter", LOW_PLANET_PX), ("Alcyone", ALCYONE_PX), ("Atlas", (163.4, 45.3)), ("Merope", (164.9, 57.6)), ("Maia", (173.8, 57.8)), ("Electra", (169.5, 62.4)), ("omicron Per", (313.6, 21.3)), ("kappa Per", (574.2, 65.6)), ("Algol", (506.4, 96.7)), ("rho Per", (473.4, 121.0)), ("16 Per", (487.0, 171.0)), ("Almach", (628.1, 287.5))] frames = {} for t in sorted({t_moon, t_level}): def where(n): if n == "Moon": return hz["moon"][t][2], hz["moon"][t][3] if n in ("Saturn", "Jupiter"): return hz[n.lower()][t][2], hz[n.lower()][t][3] alt, az = PG.altaz(STARS[n][0], STARS[n][1], t, lat, lon) return az, alt pairs = [(where(n), px) for n, px in IDENT] start = [hz["moon"][t][2] + 18.0, hz["moon"][t][3] + 6.0, 0.0, 1050.0] p, rms = fit(pairs, start, True) resid = {} for (n, px), (azalt, _) in zip(IDENT, pairs): xy = project(p, azalt[0], azalt[1]) resid[n] = {"az": round(azalt[0], 1), "alt": round(azalt[1], 1), "px_off": round(math.hypot(xy[0] - px[0], xy[1] - px[1]), 1)} corners = {k: unproject(p, x, y) for k, (x, y) in {"top_left": (0, 0), "top_right": (IMAGE_W, 0), "bottom_left": (0, IMAGE_H), "bottom_right": (IMAGE_W, IMAGE_H), "centre": (IMAGE_W / 2, IMAGE_H / 2), "mid_left": (0, IMAGE_H / 2), "mid_right": (IMAGE_W, IMAGE_H / 2)}.items()} az_all = [unproject(p, x, y)[0] for x in range(0, IMAGE_W + 1, 6) for y in (0, IMAGE_H / 2, IMAGE_H)] alt_all = [unproject(p, x, y)[1] for x in range(0, IMAGE_W + 1, 6) for y in (0, IMAGE_H)] fov_h = 2 * deg(math.atan(IMAGE_W / 2 / p[3])) fov_v = 2 * deg(math.atan(IMAGE_H / 2 / p[3])) key = f"{t:%H:%M}" frames[key] = {"axis_az": round(p[0] % 360, 1), "axis_alt": round(p[1], 1), "roll": round(p[2], 1), "focal_px": round(p[3]), "field_deg": [round(fov_h, 1), round(fov_v, 1)], "rms_px": round(rms, 2), "objects": resid, "corners_az_alt": {k: [round(v[0], 1), round(v[1], 1)] for k, v in corners.items()}, "azimuth_span": [round(min(az_all), 1), round(max(az_all), 1)], "altitude_span": [round(min(alt_all), 1), round(max(alt_all), 1)]} say(f"\n frame at {key} UT, through {len(IDENT)} objects: axis az {p[0] % 360:.1f} alt {p[1]:.1f} roll {p[2]:.1f}; field {fov_h:.1f} x {fov_v:.1f} degrees; rms {rms:.2f} px") say(" residuals (px):", ", ".join(f"{n} {v['px_off']}" for n, v in resid.items())) say(" corners (az, alt):", {k: [round(v[0], 1), round(v[1], 1)] for k, v in corners.items()}) say(f" azimuths {min(az_all):.1f} to {max(az_all):.1f}; altitudes {min(alt_all):.1f} to {max(alt_all):.1f}") # could light at each edge fall inside the frame? compare its elevation with the frame's lower edge, azimuth by azimuth cover = {} bottom = [unproject(p, x, IMAGE_H) for x in range(0, IMAGE_W + 1, 2)] top = [unproject(p, x, 0) for x in range(0, IMAGE_W + 1, 2)] for ekey, edge, _ in EDGES_2000: for h in HEIGHTS: best = light[(ekey, h)] inside, most = [], None for az in range(int(min(az_all)), int(max(az_all)) + 2): e = best.get(az % 360) if e is None or e <= 0: continue lows = [alt for a2, alt in bottom if abs(a2 - az) <= 0.6] highs = [alt for a2, alt in top if abs(a2 - az) <= 0.6] if not lows: continue if most is None or e > most[1]: most = (az, round(e, 1), round(min(lows), 1)) if e >= min(lows): inside.append(az) cover[f"{ekey}_h{h}"] = {"highest_edge_light_at_a_frame_azimuth": most, "azimuths_where_it_enters_the_frame": span(inside) if inside else None} say(f" edge ({ekey}) {h:3d} km: highest light at a frame azimuth (az, its elevation, frame's lower edge there) {most}; enters the frame over {span(inside) if inside else None}") frames[key]["edge_light_in_frame"] = cover # how near would the light have to be to stand where the frame's northern stars are (as G3 asked for Chiefland) glat = PG.geocentric(lat) near = {} for n in ("omicron Per", "rho Per", "16 Per", "Algol", "kappa Per", "Almach"): az, alt = where(n) row = {} for h in HEIGHTS: d = 0.0 while d <= 40.0 and PG.elevation(d, h) > alt: d += 0.01 la, lo = PG.dest(glat, lon, az, d) row[f"h{h}"] = {"arc_deg": round(d, 1), "cd_lat": round(cd_lat(la, lo, pole), 1)} near[n] = {"az": round(az, 1), "alt": round(alt, 1), **row} say(f" light seen at {n} (az {az:.1f}, alt {alt:.1f}) lies at centred-dipole latitude " + ", ".join(f"{row[f'h{h}']['cd_lat']} ({h} km)" for h in HEIGHTS)) frames[key]["latitude_of_light_at_stars"] = near g5["frames"] = frames # the registered outcome, from the later of the two times (the frame then reaches furthest north) last = frames[max(frames)] first = frames[min(frames)] az_lo, az_hi = first["azimuth_span"][0], last["azimuth_span"][1] passes = {} for ekey, edge, _ in EDGES_2000: for h in (250, 400, 500): sp5 = g5["edges"][f"{ekey}_edge{edge}_h{h}"]["above_5deg_azimuths"] sp0 = g5["edges"][f"{ekey}_edge{edge}_h{h}"]["above_horizon_azimuths"] def start_of(sp): return None if sp is None else (sp[0] if sp[0] > 180 else sp[0] + 360) s5, s0 = start_of(sp5), start_of(sp0) passes[f"{ekey}_h{h}"] = {"frame_azimuths": [az_lo, az_hi], "span_5deg_starts_at": s5, "span_horizon_starts_at": s0, "degrees_of_frame_inside_5deg_span": None if s5 is None else round(max(0.0, az_hi - s5), 1), "degrees_of_frame_inside_horizon_span": None if s0 is None else round(max(0.0, az_hi - s0), 1), "enters_frame": last["edge_light_in_frame"][f"{ekey}_h{h}"]["azimuths_where_it_enters_the_frame"] is not None} g5["against_the_registered_marks"] = passes ab_in = any(v["enters_frame"] for k, v in passes.items() if k[0] in "ab") c_in = any(v["enters_frame"] for k, v in passes.items() if k[0] == "c") ab_touch = any((v["degrees_of_frame_inside_horizon_span"] or 0) > 0 for k, v in passes.items() if k[0] in "ab") g5["outcome"] = { "direction_fixed": True, "light_at_edges_a_or_b_to_500km_falls_in_frame": ab_in, "frame_azimuths_touch_the_above_horizon_span_of_a_or_b": ab_touch, "light_at_edge_c_falls_in_frame": c_in, "in_words": ("The direction is fixed: the frame runs from west to north-west. PASS mark not met: no light at edge (a) or (b), at 250 to 500 km, " "could fall inside the frame. FAIL mark not met by its letter either, if the frame's last degrees of azimuth lie inside the span " "where light at edge (a) is above the horizon; that light would stand below the frame's lower edge. On edge (c) the light " "fills the frame. So the frame faces north of west, toward the pole, unlike Chiefland's in March 2023, but its red light is " "nearer than the published edges (a) and (b) put any; whether it was aurora or a stable auroral red arc, the direction cannot tell."), } say("\n against the registered marks:", json.dumps(passes)) say(" outcome:", json.dumps(g5["outcome"])) # ------------------------------------------------------------------------------------------ G6 name6, lat6, lon6 = SITE_2026 pole6 = pole_at(chaos, min(EPOCH_2026, chaos.t_last)) out["G6"] = { "place": {"name": "near " + name6, "lat": lat6, "lon": lon6}, "entry": "Spaceweather.com gallery item 230497, as saved on 1 November 2026", "what_the_entry_fixes": {"direction_in_words": None, "landmark_of_known_bearing": None, "time": "2026:01:20 21:27:17 in the entry's 'Date Taken' field, zone not stated", "place": "near Key West, latitude 24 N by the photographer's words", "camera": "an iPhone 15; 2 seconds in the entry's exposure field, 10 seconds in the photographer's words"}, "the_photograph": ("730 x 548 pixels as published: trees in silhouette, a broad orange glow above them, a field of points too coarse, " "after the phone's processing, for us to pick out a constellation in the few minutes this check was given"), "outcome": "CANNOT BE TOLD", "site_cd_lat": round(cd_lat(PG.geocentric(lat6), lon6, pole6), 2), } say("\nG6 near Key West, gallery item 230497: no direction in words, no landmark, no constellation picked out: CANNOT BE TOLD") with open(os.path.join(outdir, "photo_geometry_others.json"), "w", encoding="utf-8", newline="\n") as f: json.dump(out, f, indent=1, ensure_ascii=False) f.write("\n") with open(os.path.join(outdir, "photo_geometry_others.log"), "w", encoding="utf-8", newline="\n") as f: f.write("\n".join(log) + "\n") if __name__ == "__main__": main()