Use richer Sky and Telescope trace for Libra
This commit is contained in:
parent
6843e1fc33
commit
af65162eb0
2 changed files with 25 additions and 6 deletions
File diff suppressed because one or more lines are too long
|
|
@ -15,6 +15,10 @@ STELLARIUM_URL = (
|
|||
"https://raw.githubusercontent.com/Stellarium/stellarium/master/"
|
||||
"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/"
|
||||
OUT = Path(__file__).resolve().parent.parent / "plugin/contents/ui/constellations.js"
|
||||
|
||||
|
|
@ -33,8 +37,14 @@ ZODIAC = {
|
|||
"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_st
|
||||
|
||||
Hipparcos J2000 coordinates: d3-celestial.
|
||||
Copyright (c) 2015, Olaf Frohn
|
||||
|
|
@ -68,6 +78,10 @@ def rounded_point(point: list[float]) -> list[float]:
|
|||
|
||||
def main() -> None:
|
||||
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"]
|
||||
name_data = fetch(D3_BASE + "constellations.json")["features"]
|
||||
stars = {
|
||||
|
|
@ -87,8 +101,11 @@ def main() -> None:
|
|||
ident = constellation["id"].split()[-1]
|
||||
if ident not in ZODIAC:
|
||||
continue
|
||||
line_source = (st_constellations[ident]
|
||||
if LINE_OVERRIDES.get(ident) == "modern_st"
|
||||
else constellation)
|
||||
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]
|
||||
if missing:
|
||||
raise RuntimeError(f"{ident}: HIP ausente no catálogo: {missing}")
|
||||
|
|
@ -123,7 +140,7 @@ def main() -> None:
|
|||
)
|
||||
OUT.write_text(
|
||||
"/* 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())
|
||||
+ " */\nconst CONSTELLATIONS=" + payload + ";\n",
|
||||
encoding="utf-8",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue