Skip to content

Instantly share code, notes, and snippets.

View jobovy's full-sized avatar
:octocat:

Jo Bovy jobovy

:octocat:
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jobovy
jobovy / .block
Last active February 4, 2018 02:31
Data analysis recipes: Fitting a model to data
license: mit
@jobovy
jobovy / SimpleBarModel.ipynb
Created January 4, 2017 19:51
A very simple bar model for the Milky Way in galpy
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jobovy
jobovy / streampepperdf.py
Last active July 30, 2018 00:43
Compute the structure of a tidal stream perturbed by many dark-matter-halo impacts using galpy
# The DF of a tidal stream peppered with impacts
import copy
import hashlib
import numpy
from scipy import integrate, special, stats, optimize, interpolate, signal
from galpy.df import streamdf, streamgapdf
from galpy.df.streamgapdf import _rotation_vy
from galpy.util import bovy_conversion, bovy_coords
class streampepperdf(streamdf):
"""The DF of a tidal stream peppered with impacts"""
@jobovy
jobovy / koposov10.py
Last active August 29, 2015 14:27
Data files and code to work with data from Koposov et al. (2010)
#Module to read and process the Koposov et al. (2010) data
import os
import numpy
from galpy.util import bovy_coords
_DATADIR='../data/'
# Koposov et al. (2010) transformation matrix
_TKOP= numpy.zeros((3,3))
_TKOP[0,:]= [-0.4776303088,-0.1738432154,0.8611897727]
_TKOP[1,:]= [0.510844589,-0.8524449229,0.111245042]
_TKOP[2,:]= [0.7147776536,0.4930681392,0.4959603976]
@jobovy
jobovy / README.rst
Last active August 29, 2015 14:27
Code for reproducing the figures in Bovy & Tremaine (2012) http://adsabs.harvard.edu/abs/2012ApJ...756...89B

These Python scripts can be used to reproduce the figures in Bovy & Tremaine (2012): On the local dark matter density.

Figure 1 is produced by:

python plot_dvcapprox.py

while Figure 2 is produced by:

python plot_sigmaz.py