Bigger next-pass panel with brightness on the ISS view, deploy on push

The map leaves out the polar caps (75° N to 60° S at the same scale) so the
next visible pass gets a 100 px panel: the time in 48 px type, the date, and
height, direction, estimated magnitude and clouds in 24 px. The magnitude is
the brightest moment of the pass by Matson's formula (standard magnitude -1.8).

A Gitea webhook now makes Coolify deploy every push to main, and Coolify
4.5.3 re-reads docker-compose.yml on each deploy, so no buttons are needed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
rickzkmandClaude Opus 5.5 committed 2026-10-29 22:48:19 +01:00
1 parent 0de68bfce0
commit 517f0868db
7 files changed
+136 -27

No files matched your search

+13
View File
@@ -1,3 +1,4 @@
import math
from datetime import datetime, timedelta
from pathlib import Path
@@ -85,6 +86,18 @@ def test_next_visible_iss_pass():
assert (direction(p.az_from), direction(p.az_to)) == ("Z", "JV")
def test_pass_brightness_is_that_of_a_typical_iss_pass():
p = astro.next_visible_pass(TLE, EVENING)
assert -4.2 < p.mag < -2.5 # a 40° pass: brighter than any star, short of the best overhead passes
def test_magnitude_formula():
assert astro.magnitude(1000, math.pi / 2) == pytest.approx(astro.ISS_STD_MAG)
assert astro.magnitude(500, math.pi / 2) == pytest.approx(astro.ISS_STD_MAG - 5 * math.log10(2))
assert astro.magnitude(1000, 0) == pytest.approx(astro.ISS_STD_MAG - 2.5 * math.log10(math.pi)) # fully lit
assert astro.magnitude(1000, math.pi) > 10 # only the dark side faces us: invisible, not an error
def test_no_visible_pass_within_the_window():
assert astro.next_visible_pass(TLE, EVENING, within_hours=6) is None
+27 -4
View File
@@ -6,7 +6,8 @@ import pytest
from PIL import ImageChops
import astro
from iss_view import MAP_TOP, MARKER, IssView, is_day, map_xy
from iss_view import LAT_BOTTOM, LAT_TOP, MAP_H, MAP_TOP, MARKER, PANEL_TOP, TEXT, IssView, is_day, map_xy, \
pass_cells
from sky_data import parse_clouds, parse_tle
from tests.helpers import count_near
@@ -59,9 +60,14 @@ def test_nothing_to_patch_between_frames():
def test_map_is_equirectangular_under_the_header():
assert map_xy(0, 0) == pytest.approx((240, MAP_TOP + 120))
assert map_xy(90, -180) == pytest.approx((0, MAP_TOP))
assert map_xy(-90, 180) == pytest.approx((480, MAP_TOP + 240))
assert map_xy(LAT_TOP, -180) == pytest.approx((0, MAP_TOP))
assert map_xy(LAT_BOTTOM, 180) == pytest.approx((480, MAP_TOP + MAP_H))
(x0, y0), (x1, y1) = map_xy(0, 0), map_xy(10, 10)
assert x1 - x0 == pytest.approx(y0 - y1) # degrees as wide as they are tall
def test_the_whole_orbit_fits_on_the_map():
assert MAP_TOP < map_xy(51.7, 0)[1] and map_xy(-51.7, 0)[1] < MAP_TOP + MAP_H
def test_day_and_night():
@@ -91,3 +97,20 @@ def test_stale_tag_only_when_the_orbit_is_old_and_only_in_the_header():
old = view(tle_age=4 * 86400).render(NOW)
bbox = ImageChops.difference(fresh, old).getbbox()
assert bbox is not None and bbox[3] <= MAP_TOP
def test_next_pass_grid_shows_height_direction_brightness_and_clouds():
p = astro.next_visible_pass(TLE, NOW)
cells = {label: value for label, value, _ in pass_cells(p, CLOUDS)}
assert cells["VÝŠKA"] == "40°"
assert cells["SMĚR"] == "Z → JV"
assert cells["JASNOST"].startswith("−") and cells["JASNOST"].endswith(" mag") and "," in cells["JASNOST"]
assert cells["MRAKY"] == "100 %"
assert {label: value for label, value, _ in pass_cells(p, ())}["MRAKY"] == "--"
def test_time_of_the_next_pass_is_large():
img = view().render(NOW).crop((0, PANEL_TOP, 200, 320))
mask = img.point(lambda v: 255 if v > 200 else 0).convert("L").point(lambda v: 255 if v == 255 else 0)
top, bottom = mask.getbbox()[1], mask.getbbox()[3]
assert bottom - top >= 50 # 48 px time over the date: readable across the room