Add anchored zodiac artwork
This commit is contained in:
parent
3df13f9a0c
commit
16dfd792ce
16 changed files with 97 additions and 3 deletions
|
|
@ -68,7 +68,7 @@ def rounded_point(point: list[float]) -> list[float]:
|
|||
|
||||
def main() -> None:
|
||||
sky_culture = fetch(STELLARIUM_URL)
|
||||
star_data = fetch(D3_BASE + "stars.6.json")["features"]
|
||||
star_data = fetch(D3_BASE + "stars.8.json")["features"]
|
||||
name_data = fetch(D3_BASE + "constellations.json")["features"]
|
||||
stars = {
|
||||
int(feature["id"]): rounded_point(feature["geometry"]["coordinates"])
|
||||
|
|
@ -93,12 +93,27 @@ def main() -> None:
|
|||
if missing:
|
||||
raise RuntimeError(f"{ident}: HIP ausente no catálogo: {missing}")
|
||||
lines.append([stars[hip] for hip in hip_line])
|
||||
image = constellation.get("image")
|
||||
art = None
|
||||
if image:
|
||||
anchors = []
|
||||
for anchor in image["anchors"]:
|
||||
hip = int(anchor["hip"])
|
||||
if hip not in stars:
|
||||
raise RuntimeError(f"{ident}: âncora HIP ausente: {hip}")
|
||||
anchors.append({"pos": anchor["pos"], "sky": stars[hip]})
|
||||
art = {
|
||||
"file": "constellation-art/" + Path(image["file"]).name,
|
||||
"size": image["size"],
|
||||
"anchors": anchors,
|
||||
}
|
||||
merged[ident] = {
|
||||
"id": ident,
|
||||
"name": ZODIAC[ident],
|
||||
"rank": 1 if ident in {"Ari", "Tau", "Gem", "Leo", "Vir", "Sco", "Sgr"} else 2,
|
||||
"label": metadata.get(ident, {}).get("label"),
|
||||
"lines": lines,
|
||||
"art": art,
|
||||
}
|
||||
|
||||
payload = json.dumps(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue