In [1]:
import pandas as pd
from exosyspop.populations import BinaryPopulation
from exosyspop.populations import TRILEGAL_BGBinaryPopulation
from exosyspop.populations import KeplerBinaryPopulation, PoissonPlanetPopulation
from exosyspop.populations import PopulationMixture
targets = pd.read_hdf('targets.h5')
bgstars = pd.read_hdf('bgstars.h5')
# Sanitize dtypes of targets DataFrame
for c in targets.columns:
if targets[c].dtype == object:
targets.loc[:,c] = targets.loc[:,c].astype(str)
import logging
rootLogger = logging.getLogger()
In [2]:
#ebpop = KeplerBinaryPopulation(targets)
#bgpop = TRILEGAL_BGBinaryPopulation(targets, bgstars)
#plpop = PoissonPlanetPopulation(targets)
#pops = PopulationMixture([ebpop,bgpop,plpop])
#pops.train_trap(N=3000)
#pops.save('mixture',overwrite=True)
In [3]:
pops = PopulationMixture.load('mixture')
In [4]:
%timeit pops.observe(regr_trap=True)
In [5]:
pops.params
Out[5]:
In [6]:
obs = pops.observe(regr_trap=True)
print(len(obs))
obs.groupby('population').count()
Out[6]:
In [7]:
obs.columns
Out[7]:
In [8]:
pops['BGEB'].rho_bg(10) # background stellar density at galactic latitude b=10
Out[8]:
In [9]:
pops.set_params(rho_5=1)
pops['BGEB'].rho_bg(10)
Out[9]:
In [10]:
obs = pops.observe(regr_trap=True)
print(len(obs))
obs.groupby('population').count()
Out[10]:
In [11]:
pops.set_params(N_pl=4)
obs = pops.observe(regr_trap=True)
print(len(obs))
obs.groupby('population').count()
Out[11]:
In [12]:
pops.set_params(fB=1.)
obs = pops.observe(regr_trap=True)
print(len(obs))
obs.groupby('population').count()
Out[12]:
In [13]:
pops.reset_params()
obs = pops.observe(regr_trap=True)
print(len(obs))
obs.groupby('population').count()
Out[13]:
In [ ]: