Paste #257

Welcome To LodgeIt

Welcome to the LodgeIt pastebin. In order to use the notification feature a 31 day cookie with an unique ID was created for you. The lodgeit database does not store any information about you, it's just used for an advanced pastebin experience :-). Read more on the about lodgeit page. Have fun :-)

hide this notification

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import yt
#yt.enable_parallelism()
from treefarm import TreeFarm
import numpy as np


def build_merger_tree():

    ds = yt.load("rockstar_halos/halos_RD0023/halos_0.0.bin")
    i_max = np.argmax(ds.r["halos", "particle_mass"])
    my_id = ds.r['particle_identifier'][i_max]

    ts      = yt.DatasetSeries("RD????/RD????")
    my_tree = TreeFarm(ts)
    my_tree.trace_ancestors("halos", my_id, filename = "test_halo/")

    return



if __name__=="__main__":

    build_merger_tree()