Use richer Sky and Telescope trace for Libra

This commit is contained in:
vini 2026-07-19 14:44:38 -03:00
parent 6843e1fc33
commit af65162eb0
2 changed files with 25 additions and 6 deletions

File diff suppressed because one or more lines are too long

View file

@ -15,6 +15,10 @@ STELLARIUM_URL = (
"https://raw.githubusercontent.com/Stellarium/stellarium/master/" "https://raw.githubusercontent.com/Stellarium/stellarium/master/"
"skycultures/modern/index.json" "skycultures/modern/index.json"
) )
STELLARIUM_ST_URL = (
"https://raw.githubusercontent.com/Stellarium/stellarium/master/"
"skycultures/modern_st/index.json"
)
D3_BASE = "https://raw.githubusercontent.com/ofrohn/d3-celestial/master/data/" D3_BASE = "https://raw.githubusercontent.com/ofrohn/d3-celestial/master/data/"
OUT = Path(__file__).resolve().parent.parent / "plugin/contents/ui/constellations.js" OUT = Path(__file__).resolve().parent.parent / "plugin/contents/ui/constellations.js"
@ -33,8 +37,14 @@ ZODIAC = {
"Psc": "Peixes", "Psc": "Peixes",
} }
LICENSE = """Constellation lines: Stellarium Modern sky culture, CC BY-SA 4.0. # Avaliados signo a signo. S&T costuma usar traçados mais ricos e próximos
# aos mapas populares, enquanto a arte continua vindo do conjunto Modern.
LINE_OVERRIDES = {"Lib": "modern_st"}
LICENSE = """Constellation lines: Stellarium Modern and Modern (S&T) sky cultures,
CC BY-SA 4.0.
https://github.com/Stellarium/stellarium/tree/master/skycultures/modern https://github.com/Stellarium/stellarium/tree/master/skycultures/modern
https://github.com/Stellarium/stellarium/tree/master/skycultures/modern_st
Hipparcos J2000 coordinates: d3-celestial. Hipparcos J2000 coordinates: d3-celestial.
Copyright (c) 2015, Olaf Frohn Copyright (c) 2015, Olaf Frohn
@ -68,6 +78,10 @@ def rounded_point(point: list[float]) -> list[float]:
def main() -> None: def main() -> None:
sky_culture = fetch(STELLARIUM_URL) sky_culture = fetch(STELLARIUM_URL)
sky_culture_st = fetch(STELLARIUM_ST_URL)
st_constellations = {
item["id"].split()[-1]: item for item in sky_culture_st["constellations"]
}
star_data = fetch(D3_BASE + "stars.8.json")["features"] star_data = fetch(D3_BASE + "stars.8.json")["features"]
name_data = fetch(D3_BASE + "constellations.json")["features"] name_data = fetch(D3_BASE + "constellations.json")["features"]
stars = { stars = {
@ -87,8 +101,11 @@ def main() -> None:
ident = constellation["id"].split()[-1] ident = constellation["id"].split()[-1]
if ident not in ZODIAC: if ident not in ZODIAC:
continue continue
line_source = (st_constellations[ident]
if LINE_OVERRIDES.get(ident) == "modern_st"
else constellation)
lines = [] lines = []
for hip_line in constellation.get("lines", []): for hip_line in line_source.get("lines", []):
missing = [hip for hip in hip_line if hip not in stars] missing = [hip for hip in hip_line if hip not in stars]
if missing: if missing:
raise RuntimeError(f"{ident}: HIP ausente no catálogo: {missing}") raise RuntimeError(f"{ident}: HIP ausente no catálogo: {missing}")
@ -123,7 +140,7 @@ def main() -> None:
) )
OUT.write_text( OUT.write_text(
"/* Gerado por tools/build_constellations.py.\n" "/* Gerado por tools/build_constellations.py.\n"
" Stellarium Modern constellation lines, coordenadas Hipparcos J2000.\n\n" " Stellarium Modern/S&T constellation lines, coordenadas Hipparcos J2000.\n\n"
+ "\n".join((" " + line) if line else "" for line in LICENSE.rstrip().splitlines()) + "\n".join((" " + line) if line else "" for line in LICENSE.rstrip().splitlines())
+ " */\nconst CONSTELLATIONS=" + payload + ";\n", + " */\nconst CONSTELLATIONS=" + payload + ";\n",
encoding="utf-8", encoding="utf-8",