Repository Public
1#!/bin/bash2# =============================================================================3# SP BOUCHER | INFRASTRUCTURE & AUTOMATION4# ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5# =============================================================================6#7# Project : ORIX Cosmos8# File : DataPipeline/catalogs/build_all.sh9# Module : DataPipeline10# Repository : https://git.spboucher.ai/orix-cosmos11# Project Website : https://www.orixlab.dev12# Created : 2026-11-2413# Last Modified : 2026-11-2414#15# Author : Simon-Pierre Boucher16# Position : Professor of Finance17# Institution : Université du Québec en Outaouais (UQO)18# Organization : SP Boucher19# Website : https://spboucher.ai20# Git : https://git.spboucher.ai21#22# Preferred Contact: support@spboucher.ai23# Technical Contact: dev@spboucher.ai24# Security/Admin : admin@spboucher.ai25#26# Copyright (c) 202627# Simon-Pierre Boucher28# All rights reserved where applicable. This file is governed by the29# applicable project license, copyright notices and relevant law.30# Existing third-party rights and notices remain unaffected.31#32# License : None specified (no license file in this repository)33#34# Do not embed credentials, private keys, access tokens,35# certificates or confidential personal information.36#37# =============================================================================38# END OF SP BOUCHER SOURCE HEADER39# =============================================================================4041# ORIX Cosmos42# File: DataPipeline/catalogs/build_all.sh43# Description: Rebuilds every catalogue pack from scratch: fetches the sources (cached, resumable), builds the star and object packs, builds the 3D octrees with the Swift tool, writes the manifests. Plain batch job: no remote machine, nothing deployed.44#45# Author: Simon-Pierre Boucher46# Contact: contact@spboucher.ai47#48# Usage: DataPipeline/catalogs/build_all.sh [--no-fetch] [--g12]49# --no-fetch use only the raw files already cached under DataPipeline/raw/catalogs50# --g12 also fetch Gaia DR3 10 < G <= 12 (about 2.4 million sources, 1.5-2 hours at the archive's pace)51# Output: Resources/Packs/<pack>/ (override with COSMOS_PACKS_DIR). Raw responses: DataPipeline/raw/catalogs/ (git-ignored).52# Every step is idempotent: an interrupted run resumes at the first missing raw file.53set -euo pipefail54cd "$(dirname "$0")"55ROOT="$(cd ../.. && pwd)"56FETCH=157G12=058for arg in "$@"; do59 case "$arg" in60 --no-fetch) FETCH=0 ;;61 --g12) G12=1 ;;62 *) echo "unknown option $arg" >&2; exit 2 ;;63 esac64done6566if [ "$FETCH" = 1 ]; then67 python3 fetch_sources.py all68 python3 fetch_gaia.py hipparcos69 python3 fetch_gaia.py hipxm70 python3 fetch_gaia.py gcns71 python3 fetch_gaia.py tier 0 8 172 python3 fetch_gaia.py tier 8 9 0.573 python3 fetch_gaia.py tier 9 10 0.2574 python3 fetch_gaia.py teff 0 10 175 if [ "$G12" = 1 ]; then76 python3 fetch_gaia.py tier 10 11 0.12577 python3 fetch_gaia.py tier 11 12 0.062578 fi79fi8081python3 designations.py --write-fixture # keeps the Swift/Python normalisation fixture current82python3 build_stars.py # stars-hipparcos, stars-gaia-nearby, stars-gaia-g10 (, stars-gaia-g12), starter stars83python3 build_objects.py # exoplanets, candidates, deep-sky, galaxies, 2MRS, satellites, minor bodies, starter database84python3 finalize.py # manifests (needed by the Swift tool to open the packs)85# 3D octrees of the star packs (Swift; the benchmark runner hosts the pipeline step)86(cd "$ROOT" && swift run -c release cosmos-bench catalog.build-octrees)87python3 finalize.py # manifests again, now with octree.bin88echo "done: $(ls -d "${COSMOS_PACKS_DIR:-$ROOT/Resources/Packs}"/*/ | wc -l | tr -d ' ') pack directories"89