SPB Git

Repository Public

sources.py 16.2 KB 239 lines python

1#!/usr/bin/env python32# =============================================================================3#                  SP BOUCHER | SOFTWARE & RESEARCH4#             ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5# =============================================================================6#7# PROJECT METADATA8# -----------------------------------------------------------------------------9# Project          : ORIX Cosmos10# File             : DataPipeline/catalogs/sources.py11# Description      : Provenance records (source, release, licence text,12#                    required acknowledgement, URL, transformation) of every13#                    source used by the catalogue packs. One place, reused by14#                    all builders and written into each pack database and15#                    manifest.16# Module           : DataPipeline17# Repository       : https://git.spboucher.ai/orix-cosmos18# Project Website  : https://www.orixlab.dev19# Created          : 2026-11-2420# Last Modified    : 2026-11-2421#22# =============================================================================23# AUTHOR & PROFESSIONAL AFFILIATION24# =============================================================================25#26# Author           : Simon-Pierre Boucher27# Position         : Professor of Finance28# Institution      : Université du Québec en Outaouais (UQO)29# Department       : Département des sciences administratives30# Organization     : SP Boucher31#32# Website          : https://spboucher.ai33# Git              : https://git.spboucher.ai34#35# =============================================================================36# OFFICIAL CONTACT DIRECTORY37# =============================================================================38#39# General          : info@spboucher.ai40# Professional     : contact@spboucher.ai41# Direct           : simon@spboucher.ai42# Research         : research@spboucher.ai43# Development      : dev@spboucher.ai44# Support          : support@spboucher.ai45# Security/Admin   : admin@spboucher.ai46# Notifications    : notifications@spboucher.ai47#48# Preferred Contact: support@spboucher.ai49#50# =============================================================================51# COPYRIGHT & INTELLECTUAL PROPERTY52# =============================================================================53#54# Copyright (c) 202655# Simon-Pierre Boucher56#57# All rights reserved where applicable.58#59# This file is governed by the applicable project license,60# copyright notices, institutional agreements and relevant law.61#62# Unless expressly authorized by the applicable license or63# rights holder, copying, redistribution, sublicensing,64# publication and commercial exploitation are not permitted.65#66# Existing third-party rights and notices remain unaffected.67#68# =============================================================================69# CONFIDENTIALITY & SECURITY70# =============================================================================71#72# Classification   : Public73# Distribution     : Public repository; use is governed by the project license74# Security Contact : admin@spboucher.ai75#76# Access to this source does not independently grant permission77# to redistribute or disclose confidential materials.78#79# Do not embed credentials, private keys, access tokens,80# certificates or confidential personal information.81#82# =============================================================================83# LICENSE & MAINTENANCE84# =============================================================================85#86# License          : None specified (no license file in this repository)87# Maintainer       : Simon-Pierre Boucher88# Technical Contact: dev@spboucher.ai89#90# =============================================================================91# END OF SP BOUCHER SOURCE HEADER92# =============================================================================9394import glob95import os9697from common import RAW, read_meta9899ESA_LICENCE = ("CC BY-NC 3.0 IGO. ESA Space Science Archives terms: data are \"open and free to use by the User subject "100               "to proper acknowledgment\"; \"Prior to any commercial use ... a detailed request for authorisation/licence "101               "shall be made\" (data.licences@esa.int). https://www.cosmos.esa.int/web/esdc/terms-and-conditions")102GAIA_ACK = ("This work has made use of data from the European Space Agency (ESA) mission Gaia "103            "(https://www.cosmos.esa.int/gaia), processed by the Gaia Data Processing and Analysis Consortium (DPAC, "104            "https://www.cosmos.esa.int/web/gaia/dpac/consortium). Funding for the DPAC has been provided by national "105            "institutions, in particular the institutions participating in the Gaia Multilateral Agreement.")106107108def retrieved(source_dir, pattern="*"):109    """Latest retrieval date (UTC, ISO) among the cached raw files of a source."""110    dates = []111    for meta in glob.glob(os.path.join(RAW, source_dir, pattern + ".meta.json")):112        dates.append(read_meta(meta[:-len(".meta.json")])["retrieved_utc"][:10])113    if not dates:114        raise RuntimeError("no raw files for %s/%s: run the fetch scripts first" % (source_dir, pattern))115    return max(dates)116117118def all_sources():119    """id -> dict(source, version, retrieved, license, url, method, citation)."""120    g = retrieved("gaia")121    return {122        "esa-hipparcos-2007": dict(123            source="Hipparcos, the New Reduction (van Leeuwen 2007), table public.hipparcos_newreduction of the ESA Gaia Archive",124            version="2007 new reduction (VizieR I/311)", retrieved=retrieved("gaia", "hip2_*"), license=ESA_LICENCE,125            url="https://gea.esac.esa.int/tap-server/tap",126            method="degrees -> radians; epoch J1991.25 kept; no parallax inversion except the documented S/N >= 5 rule",127            citation="van Leeuwen, F. (2007). Validation of the new Hipparcos reduction. A&A 474, 653. Credit: ESA."),128        "esa-hipparcos-1997": dict(129            source="The Hipparcos Catalogue (ESA 1997), table public.hipparcos of the ESA Gaia Archive",130            version="ESA SP-1200 (1997)", retrieved=retrieved("gaia", "hip1_*"), license=ESA_LICENCE,131            url="https://gea.esac.esa.int/tap-server/tap",132            method="V magnitude, spectral type and HD number copied",133            citation="ESA (1997). The Hipparcos and Tycho Catalogues, ESA SP-1200."),134        "esa-gaia-dr3": dict(135            source="Gaia Data Release 3, gaia_source (column subset gaia.dr3lite served by the GAVO Data Center; GSP-Phot Teff and the Hipparcos best-neighbour table from the ESA Gaia Archive)",136            version="Gaia DR3 (2022-06-13), astrometry and photometry identical to EDR3", retrieved=g, license=ESA_LICENCE,137            url="https://gea.esac.esa.int/archive/",138            method="degrees -> radians; reference epoch J2016.0; parallaxes stored as published (the Lindegren et al. 2021 zero-point correction is NOT applied to stored parallaxes)",139            citation="Gaia Collaboration, Vallenari, A. et al. (2023). Gaia Data Release 3: Summary of the content and survey properties. A&A 674, A1. " + GAIA_ACK),140        "gaia-edr3-gcns": dict(141            source="Gaia Catalogue of Nearby Stars, table external.gaiaedr3_gcns_main_1 of the ESA Gaia Archive",142            version="GCNS (Gaia EDR3), 331 312 sources within 100 pc", retrieved=retrieved("gaia", "gcns_*"), license=ESA_LICENCE,143            url="https://gea.esac.esa.int/tap-server/tap",144            method="dist_50 (kpc) -> pc, dist_16/dist_84 kept as the asymmetric uncertainty",145            citation="Gaia Collaboration, Smart, R. L. et al. (2021). Gaia Early Data Release 3: The Gaia Catalogue of Nearby Stars. A&A 649, A6. " + GAIA_ACK),146        "bailer-jones-2021": dict(147            source="Estimating distances from parallaxes V: geometric distances to Gaia EDR3 sources, table gedr3dist.main of the GAVO Data Center",148            version="Bailer-Jones et al. (2021), geometric r_med_geo / r_lo_geo / r_hi_geo", retrieved=g,149            license="Distributed by the GAVO Data Center (https://dc.g-vo.org/tableinfo/gedr3dist.main); derived from Gaia EDR3 (ESA terms, CC BY-NC 3.0 IGO). Citation of the paper requested.",150            url="https://dc.g-vo.org/tap",151            method="median of the geometric distance posterior with its 16th and 84th percentiles, joined on source_id (the estimate already includes the Lindegren et al. 2021 parallax zero-point correction)",152            citation="Bailer-Jones, C. A. L., Rybizki, J., Fouesneau, M., Demleitner, M., Andrae, R. (2021). AJ 161, 147."),153        "iau-csn": dict(154            source="IAU Catalog of Star Names (IAU-CSN), IAU Division C Working Group on Star Names",155            version="file dated 2022-04-04", retrieved=retrieved("iau"),156            license="Creative Commons Attribution (\"All IAU-produced products ... are released under Creative Commons Attribution\", header of the file)",157            url="https://www.pas.rochester.edu/~emamajek/WGSN/IAU-CSN.txt", method="names attached to Hipparcos numbers",158            citation="IAU Working Group on Star Names, https://www.iau.org/public/themes/naming_stars/"),159        "hyg-v41": dict(160            source="HYG stellar database v4.1 (D. Nash, astronexus)", version="hygdata_v41.csv", retrieved=retrieved("hyg"),161            license="CC BY-SA 4.0 (LICENSE file of the repository)",162            url="https://github.com/astronexus/HYG-Database",163            method="used for cross-identifications only (HR, Bayer, Flamsteed, Gliese, traditional names), attached by Hipparcos number or, for nearby stars without one, by position",164            citation="Nash, D., HYG Database v4.1, https://github.com/astronexus/HYG-Database (CC BY-SA 4.0)."),165    }166167168def register(store, ids):169    table = all_sources()170    for pid in ids:171        store.provenance(pid, **table[pid])172173174def object_sources():175    """Provenance of the non-stellar sources (same fields as all_sources)."""176    from fetch_sources import OPENNGC_TAG, STELLARIUM_TAG177    return {178        "nasa-exoplanet-archive-pscomppars": dict(179            source="NASA Exoplanet Archive, Planetary Systems Composite Parameters (pscomppars)",180            version="live table, state at retrieval", retrieved=retrieved("nea", "pscomppars*"),181            license="No licence statement on the archive's pages (U.S.-government-funded archive operated by Caltech/IPAC). The archive asks for an acknowledgement and for citation of the original references.",182            url="https://exoplanetarchive.ipac.caltech.edu/TAP",183            method="one row per confirmed planet; published errors and limit flags kept; parsecs -> metres for the system distance; no value filled in",184            citation="This research has made use of the NASA Exoplanet Archive, which is operated by the California Institute of Technology, under contract with the National Aeronautics and Space Administration under the Exoplanet Exploration Program. Christiansen et al. (2025). DOI 10.26133/NEA13."),185        "nasa-exoplanet-archive-toi": dict(186            source="NASA Exoplanet Archive, TESS Objects of Interest (toi)",187            version="live table, state at retrieval", retrieved=retrieved("nea", "toi*"),188            license="No licence statement on the archive's pages; acknowledgement requested (see pscomppars).",189            url="https://exoplanetarchive.ipac.caltech.edu/TAP",190            method="every TOI kept with its TFOPWG disposition; these are candidates, not confirmed planets",191            citation="NASA Exoplanet Archive (acknowledgement as above); Guerrero et al. (2021), ApJS 254, 39 (TESS Objects of Interest catalogue). DOI 10.26133/NEA16."),192        "openngc": dict(193            source="OpenNGC (M. Verga): NGC, IC and addendum objects", version=OPENNGC_TAG, retrieved=retrieved("openngc"),194            license="CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/)",195            url="https://github.com/mattiaverga/OpenNGC",196            method="sexagesimal -> radians (J2000); duplicates folded into their target as aliases; non-existent entries dropped",197            citation="OpenNGC, Mattia Verga, https://github.com/mattiaverga/OpenNGC (CC BY-SA 4.0). Built from NED, HyperLEDA, SIMBAD, HEASARC and H. Corwin's NGC/IC notes."),198        "stellarium-modern": dict(199            source="Stellarium, sky culture 'modern': constellation names, figure lines, IAU boundary edges (B1875, after P. Barbier)",200            version=STELLARIUM_TAG, retrieved=retrieved("stellarium"), license="Text and data: CC BY-SA 4.0 (description.md of the sky culture)",201            url="https://github.com/Stellarium/stellarium/tree/%s/skycultures/modern" % STELLARIUM_TAG,202            method="figure vertices resolved to Hipparcos positions; boundary edges interpolated every 0.25 degree along their B1875 parallel or meridian and precessed to J2000 (IAU 1976 precession), validated against VizieR VI/49",203            citation="Stellarium contributors, sky culture 'modern' (CC BY-SA 4.0). Boundaries: Delporte, E. (1930), Délimitation scientifique des constellations."),204        "2mrs": dict(205            source="The 2MASS Redshift Survey (2MRS), catalogue file 2mrs_1175_done.dat", version="2.4 (2011-12-16)",206            retrieved=retrieved("2mrs"),207            license="Terms of the README: redshifts must be cited by their bibliographic code; \"Please do not redistribute any of these files.\"",208            url="http://tdc-www.harvard.edu/2mrs/",209            method="cz (heliocentric, km/s) kept as published, z = cz/c; no distance derived",210            citation="Huchra, J. P. et al. (2012). The 2MASS Redshift Survey — Description and Data Release. ApJS 199, 26."),211        "mcconnachie-2012": dict(212            source="Nearby dwarf galaxies database (A. McConnachie), NearbyGalaxies_Jan2021_PUBLIC.fits", version="2021-01-19 update",213            retrieved=retrieved("localgroup"),214            license="No licence statement; the author distributes the file publicly and asks to cite McConnachie (2012) and the original references.",215            url="https://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/en/community/nearby/",216            method="distance = 10^((m-M)0/5 + 1) pc from the published distance modulus, asymmetric errors propagated; heliocentric velocity kept",217            citation="McConnachie, A. W. (2012). The observed properties of dwarf galaxies in and around the Local Group. AJ 144, 4 (updated compilation, January 2021)."),218        "abell-aco-1989": dict(219            source="A Catalog of Rich Clusters of Galaxies (Abell, Corwin & Olowin 1989), VizieR VII/110A tables 3 and 4",220            version="VII/110A", retrieved=retrieved("vizier", "VII_110A*"),221            license="VizieR catalogue; the CDS rules-of-usage page (https://cds.unistra.fr/vizier-org/licences_vizier.html) was unavailable on the retrieval date, so the terms could not be read.",222            url="https://vizier.cfa.harvard.edu/ftp/cats/VII/110A/",223            method="J2000 positions (hours, minutes) -> radians; redshifts of Struble & Rood (1987) kept as published",224            citation="Abell, G. O., Corwin, H. G., Olowin, R. P. (1989). ApJS 70, 1. This research has made use of the VizieR catalogue access tool, CDS, Strasbourg, France."),225        "jpl-sbdb": dict(226            source="JPL Small-Body Database Query API", version="orbit solutions named per object", retrieved=retrieved("sbdb"),227            license="No licence statement in the API documentation (NASA/JPL-Caltech Solar System Dynamics). Credit requested.",228            url="https://ssd-api.jpl.nasa.gov/doc/sbdb_query.html",229            method="osculating heliocentric ecliptic J2000 elements copied at full precision; numbered asteroids with H <= 10 and numbered comets",230            citation="NASA/JPL-Caltech Solar System Dynamics, Small-Body Database."),231        "celestrak-gp": dict(232            source="CelesTrak GP element sets (OMM JSON), groups stations, visual, gnss, geo", version="snapshot",233            retrieved=retrieved("celestrak"),234            license="No licence statement. CelesTrak usage policy: download a group at most once per data update (2 h), stop on HTTP errors. The elements originate from the U.S. Space Force (18 SDS) via Space-Track.",235            url="https://celestrak.org/NORAD/documentation/gp-data-formats.php",236            method="OMM fields copied unchanged; one object per NORAD catalogue number with the groups it was listed in",237            citation="CelesTrak (T. S. Kelso), https://celestrak.org; orbital data from the 18th Space Defense Squadron."),238    }239
Files main
Menu

Theme