Skip to main content

Stellar age prediction via gyrochronology with Bayesian posterior reweighting

Project description

GyroNet

Stellar age prediction via gyrochronology. GyroNet takes a star's rotation period and color, optionally combined with auxiliary Gaia features, and returns a full posterior over its age using a Bayesian ensemble with adaptive out-of-distribution protection.

Installation

pip install gyronet

Or from source:

git clone https://github.com/26amitdethe/GyroNet.git
cd GyroNet
pip install -e .

Quickstart

Option 1: All auxiliary features provided

For the most accurate predictions, provide the full set of Gaia DR3 auxiliary features alongside the core inputs. With fetch=False, no network call is made. If you've already supplied the aux columns, GyroNet won't query Gaia. (Note: fetch only ever triggers when a GaiaDR3_ID is given; if none of the optional columns are needed, its value is irrelevant.)

import gyronet

posterior = gyronet.predict(
    Prot=6.312,
    BPRP_0=1.042798386,
    e_BPRP_0=0.01570765184,
    phot_bp_rp_excess_factor=1.2295822,
    astrometric_excess_noise_sig=0.0,
    G_0=13.87433119,
    parallax=2.471274462,
    fetch=False,
)

print(f"Peak age : {posterior.peak():.1f} Myr")
print(f"Median age : {posterior.median():.1f} Myr")
print(f"68% CI : {posterior.credible_interval(0.68)}")

Option 2: Required inputs + Gaia DR3 ID, auto-fetch enabled

If you know the Gaia DR3 source ID, GyroNet can fetch the auxiliary features from the Gaia archive automatically. This requires an internet connection.

import gyronet

posterior = gyronet.predict(
    Prot=6.312,
    BPRP_0=1.042798386,
    e_BPRP_0=0.01570765184,
    GaiaDR3_ID=5290651323511794816,
    fetch=True,
)

print(f"Peak age : {posterior.peak():.1f} Myr")
print(f"Median age : {posterior.median():.1f} Myr")
print(f"68% CI : {posterior.credible_interval(0.68)}")

Option 3: Required inputs only (baseline model)

If you only have the rotation period and color, GyroNet will still produce a prediction using the baseline model alone. This skips the auxiliary-feature reweighting that sharpens and calibrates Option 1/2 predictions, so the resulting posterior will generally be less precise.

import gyronet

posterior = gyronet.predict(
    Prot=6.312,
    BPRP_0=1.042798386,
    e_BPRP_0=0.01570765184,
    fetch=False,
)

print(f"Peak age : {posterior.peak():.1f} Myr")
print(f"Median age : {posterior.median():.1f} Myr")
print(f"68% CI : {posterior.credible_interval(0.68)}")

Documentation

Method

GyroNet architecture

The shipped ensemble averages three posteriors derived from two trained Neural Spline Flow models and two Bayesian reweighting strategies over Gaia DR3 auxiliary features:

  1. Precision-Weighted Flow + Cluster-Kernel Likelihood, Reliability-Masked — a flow trained with a precision-weighted loss, reweighted by a likelihood built from a Gaussian kernel smoother over per-cluster feature statistics, and gated by an adaptive reliability mask.
  2. Baseline Flow + Learned Likelihood, Reliability-Masked — the baseline flow, reweighted by learned MLP likelihoods of the noise features, with the same reliability mask.
  3. Baseline Flow + Tempered Learned Likelihood (T=0.7) — the baseline flow reweighted by the same learned likelihoods with a constant gentler temperature.

The Reliability Mask protects against out-of-distribution stars (for example, very nearby clusters whose proximity-driven photometric artifacts can mimic youth).

Citation

If you use GyroNet in your research, please cite: (placeholder — paper in prep).

The training catalogue bundled in training/eda_output_clean.csv is a derived version of the rotation-period catalogue from Van-Lane et al. (2025), ChronoFlow: A Neural Spline Flow Framework for Gyrochronology. The original catalogue is MIT-licensed; this repository redistributes a version enriched with additional Gaia DR3 auxiliary columns. See training/README.md for full data attribution.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gyronet-0.1.0.tar.gz (343.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gyronet-0.1.0-py3-none-any.whl (340.9 kB view details)

Uploaded Python 3

File details

Details for the file gyronet-0.1.0.tar.gz.

File metadata

  • Download URL: gyronet-0.1.0.tar.gz
  • Upload date:
  • Size: 343.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gyronet-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d9301703a048ebde4ead3971f8f40b111ddf382a272dd0633dd5e4773e22cc39
MD5 7d6bc2bf8dd3afa12e853e19fb38a13b
BLAKE2b-256 b53eedcddcf120f7c82d98c31f6607ea2d5a22311600582f1d02e79ac5f57811

See more details on using hashes here.

Provenance

The following attestation bundles were made for gyronet-0.1.0.tar.gz:

Publisher: publish.yml on 26amitdethe/GyroNet

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gyronet-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: gyronet-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 340.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gyronet-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e9d02a67d535d4e02f412d37de6637636fca4a4556a380bcb25494aa6b422411
MD5 322cc7ce069ca5454bfee065a5671ef5
BLAKE2b-256 b83703392a0be867436d8770dbef96479a13ceaa48bc39797f98fbb92fe16266

See more details on using hashes here.

Provenance

The following attestation bundles were made for gyronet-0.1.0-py3-none-any.whl:

Publisher: publish.yml on 26amitdethe/GyroNet

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page