Skip to content

Commit

Permalink
tidying
Browse files Browse the repository at this point in the history
  • Loading branch information
adrn committed Jan 25, 2019
1 parent ea75542 commit bc3ac67
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 57 deletions.
2 changes: 0 additions & 2 deletions .rtd-environment.yml
Expand Up @@ -2,7 +2,6 @@ name: gala

channels:
- astropy
- asmeurer

dependencies:
- python==3.6
Expand All @@ -17,7 +16,6 @@ dependencies:
- jupyter
- notebook
- ipykernel
- gsl=1.16
- pip:
- nbsphinx==0.3.1
- sphinx_astropy
46 changes: 14 additions & 32 deletions docs/examples/Milky-Way-model.ipynb
Expand Up @@ -11,9 +11,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"`gala` provides a simple mass model for the Milky Way based on recent measurements of the enclosed mass compiled from the literature. See the [Defining a Milky Way potential model](../potential/define-milky-way-model.ipynb) documentation for more information about how this model was defined. New as of v0.4, `gala` also contains an implementation of Bovy's [MWPotential2014](https://galpy.readthedocs.io/en/latest/potential.html) model.\n",
"`gala` provides a simple mass model for the Milky Way based on recent measurements of the enclosed mass compiled from the literature. See the [Defining a Milky Way potential model](../potential/define-milky-way-model.ipynb) documentation for more information about how this model was defined.\n",
"\n",
"In this example, we'll use the position and velocity and uncertainties of the Milky Way satellite galaxy \"Draco\" to integrate orbits in a Milky Way mass model starting from samples from the error distribution over initial conditions defined by its observed kinematics. We'll then compute distributions of orbital properties like orbital period, pericenter, and eccentricity in both the `gala` Milky Way model and `MWPotential2014`."
"In this example, we'll use the position and velocity and uncertainties of the Milky Way satellite galaxy \"Draco\" to integrate orbits in a Milky Way mass model starting from samples from the error distribution over initial conditions defined by its observed kinematics. We'll then compute distributions of orbital properties like orbital period, pericenter, and eccentricity."
]
},
{
Expand Down Expand Up @@ -77,10 +77,10 @@
" pm_dec=-0.1673*u.mas/u.yr,\n",
" radial_velocity=-291*u.km/u.s)\n",
"\n",
"icrs_err = coord.ICRS(ra=0*u.deg, dec=0*u.deg, distance=6*u.kpc,\n",
" pm_ra_cosdec=0.009*u.mas/u.yr,\n",
" pm_dec=0.009*u.mas/u.yr,\n",
" radial_velocity=0.1*u.km/u.s)"
"icrs_err = coord.SkyCoord(ra=0*u.deg, dec=0*u.deg, distance=6*u.kpc,\n",
" pm_ra_cosdec=0.009*u.mas/u.yr,\n",
" pm_dec=0.009*u.mas/u.yr,\n",
" radial_velocity=0.1*u.km/u.s)"
]
},
{
Expand All @@ -97,7 +97,7 @@
"outputs": [],
"source": [
"v_sun = coord.CartesianDifferential([11.1, 250, 7.25]*u.km/u.s)\n",
"gc_frame = coord.Galactocentric(galcen_distance=8.3*u.kpc,\n",
"gc_frame = coord.Galactocentric(galcen_distance=8.1*u.kpc,\n",
" z_sun=0*u.pc,\n",
" galcen_v_sun=v_sun)"
]
Expand Down Expand Up @@ -139,7 +139,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's also compute the orbit in Bovy's `MWPotential2014`:"
"Let's visualize the orbit:"
]
},
{
Expand All @@ -148,25 +148,7 @@
"metadata": {},
"outputs": [],
"source": [
"mw2014 = gp.BovyMWPotential2014()\n",
"orbit_mw2014 = mw2014.integrate_orbit(w0, dt=-0.5*u.Myr, n_steps=10000)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's visualize the orbits:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"fig = orbit.plot()\n",
"_ = orbit_mw2014.plot(axes=fig.axes)"
"fig = orbit.plot()"
]
},
{
Expand Down Expand Up @@ -251,9 +233,9 @@
"metadata": {},
"outputs": [],
"source": [
"icrs_samples = coord.ICRS(ra=ra, dec=dec, distance=dist,\n",
" pm_ra_cosdec=pm_ra_cosdec,\n",
" pm_dec=pm_dec, radial_velocity=rv)"
"icrs_samples = coord.SkyCoord(ra=ra, dec=dec, distance=dist,\n",
" pm_ra_cosdec=pm_ra_cosdec,\n",
" pm_dec=pm_dec, radial_velocity=rv)"
]
},
{
Expand All @@ -271,7 +253,7 @@
"metadata": {},
"outputs": [],
"source": [
"gc_samples = icrs_samples.transform_to(gc_frame)"
"galcen_samples = icrs_samples.transform_to(gc_frame)"
]
},
{
Expand All @@ -280,7 +262,7 @@
"metadata": {},
"outputs": [],
"source": [
"w0_samples = gd.PhaseSpacePosition(gc_samples.data)\n",
"w0_samples = gd.PhaseSpacePosition(galcen_samples.data)\n",
"orbit_samples = potential.integrate_orbit(w0_samples, dt=-1*u.Myr, n_steps=4000)"
]
},
Expand Down
24 changes: 1 addition & 23 deletions gala/mpl_style.py
Expand Up @@ -589,7 +589,7 @@
'image.cmap': 'hesperia',

# Font
'font.size': 14.0,
'font.size': 18.0,
'text.latex.preamble': r'\usepackage{amsmath}',
'axes.unicode_minus': False,

Expand Down Expand Up @@ -633,25 +633,3 @@
# Other
'savefig.dpi': 300,
}

try:
from cycler import cycler
mpl_style['axes.prop_cycle'] = cycler('color', ['#1A1A1A', # black
'#2166AC', # blue
'#006837', # green
'#B2182B', # red
'#762A83', # purple
'#E08214',
'#80CDC1',
'#C51B7D',
'#FEE08B'])
except ImportError:
mpl_style['axes.color_cycle'] = ['#1A1A1A', # black
'#2166AC', # blue
'#006837', # green
'#B2182B', # red
'#762A83', # purple
'#E08214',
'#80CDC1',
'#C51B7D',
'#FEE08B']

0 comments on commit bc3ac67

Please sign in to comment.