{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "c5a9be36", "metadata": { "execution": { "iopub.execute_input": "2024-09-30T14:48:27.312422Z", "iopub.status.busy": "2024-09-30T14:48:27.312202Z", "iopub.status.idle": "2024-09-30T14:48:27.707950Z", "shell.execute_reply": "2024-09-30T14:48:27.707178Z" }, "nbsphinx": "hidden" }, "outputs": [], "source": [ "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": 2, "id": "69a01195", "metadata": { "execution": { "iopub.execute_input": "2024-09-30T14:48:27.710353Z", "iopub.status.busy": "2024-09-30T14:48:27.710046Z", "iopub.status.idle": "2024-09-30T14:48:27.718566Z", "shell.execute_reply": "2024-09-30T14:48:27.717985Z" }, "nbsphinx": "hidden" }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/home/runner/work/gala/gala/docs/tutorials/nb_setup:1: DeprecationWarning: `magic(...)` is deprecated since IPython 0.13 (warning added in 8.1), use run_line_magic(magic_name, parameter_s).\n", " get_ipython().magic('config InlineBackend.figure_format = \"retina\"') # noqa\n" ] } ], "source": [ "%run nb_setup" ] }, { "cell_type": "markdown", "id": "f1156cb4", "metadata": {}, "source": [ "# Defining a Milky Way potential model" ] }, { "cell_type": "code", "execution_count": 3, "id": "0a7d823b", "metadata": { "execution": { "iopub.execute_input": "2024-09-30T14:48:27.720558Z", "iopub.status.busy": "2024-09-30T14:48:27.720349Z", "iopub.status.idle": "2024-09-30T14:48:28.322989Z", "shell.execute_reply": "2024-09-30T14:48:28.322218Z" } }, "outputs": [], "source": [ "# Third-party dependencies\n", "import astropy.units as u\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "from astropy.io import ascii\n", "from scipy.optimize import leastsq\n", "\n", "# Gala\n", "import gala.potential as gp\n", "from gala.units import galactic\n" ] }, { "cell_type": "markdown", "id": "ce029bfb", "metadata": {}, "source": [ "## Introduction\n", "\n", "`gala` provides a simple and easy way to access and integrate orbits in an\n", "approximate mass model for the Milky Way. The parameters of the mass model are\n", "determined by least-squares fitting the enclosed mass profile of a pre-defined\n", "potential form to recent measurements compiled from the literature. These\n", "measurements are provided with the documentation of `gala` and are shown\n", "below. The radius units are kpc, and mass units are solar masses:" ] }, { "cell_type": "code", "execution_count": 4, "id": "d4483974", "metadata": { "execution": { "iopub.execute_input": "2024-09-30T14:48:28.325721Z", "iopub.status.busy": "2024-09-30T14:48:28.325195Z", "iopub.status.idle": "2024-09-30T14:48:28.335526Z", "shell.execute_reply": "2024-09-30T14:48:28.334899Z" } }, "outputs": [], "source": [ "tbl = ascii.read(\"data/MW_mass_enclosed.csv\")" ] }, { "cell_type": "code", "execution_count": 5, "id": "9683e2c0", "metadata": { "execution": { "iopub.execute_input": "2024-09-30T14:48:28.337719Z", "iopub.status.busy": "2024-09-30T14:48:28.337474Z", "iopub.status.idle": "2024-09-30T14:48:28.344203Z", "shell.execute_reply": "2024-09-30T14:48:28.343662Z" } }, "outputs": [ { "data": { "text/html": [ "
r | Menc | Menc_err_neg | Menc_err_pos | ref |
---|---|---|---|---|
float64 | float64 | float64 | float64 | str27 |
0.01 | 30000000.0 | 10000000.0 | 10000000.0 | Feldmeier et al. (2014) |
0.12 | 800000000.0 | 200000000.0 | 200000000.0 | Launhardt et al. (2002) |
8.1 | 89502860861.52429 | 4994562473.797714 | 4858963492.608627 | Bovy et al. (2012) |
8.3 | 110417867208.19055 | 4475949382.696884 | 4387023236.020782 | McMillan (2011) |
8.4 | 102421035406.90356 | 16733918715.629944 | 15468328224.531876 | Koposov et al. (2010) |
19.0 | 208023299175.30438 | 44317988008.38101 | 34833267089.920685 | Kuepper et al. (2015) |
50.0 | 539884832748.48975 | 19995734543.31433 | 268490735257.4718 | Wilkinson & Evans (1999) |
50.0 | 529886965173.18726 | 9997867269.659302 | 38536752776.21277 | Sakamoto et al. (2003) |
50.0 | 399914690706.92847 | 109976539940.53711 | 72696676468.2511 | Smith et al. (2007) |
50.0 | 419910425325.7268 | 39991469076.968506 | 38172735113.64386 | Deason et al. (2012) |
60.0 | 399914690957.5188 | 69985070910.63354 | 64344945146.92987 | Xue et al. (2008) |
80.0 | 689852841359.0248 | 299936018002.3314 | 110361048549.1029 | Gnedin et al. (2010) |
100.0 | 1399701417307.7747 | 899808054059.3811 | 831336271726.1903 | Watkins et al. (2010) |
120.0 | 539884832260.29584 | 199957345314.72906 | 123854764645.32489 | Battaglia et al. (2005) |
150.0 | 750000000000.0 | 250000000000.0 | 250000000000.0 | Deason et al. (2012) |
200.0 | 679854974257.2006 | 409912558030.05396 | 313652012195.06256 | Bhattacherjee et al. (2014) |