import pandas as pd
import numpy as np
from cosmic.evolve import Evolve

def evolve_HMXB_systems(HMXB_initial_conds, bin_num):
    
    HMXB_initial_conds['dtp']=0.1
    
    HMXB_bpp, HMXB_bcm, HMXB_initC  = Evolve.evolve(initialbinarytable=HMXB_initial_conds,)

    HMXB_bpp.to_csv(path + "evolved_tracks/" + str(bin_num) + "_HMXB_evolved_bpp.csv")
    HMXB_bcm.to_csv(path + "evolved_tracks/" + str(bin_num) + "_HMXB_evolved_bcm.csv")
    
    return


path = "../../cosmic_output/cosmic_3.0_fp_largerbcm/"

start = 1
nrows = 1

while start < 1000:

    HMXB_initC = pd.read_csv(path + "initC_HMXB.csv", skiprows=[i for i in range(1,start)], nrows=nrows)
    start += 1
    bin_num = HMXB_initC['bin_num'][0]

    evolve_HMXB_systems(HMXB_initC, bin_num)

import pandas as pd
import numpy as np
from cosmic.evolve import Evolve

def evolve_HMXB_systems(HMXB_initial_conds, bin_num):
    
    HMXB_initial_conds['dtp']=0.1
    
    HMXB_bpp, HMXB_bcm, HMXB_initC  = Evolve.evolve(initialbinarytable=HMXB_initial_conds,)

    HMXB_bpp.to_csv(path + "evolved_tracks/" + str(bin_num) + "_HMXB_evolved_bpp.csv")
    HMXB_bcm.to_csv(path + "evolved_tracks/" + str(bin_num) + "_HMXB_evolved_bcm.csv")
    
    return


path = "../../cosmic_output/cosmic_3.0_fp_largerbcm/"

start = 1
nrows = 1

while start < 1000:

    HMXB_initC = pd.read_csv(path + "initC_HMXB.csv", skiprows=[i for i in range(1,start)], nrows=nrows)
    start += 1
    bin_num = HMXB_initC['bin_num'][0]

    evolve_HMXB_systems(HMXB_initC, bin_num)
