Skip to main content

gyrointerp

Purpose

Observations have shown that stars with the same age and mass can have a wide range of rotation periods. The purpose of this code is to compute the posterior probability for a star's age given its observed rotation period and effective temperature. This is achieved by marginalizing over all possible ages that might explain the observed stellar properties with a parametric model that has been fitted to not only the mean rotation periods, but also the intrinsic scatter in observed open cluster rotation sequences.

Documentation

The documentation is hosted at gyro-interp.readthedocs.io. A minimal example to get you started is below. The method is described in detail in Bouma, Palumbo & Hillenbrand (2023).

Install

Preferred installation method is through PyPI:

pip install gyrointerp

Minimal Examples

Given a star's rotation period, effective temperature, and uncertainties, what is the gyrochronological age posterior over a grid spanning 0 to 2.6 Gyr?

  import numpy as np
  from gyrointerp import gyro_age_posterior

  # units: days
  Prot, Prot_err = 11, 0.2

  # units: kelvin
  Teff, Teff_err = 4500, 100

  # uniformly spaced grid between 0 and 2600 megayears
  age_grid = np.linspace(0, 2600, 500)

  # calculate the age posterior - takes ~30 seconds
  age_posterior = gyro_age_posterior(
      Prot, Teff, Prot_err=Prot_err, Teff_err=Teff_err, age_grid=age_grid
  )

  # calculate dictionary of summary statistics
  from gyrointerp import get_summary_statistics
  result = get_summary_statistics(age_grid, age_posterior)

  print(f"Age = {result['median']} +{result['+1sigma']} -{result['-1sigma']} Myr.")

If you were interested in a slower-rotating star that might be closer to 4 Gyr old, which is the oldest age out to which gyro-interp is calibrated, you could modify the following lines:

  age_grid = np.linspace(0, 5000, 500)

  age_posterior = gyro_age_posterior(
      Prot, Teff, Prot_err=Prot_err, Teff_err=Teff_err, age_grid=age_grid, 
      verbose=False, bounds_error='4gyrextrap'
  )

⚠️ Please do not use this code to try to infer ages of stars older than 4 Gyr. This is gyrochronology by interpolation. The extrapolation model invoked by using bounds_error='4gyrextrap' has no physical content beyond 4 Gyr.

The documentation contains more extensive examples, as well as discussion of important caveats.

Attribution

If you use the code in your work, please reference

@ARTICLE{2023ApJ...947L...3B,
       author = {{Bouma}, Luke G. and {Palumbo}, Elsa K. and {Hillenbrand}, Lynne A.},
        title = "{The Empirical Limits of Gyrochronology}",
      journal = {\apjl},
     keywords = {Stellar ages, Stellar rotation, Field stars, Bayesian statistics, 1581, 1629, 2103, 1900, Astrophysics - Solar and Stellar Astrophysics, Astrophysics - Instrumentation and Methods for Astrophysics},
         year = 2023,
        month = apr,
       volume = {947},
       number = {1},
          eid = {L3},
        pages = {L3},
          doi = {10.3847/2041-8213/acc589},
archivePrefix = {arXiv},
       eprint = {2303.08830},
 primaryClass = {astro-ph.SR},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2023ApJ...947L...3B},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

If your result is particularly dependent on the rotation data from any one cluster, we also encourage you to refer to the relevant study:

Metadata

Release files for gyrointerp 0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gyrointerp 0.8
File Size Uploaded Provenance Actions
gyrointerp-0.8.tar.gz 13.3 MB Without provenance Details for gyrointerp-0.8.tar.gz

Release files / gyrointerp-0.8.tar.gz

Download URL gyrointerp-0.8.tar.gz
Size 13.3 MB
Tags Source
SHA-256 checksum
How to use checksums
8b92cd8d3a13fcc63f5995148ce0139282b61f3f4c5630a435b488c0b7bebfa5
BLAKE2b-256 checksum
How to use checksums
873080ab7a3f5200296d621566fffecb9b78f5575563cb619b35b9c781d69b36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Security for gyrointerp 0.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.8 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page