Restore consistent Modern zodiac traces
This commit is contained in:
parent
af65162eb0
commit
3416cac155
2 changed files with 6 additions and 25 deletions
File diff suppressed because one or more lines are too long
|
|
@ -15,10 +15,6 @@ 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"
|
||||||
|
|
||||||
|
|
@ -37,14 +33,8 @@ ZODIAC = {
|
||||||
"Psc": "Peixes",
|
"Psc": "Peixes",
|
||||||
}
|
}
|
||||||
|
|
||||||
# Avaliados signo a signo. S&T costuma usar traçados mais ricos e próximos
|
LICENSE = """Constellation lines: Stellarium Modern sky culture, CC BY-SA 4.0.
|
||||||
# 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
|
||||||
|
|
@ -78,10 +68,6 @@ 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 = {
|
||||||
|
|
@ -101,11 +87,8 @@ 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 line_source.get("lines", []):
|
for hip_line in constellation.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}")
|
||||||
|
|
@ -140,7 +123,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/S&T constellation lines, coordenadas Hipparcos J2000.\n\n"
|
" Stellarium Modern 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",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue