In [1]:
%pylab inline
from orbitutils import OrbitPopulation
import numpy as np


Populating the interactive namespace from numpy and matplotlib

First demo: make a population of two solar-mass stars orbiting with 100d period.


In [2]:
def demoplot(population,bins=50):
    figure(figsize=(12,6))
    ax1=subplot(121)
    hist(population.Rsky,bins=bins,lw=3,histtype='step')
    xlabel('On-sky separation [projected AU]')
    ax2=subplot(122)
    hist(population.RV,bins=bins,lw=3,histtype='step')
    xlabel('Radial Velocity [km/s]')
    return ax1,ax2

In [3]:
pop = OrbitPopulation(1,1,100,n=1e4)
demoplot(pop)
pop.scatterplot()


Same thing, now with eccentricity of 0.3. Note the pileup at projected separation = $a (1-e)$. (Can anyone explain this...?)


In [4]:
ecc = 0.3
pop = OrbitPopulation(1,1,100,n=1e4,ecc=ecc)
print pop.semimajor
ax1,ax2 = demoplot(pop)
ax1.axvline(pop.semimajor.value*(1-ecc),color='r',ls=':')
pop.scatterplot()


0.3346811928 AU

Now, make population of solar-solar binaries, with range of periods (flat distribution 1-1000d)


In [8]:
pop = OrbitPopulation(1,1,np.linspace(1,1000,1e4))
demoplot(pop)
pop.scatterplot()



In [ ]: