Tutorial 2: Generating Age Probability Distributions for Stars with Gaia Data
In the previous tutorial, we’ve calibrated the age–action spline model using a calibration sample of red giant branch stars with independent, asteroseismic ages.
Now, let’s use that spline model to generate age probabilities for other stars.
[1]:
import numpy as np
import matplotlib.pyplot as plt
import zoomies
%load_ext autoreload
%autoreload 2
Query Gaia
You will need to download the Gaia DR3 data for any stars you’re interested in. You can perform a mass query at https://gea.esac.esa.int/archive/ and read in the resulting table, or you can use astroquery to download the data right from your notebook, as we’ll do here:
[5]:
# Install astroquery if you haven't already!
from astroquery.gaia import Gaia
Gaia.MAIN_GAIA_TABLE = "gaiadr3.gaia_source"
[6]:
# Do your Gaia query or input a table of Gaia data
import astropy.units as u
from astropy.coordinates import SkyCoord
coord = SkyCoord(ra=280, dec=60, unit=(u.degree, u.degree), frame='icrs')
width = u.Quantity(0.5, u.deg)
height = u.Quantity(0.5, u.deg)
r = Gaia.query_object_async(coordinate=coord, width=width, height=height)
INFO: Query finished. [astroquery.utils.tap.core]
[7]:
# Filtering out stars without radial velocity
r = r[~r['radial_velocity'].mask]
Here’s the Gaia data for the couple of stars we’re interested in, as an astropy table:
[8]:
r
[8]:
| dist | solution_id | designation | source_id | random_index | ref_epoch | ra | ra_error | dec | dec_error | parallax | parallax_error | parallax_over_error | pm | pmra | pmra_error | pmdec | pmdec_error | ra_dec_corr | ra_parallax_corr | ra_pmra_corr | ra_pmdec_corr | dec_parallax_corr | dec_pmra_corr | dec_pmdec_corr | parallax_pmra_corr | parallax_pmdec_corr | pmra_pmdec_corr | astrometric_n_obs_al | astrometric_n_obs_ac | astrometric_n_good_obs_al | astrometric_n_bad_obs_al | astrometric_gof_al | astrometric_chi2_al | astrometric_excess_noise | astrometric_excess_noise_sig | astrometric_params_solved | astrometric_primary_flag | nu_eff_used_in_astrometry | pseudocolour | pseudocolour_error | ra_pseudocolour_corr | dec_pseudocolour_corr | parallax_pseudocolour_corr | pmra_pseudocolour_corr | pmdec_pseudocolour_corr | astrometric_matched_transits | visibility_periods_used | astrometric_sigma5d_max | matched_transits | new_matched_transits | matched_transits_removed | ipd_gof_harmonic_amplitude | ipd_gof_harmonic_phase | ipd_frac_multi_peak | ipd_frac_odd_win | ruwe | scan_direction_strength_k1 | scan_direction_strength_k2 | scan_direction_strength_k3 | scan_direction_strength_k4 | scan_direction_mean_k1 | scan_direction_mean_k2 | scan_direction_mean_k3 | scan_direction_mean_k4 | duplicated_source | phot_g_n_obs | phot_g_mean_flux | phot_g_mean_flux_error | phot_g_mean_flux_over_error | phot_g_mean_mag | phot_bp_n_obs | phot_bp_mean_flux | phot_bp_mean_flux_error | phot_bp_mean_flux_over_error | phot_bp_mean_mag | phot_rp_n_obs | phot_rp_mean_flux | phot_rp_mean_flux_error | phot_rp_mean_flux_over_error | phot_rp_mean_mag | phot_bp_rp_excess_factor | phot_bp_n_contaminated_transits | phot_bp_n_blended_transits | phot_rp_n_contaminated_transits | phot_rp_n_blended_transits | phot_proc_mode | bp_rp | bp_g | g_rp | radial_velocity | radial_velocity_error | rv_method_used | rv_nb_transits | rv_nb_deblended_transits | rv_visibility_periods_used | rv_expected_sig_to_noise | rv_renormalised_gof | rv_chisq_pvalue | rv_time_duration | rv_amplitude_robust | rv_template_teff | rv_template_logg | rv_template_fe_h | rv_atm_param_origin | vbroad | vbroad_error | vbroad_nb_transits | grvs_mag | grvs_mag_error | grvs_mag_nb_transits | rvs_spec_sig_to_noise | phot_variable_flag | l | b | ecl_lon | ecl_lat | in_qso_candidates | in_galaxy_candidates | non_single_star | has_xp_continuous | has_xp_sampled | has_rvs | has_epoch_photometry | has_epoch_rv | has_mcmc_gspphot | has_mcmc_msc | in_andromeda_survey | classprob_dsc_combmod_quasar | classprob_dsc_combmod_galaxy | classprob_dsc_combmod_star | teff_gspphot | teff_gspphot_lower | teff_gspphot_upper | logg_gspphot | logg_gspphot_lower | logg_gspphot_upper | mh_gspphot | mh_gspphot_lower | mh_gspphot_upper | distance_gspphot | distance_gspphot_lower | distance_gspphot_upper | azero_gspphot | azero_gspphot_lower | azero_gspphot_upper | ag_gspphot | ag_gspphot_lower | ag_gspphot_upper | ebpminrp_gspphot | ebpminrp_gspphot_lower | ebpminrp_gspphot_upper | libname_gspphot |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| yr | deg | mas | deg | mas | mas | mas | mas / yr | mas / yr | mas / yr | mas / yr | mas / yr | mas | 1 / um | 1 / um | 1 / um | mas | deg | deg | deg | deg | deg | electron / s | electron / s | mag | electron / s | electron / s | mag | electron / s | electron / s | mag | mag | mag | mag | km / s | km / s | d | km / s | K | log(cm.s**-2) | dex | km / s | km / s | mag | mag | deg | deg | deg | deg | K | K | K | log(cm.s**-2) | log(cm.s**-2) | log(cm.s**-2) | dex | dex | dex | pc | pc | pc | mag | mag | mag | mag | mag | mag | mag | mag | mag | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| float64 | int64 | object | int64 | int64 | float64 | float64 | float32 | float64 | float32 | float64 | float32 | float32 | float32 | float64 | float32 | float64 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | int16 | int16 | int16 | int16 | float32 | float32 | float32 | float32 | int16 | bool | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | int16 | int16 | float32 | int16 | int16 | int16 | float32 | float32 | int16 | int16 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | bool | int16 | float64 | float32 | float32 | float32 | int16 | float64 | float32 | float32 | float32 | int16 | float64 | float32 | float32 | float32 | float32 | int16 | int16 | int16 | int16 | int16 | float32 | float32 | float32 | float32 | float32 | int16 | int16 | int16 | int16 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | int16 | float32 | float32 | int16 | float32 | float32 | int16 | float32 | object | float64 | float64 | float64 | float64 | bool | bool | int16 | bool | bool | bool | bool | bool | bool | bool | bool | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | object |
| 0.03294202574628697 | 1636148068921376768 | Gaia DR3 2154901610573844864 | 2154901610573844864 | 241023460 | 2016.0 | 280.0656900806957 | 0.016397906 | 60.00257229273729 | 0.01832858 | 1.4395973611007848 | 0.017703537 | 81.31694 | 4.034647 | -3.781376392246355 | 0.020791428 | -1.4069714152136137 | 0.021559382 | -0.13987689 | -0.17148478 | -0.16272342 | 0.06535884 | 0.28755578 | 0.00486031 | -0.20837094 | -0.15121393 | -0.09816643 | -0.008488968 | 313 | 9 | 312 | 1 | 1.5664704 | 355.76276 | 0.071118824 | 1.6831243 | 31 | False | 1.517273 | -- | -- | -- | -- | -- | -- | -- | 36 | 26 | 0.03028327 | 39 | 16 | 0 | 0.0017206654 | 14.2530775 | 0 | 0 | 1.0627708 | -- | -- | -- | -- | -- | -- | -- | -- | False | 332 | 26596.06625197267 | 6.273805 | 4239.224 | 14.625323 | 34 | 13216.772791953359 | 14.825079 | 891.51447 | 15.035728 | 32 | 18934.12460635135 | 23.005768 | 823.0164 | 14.054783 | 1.2088591 | 0 | 0 | 0 | 1 | 0 | 0.9809456 | 0.41040516 | 0.5705404 | -58.9981 | 3.5211964 | 2 | 20 | 1 | 16 | 5.3412848 | -- | -- | 848.42834 | -- | 5250.0 | 4.0 | 0.0 | 111 | -- | -- | -- | 13.703053 | 0.11823523 | 21 | -- | NOT_AVAILABLE | 89.61278656239459 | 24.619597593406176 | 309.19731087572416 | 82.05259222492064 | False | False | 0 | True | True | False | False | False | True | True | False | 1.0310119e-13 | 5.149859e-13 | 0.9998932 | 5379.0903 | 5362.152 | 5393.7485 | 4.5733 | 4.5648 | 4.5806 | 0.0485 | 0.0305 | 0.0648 | 652.7858 | 646.5188 | 660.3986 | 0.1392 | 0.1265 | 0.15 | 0.1137 | 0.1033 | 0.1226 | 0.0603 | 0.0548 | 0.065 | MARCS |
| 0.034378304381720556 | 1636148068921376768 | Gaia DR3 2154901988530967552 | 2154901988530967552 | 1404810341 | 2016.0 | 280.0194041542316 | 0.015531355 | 60.03298871744937 | 0.01771612 | 0.5369007191849855 | 0.017558102 | 30.578518 | 4.8870983 | -4.8768787205310264 | 0.019893862 | -0.31588292766908044 | 0.021310652 | -0.10731452 | -0.23620193 | -0.11497756 | 0.05939605 | 0.29391325 | -0.023874374 | -0.18965203 | -0.24747391 | -0.037051436 | 0.10042425 | 280 | 0 | 277 | 3 | 0.33902383 | 288.02304 | 0.03911611 | 0.55264676 | 31 | False | 1.5930966 | -- | -- | -- | -- | -- | -- | -- | 32 | 25 | 0.030482063 | 36 | 15 | 0 | 0.00040681817 | 32.448666 | 1 | 0 | 1.0133395 | 0.20663822 | 0.0930223 | 0.08154183 | 0.031603187 | -136.6344 | 84.516 | 8.542825 | 8.555851 | False | 300 | 30990.814155148175 | 9.8583145 | 3143.622 | 14.459285 | 32 | 17775.656355814244 | 20.999525 | 846.47894 | 14.713978 | 33 | 19015.991510360494 | 19.759075 | 962.3928 | 14.050098 | 1.1871791 | 0 | 0 | 0 | 0 | 0 | 0.6638794 | 0.25469303 | 0.40918636 | 29.453352 | 10.561475 | 2 | 14 | 3 | 13 | 3.9535046 | -- | -- | 788.70197 | -- | 6000.0 | 2.5 | -0.75 | 111 | -- | -- | -- | 14.051752 | 0.13647689 | 12 | -- | NOT_AVAILABLE | 89.6401909216361 | 24.648574475550223 | 309.16325479158144 | 82.09051468241744 | False | False | 0 | True | True | False | False | False | True | True | False | 1.0282279e-13 | 5.135947e-13 | 0.9999208 | 6483.586 | 6460.9736 | 6514.4473 | 4.0976 | 4.0761 | 4.1173 | -0.4975 | -0.517 | -0.479 | 1753.8871 | 1703.02 | 1810.7133 | 0.1891 | 0.1782 | 0.2041 | 0.1644 | 0.1548 | 0.1776 | 0.089 | 0.0838 | 0.0961 | MARCS |
Calculate Jz
You now need to calculate ln(Jz) (log of vertical action) for each Gaia star. The star must have a radial velocity. (Make sure you check the number of stars that have radial velocities from Gaia for the sample you’re interested in.)
TODO: You must input a table with at least two rows. It doesn’t work if you just input one row of Gaia data.
[9]:
# This function returns a table with three new
# columns for the action angles at the end: Jz, Jphi, and Jtheta
# This line may take a while for very large tables.
r_actions = zoomies.calc_jz(r)
r_actions
/opt/anaconda3/envs/zoomies_test_3/lib/python3.14/site-packages/gala/potential/potential/builtin/special.py:257: GalaFutureWarning: The MilkyWayPotential2022 class will be deprecated soon. Instead, use: MilkyWayPotential(version="v2") to get what is currently the MilkyWayPotential2022 class. Or, to always use the latest Milky Way model in Gala, you can call the class with no arguments MilkyWayPotential() or specify MilkyWayPotential(version="latest")
warnings.warn(
Calculating actions with galpy...
[9]:
| dist | solution_id | designation | source_id | random_index | ref_epoch | ra | ra_error | dec | dec_error | parallax | parallax_error | parallax_over_error | pm | pmra | pmra_error | pmdec | pmdec_error | ra_dec_corr | ra_parallax_corr | ra_pmra_corr | ra_pmdec_corr | dec_parallax_corr | dec_pmra_corr | dec_pmdec_corr | parallax_pmra_corr | parallax_pmdec_corr | pmra_pmdec_corr | astrometric_n_obs_al | astrometric_n_obs_ac | astrometric_n_good_obs_al | astrometric_n_bad_obs_al | astrometric_gof_al | astrometric_chi2_al | astrometric_excess_noise | astrometric_excess_noise_sig | astrometric_params_solved | astrometric_primary_flag | nu_eff_used_in_astrometry | pseudocolour | pseudocolour_error | ra_pseudocolour_corr | dec_pseudocolour_corr | parallax_pseudocolour_corr | pmra_pseudocolour_corr | pmdec_pseudocolour_corr | astrometric_matched_transits | visibility_periods_used | astrometric_sigma5d_max | matched_transits | new_matched_transits | matched_transits_removed | ipd_gof_harmonic_amplitude | ipd_gof_harmonic_phase | ipd_frac_multi_peak | ipd_frac_odd_win | ruwe | scan_direction_strength_k1 | scan_direction_strength_k2 | scan_direction_strength_k3 | scan_direction_strength_k4 | scan_direction_mean_k1 | scan_direction_mean_k2 | scan_direction_mean_k3 | scan_direction_mean_k4 | duplicated_source | phot_g_n_obs | phot_g_mean_flux | phot_g_mean_flux_error | phot_g_mean_flux_over_error | phot_g_mean_mag | phot_bp_n_obs | phot_bp_mean_flux | phot_bp_mean_flux_error | phot_bp_mean_flux_over_error | phot_bp_mean_mag | phot_rp_n_obs | phot_rp_mean_flux | phot_rp_mean_flux_error | phot_rp_mean_flux_over_error | phot_rp_mean_mag | phot_bp_rp_excess_factor | phot_bp_n_contaminated_transits | phot_bp_n_blended_transits | phot_rp_n_contaminated_transits | phot_rp_n_blended_transits | phot_proc_mode | bp_rp | bp_g | g_rp | radial_velocity | radial_velocity_error | rv_method_used | rv_nb_transits | rv_nb_deblended_transits | rv_visibility_periods_used | rv_expected_sig_to_noise | rv_renormalised_gof | rv_chisq_pvalue | rv_time_duration | rv_amplitude_robust | rv_template_teff | rv_template_logg | rv_template_fe_h | rv_atm_param_origin | vbroad | vbroad_error | vbroad_nb_transits | grvs_mag | grvs_mag_error | grvs_mag_nb_transits | rvs_spec_sig_to_noise | phot_variable_flag | l | b | ecl_lon | ecl_lat | in_qso_candidates | in_galaxy_candidates | non_single_star | has_xp_continuous | has_xp_sampled | has_rvs | has_epoch_photometry | has_epoch_rv | has_mcmc_gspphot | has_mcmc_msc | in_andromeda_survey | classprob_dsc_combmod_quasar | classprob_dsc_combmod_galaxy | classprob_dsc_combmod_star | teff_gspphot | teff_gspphot_lower | teff_gspphot_upper | logg_gspphot | logg_gspphot_lower | logg_gspphot_upper | mh_gspphot | mh_gspphot_lower | mh_gspphot_upper | distance_gspphot | distance_gspphot_lower | distance_gspphot_upper | azero_gspphot | azero_gspphot_lower | azero_gspphot_upper | ag_gspphot | ag_gspphot_lower | ag_gspphot_upper | ebpminrp_gspphot | ebpminrp_gspphot_lower | ebpminrp_gspphot_upper | libname_gspphot | Jz | Jphi | Jr |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| yr | deg | mas | deg | mas | mas | mas | mas / yr | mas / yr | mas / yr | mas / yr | mas / yr | mas | 1 / um | 1 / um | 1 / um | mas | deg | deg | deg | deg | deg | electron / s | electron / s | mag | electron / s | electron / s | mag | electron / s | electron / s | mag | mag | mag | mag | km / s | km / s | d | km / s | K | log(cm.s**-2) | dex | km / s | km / s | mag | mag | deg | deg | deg | deg | K | K | K | log(cm.s**-2) | log(cm.s**-2) | log(cm.s**-2) | dex | dex | dex | pc | pc | pc | mag | mag | mag | mag | mag | mag | mag | mag | mag | km kpc / s | km kpc / s | km kpc / s | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| float64 | int64 | object | int64 | int64 | float64 | float64 | float32 | float64 | float32 | float64 | float32 | float32 | float32 | float64 | float32 | float64 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | int16 | int16 | int16 | int16 | float32 | float32 | float32 | float32 | int16 | bool | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | int16 | int16 | float32 | int16 | int16 | int16 | float32 | float32 | int16 | int16 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | bool | int16 | float64 | float32 | float32 | float32 | int16 | float64 | float32 | float32 | float32 | int16 | float64 | float32 | float32 | float32 | float32 | int16 | int16 | int16 | int16 | int16 | float32 | float32 | float32 | float32 | float32 | int16 | int16 | int16 | int16 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | int16 | float32 | float32 | int16 | float32 | float32 | int16 | float32 | object | float64 | float64 | float64 | float64 | bool | bool | int16 | bool | bool | bool | bool | bool | bool | bool | bool | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | object | float64 | float64 | float64 |
| 0.03294202574628697 | 1636148068921376768 | Gaia DR3 2154901610573844864 | 2154901610573844864 | 241023460 | 2016.0 | 280.0656900806957 | 0.016397906 | 60.00257229273729 | 0.01832858 | 1.4395973611007848 | 0.017703537 | 81.31694 | 4.034647 | -3.781376392246355 | 0.020791428 | -1.4069714152136137 | 0.021559382 | -0.13987689 | -0.17148478 | -0.16272342 | 0.06535884 | 0.28755578 | 0.00486031 | -0.20837094 | -0.15121393 | -0.09816643 | -0.008488968 | 313 | 9 | 312 | 1 | 1.5664704 | 355.76276 | 0.071118824 | 1.6831243 | 31 | False | 1.517273 | -- | -- | -- | -- | -- | -- | -- | 36 | 26 | 0.03028327 | 39 | 16 | 0 | 0.0017206654 | 14.2530775 | 0 | 0 | 1.0627708 | -- | -- | -- | -- | -- | -- | -- | -- | False | 332 | 26596.06625197267 | 6.273805 | 4239.224 | 14.625323 | 34 | 13216.772791953359 | 14.825079 | 891.51447 | 15.035728 | 32 | 18934.12460635135 | 23.005768 | 823.0164 | 14.054783 | 1.2088591 | 0 | 0 | 0 | 1 | 0 | 0.9809456 | 0.41040516 | 0.5705404 | -58.9981 | 3.5211964 | 2 | 20 | 1 | 16 | 5.3412848 | -- | -- | 848.42834 | -- | 5250.0 | 4.0 | 0.0 | 111 | -- | -- | -- | 13.703053 | 0.11823523 | 21 | -- | NOT_AVAILABLE | 89.61278656239459 | 24.619597593406176 | 309.19731087572416 | 82.05259222492064 | False | False | 0 | True | True | False | False | False | True | True | False | 1.0310119e-13 | 5.149859e-13 | 0.9998932 | 5379.0903 | 5362.152 | 5393.7485 | 4.5733 | 4.5648 | 4.5806 | 0.0485 | 0.0305 | 0.0648 | 652.7858 | 646.5188 | 660.3986 | 0.1392 | 0.1265 | 0.15 | 0.1137 | 0.1033 | 0.1226 | 0.0603 | 0.0548 | 0.065 | MARCS | 3.530247057416689 | -1627.3115601530285 | 24.777721413012102 |
| 0.034378304381720556 | 1636148068921376768 | Gaia DR3 2154901988530967552 | 2154901988530967552 | 1404810341 | 2016.0 | 280.0194041542316 | 0.015531355 | 60.03298871744937 | 0.01771612 | 0.5369007191849855 | 0.017558102 | 30.578518 | 4.8870983 | -4.8768787205310264 | 0.019893862 | -0.31588292766908044 | 0.021310652 | -0.10731452 | -0.23620193 | -0.11497756 | 0.05939605 | 0.29391325 | -0.023874374 | -0.18965203 | -0.24747391 | -0.037051436 | 0.10042425 | 280 | 0 | 277 | 3 | 0.33902383 | 288.02304 | 0.03911611 | 0.55264676 | 31 | False | 1.5930966 | -- | -- | -- | -- | -- | -- | -- | 32 | 25 | 0.030482063 | 36 | 15 | 0 | 0.00040681817 | 32.448666 | 1 | 0 | 1.0133395 | 0.20663822 | 0.0930223 | 0.08154183 | 0.031603187 | -136.6344 | 84.516 | 8.542825 | 8.555851 | False | 300 | 30990.814155148175 | 9.8583145 | 3143.622 | 14.459285 | 32 | 17775.656355814244 | 20.999525 | 846.47894 | 14.713978 | 33 | 19015.991510360494 | 19.759075 | 962.3928 | 14.050098 | 1.1871791 | 0 | 0 | 0 | 0 | 0 | 0.6638794 | 0.25469303 | 0.40918636 | 29.453352 | 10.561475 | 2 | 14 | 3 | 13 | 3.9535046 | -- | -- | 788.70197 | -- | 6000.0 | 2.5 | -0.75 | 111 | -- | -- | -- | 14.051752 | 0.13647689 | 12 | -- | NOT_AVAILABLE | 89.6401909216361 | 24.648574475550223 | 309.16325479158144 | 82.09051468241744 | False | False | 0 | True | True | False | False | False | True | True | False | 1.0282279e-13 | 5.135947e-13 | 0.9999208 | 6483.586 | 6460.9736 | 6514.4473 | 4.0976 | 4.0761 | 4.1173 | -0.4975 | -0.517 | -0.479 | 1753.8871 | 1703.02 | 1810.7133 | 0.1891 | 0.1782 | 0.2041 | 0.1644 | 0.1548 | 0.1776 | 0.089 | 0.0838 | 0.0961 | MARCS | 49.70225373350188 | -2209.7850153513127 | 83.49405970242807 |
Age-Jz Relation Calibrated on RGB ages
We previously calibrated an age–vertical action spline model in Tutorial 1, and saved it in the "RGB_spline_model" directory. Let’s read that model back in here.
Alternatively, you can download the folder from Zenodo: 10.5281/zenodo.10048927
[10]:
spline_direct = "../RGB_spline_model/"
# Reading the pre-calibrated spline model back in
RGB_spline = zoomies.read(directory=spline_direct)
The KinematicAgeSpline.evaluate_ages() function evaluates dynamical ages for the ln(Jz) values in our table.
[11]:
# this function evaluates age predictions for a set of ln(Jz) values.
eval_grid, starRGB_eval_pdf = RGB_spline.evaluate_ages(np.log(r_actions['Jz']), eval_grid=np.linspace(0, 14, 1000))
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 1515.01it/s]
This is the age probabiltiy distribution for the first star in our Gaia table:
[12]:
plt.plot(eval_grid, starRGB_eval_pdf[0])
plt.xlabel('Age gyr')
plt.ylabel('PDF')
plt.title('lnJz = ' + str((np.log(r_actions['Jz'][0]))))
[12]:
Text(0.5, 1.0, 'lnJz = 1.2613678564329032')
And here it is for the second star:
[13]:
# this is the age prediction for the second star in the table
plt.plot(eval_grid, starRGB_eval_pdf[1])
plt.xlabel('Age gyr')
plt.ylabel('PDF')
plt.title('lnJz = ' + str((np.log(r_actions['Jz'][1]))))
[13]:
Text(0.5, 1.0, 'lnJz = 3.906050278824991')
[ ]: