#!/usr/bin/env python3

import sys
import numpy as np
import phoebe
from astropy import units

b = phoebe.default_binary()

#b.add_dataset('lc', times=phoebe.linspace(0,2,101))
b.add_dataset('rv', times=phoebe.linspace(0,2,101))
#b.add_dataset('vis', times=phoebe.linspace(0,2,101))

print("b['rv01@dataset'] = ", b['rv01@dataset'])

b.set_value('vgamma', context='system', value=50*units.km/units.s)

b.run_compute()

f = open('twigs.txt', 'w')
for twig in b.twigs:
  f.write("%s\n" % (twig))
f.close()

print("b['rv01@phoebe01@latest@rv@model'] = ", b['rv01@phoebe01@latest@rv@model'])

b.plot(show=True)

