#!/usr/bin/env python3 """Separate check of the cloud markers on 10 May 2024 in Figure 7 of Tacza et al. (2026), with code independent of fig7_digitize.py. Pillow only. Usage: python3 -I fig7_crosscheck_cloud.py PAPER_PDF For each of the seven Argentine sensors, the share of strongly red pixels (the "cloud fraction > 90 %" markers) in a 13-row strip at the top of its panel, over each hour's full width (h:00 to h+1:00), from 12 to 23 UT on 10 May. The red dashed line marking 17 UT crosses the strip at the boundary of the 16 and 17 UT hours, so those two hours show about 25 % from the line alone; a real marker fills about 90 % or more. """ import os import sys sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) from fig7_image import figure7 # noqa: E402 px = figure7(sys.argv[1]).load() PX_DAY = 98.0 X7 = {"L": 294.5, "R": 1614.5} # 7 May 2024 00 UT in each column of panels def x_of(col, day, hour): return X7[col] + PX_DAY * ((day - 7) + hour / 24.0) def red(p): return p[0] > 200 and p[1] < 110 and p[2] < 110 ARG = {"CAS1": ("L", 154), "CAS2": ("R", 154), "BAT": ("L", 671), "CLF": ("R", 671), "CRS": ("L", 1189), "LA": ("R", 1189), "LM": ("L", 1706)} print("Share of red pixels in the cloud lane, 10 May 2024, by UT hour (h:00-h+1:00)") for name, (col, y0) in ARG.items(): out = [] for h in range(12, 24): xa, xb = int(round(x_of(col, 10, h))), int(round(x_of(col, 10, h + 1))) tot = hit = 0 for x in range(xa, xb): for y in range(y0 + 15, y0 + 28): tot += 1 hit += red(px[x, y]) out.append("%02d:%3d%%" % (h, round(100 * hit / tot))) print(" ", name.ljust(5), " ".join(out))