This repo contains the code required to measure the radial and vertical velocity dispersion of stars in the Milky Way disc as a function of age, using APOGEE-Gaia and the APOKASC catalogue. This code generates all the figures and age catalogues which are included in the paper "Dynamical heating across the Milky Way disc using APOGEE and Gaia" (Mackereth et al. 2019). The code here is provided for 'illustration only' purposes and will not be supported/maintained but should allow users to reproduce the main results of that paper.
The code will require a proper installation of the apogee and galpy python packages and the astroNN python machine learning package in order to run. It also requires the usual matplotlib, scipy, numpy, astropy etc.
In order to generate the age catalogue which is required to fit the velocity dispersion models (as in the paper), users must first work through the astroNN_ages.ipynb notebook. You may need to locate and download the APOKASC-2 catalogue, which forms the training data for the BCNN (auto-downloading of this data will be added soon!).
Alternatively, users may wish to skip this step, and download the age catalogue directly from zenodo, here (coming soon!).
Once the age catalogue is generated and saved to the appropriate location (/sav), the actual modelling of the velocity distribution for mono-age, mono-[Fe/H] populations can begin. The first set of models is fit by running :
python fit_monoage.py --model-type=ellipsoid ellipsoid_output.npy
which can take a considerable amount of time to run (be warned!).
Secondly, users should also fit the varying v_0 models, which are discussed later in the paper:
python fit_monoage.py --model-type=ellipsoidvaryvo ellipsoidvaryvo_output.npy
Once the age catalogue and modelling are complete, the main paper figures can be generated by working through the dynamical_heating.ipynb notebook. Enjoy!