# Notebook from mdrafiislam/PH482_582
Path: students_final_projects/group-f/rockstar_analysis/rockstar_tutorial.ipynb

First, move within a simulation directory that contains a sub-directory 'halo/' that contains rockstar halo catalog files. By default, the code assumes that the raw text halo files that Rockstar produces have been converted to hdf5 format and live in halo/rockstar_dm/catalog_hdf5/_____no_output_____Currently, I run Rockstar halo finder using only dark-matter particles. This means that all halo quantities are computed using **only** dark matter particles. I then assign star particles to the dark-matter halos in post-processing._____no_output_____Ensure that rockstar_analysis and utilities directories are in your python path, then..._____no_output_____

import rockstar_analysis as rockstar
import utilities as ut_____no_output_____# you can access the files as named or use the aliases in __init__.py to keep it shorter
# for example, these are the same:

rockstar.rockstar_io
rockstar.io_____no_output_____

# read halo catalog_____no_output_____

# read halo catalog at single snapshot (z = 0)

hal = rockstar.io.IO.read_catalogs('redshift', 0)
# in utilities.simulation.Snapshot():
  reading:  snapshot_times.txt
  input redshift = 0:  using snapshot index = 600, redshift = 0.000

# in rockstar_analysis.rockstar_io.IO():
* read 3484 halos from:  halo_600.hdf5

# in rockstar_analysis.rockstar_io.Particle():
* read 3484 halos with star particles from:  star_600.hdf5

# halo properties are stored as dictionary

for k in hal.keys():
    print(k)accrete.rate
accrete.rate.100Myr
accrete.rate.tdyn
am.phantom
am.progenitor.main
axis.b/a
axis.c/a
descendant.snapshot
host.distance
host.index
host.velocity
host.velocity.rad
host.velocity.tan
id
infall.first.mass
infall.first.snapshot
infall.first.vel.circ.max
infall.mass
infall.snapshot
infall.vel.circ.max
major.merger.snapshot
mass
mass.180m
mass.200c
mass.200m
mass.500c
mass.bound
mass.half.snapshot
mass.lowres
mass.peak
mass.peak.snapshot
mass.vir
position
position.offset
progenitor.number
radius
scale.radius
scale.radius.klypin
spin.bullock
spin.peebles
tree.index
vel.circ.max
vel.circ.peak
vel.std
velocity
velocity.offset
lowres.mass.frac
star.form.time.100
star.form.time.50
star.form.time.90
star.form.time.95
star.form.time.dif.68
star.indices
star.mass
star.mass.neutral
star.massfraction
star.number
star.position
star.radius.50
star.radius.90
star.vel.circ.50
star.vel.std
star.vel.std.50
star.velocity
# you can read halo catalogs at all available snapshots
# by supplying None or 'all' as the input snapshot value.
# stored as a list of dictionaries, with list index same as snapshot index

hals = rockstar.io.IO.read_catalogs('redshift', None)
# in utilities.simulation.Snapshot():
  reading:  snapshot_times.txt
! input 601 snapshot indices but found only 599 halo catalog files
* read 27 halos from:  halo_002.hdf5

* read 36 halos from:  halo_003.hdf5

* read 48 halos from:  halo_004.hdf5

* read 60 halos from:  halo_005.hdf5

* read 78 halos from:  halo_006.hdf5

* read 92 halos from:  halo_007.hdf5

* read 110 halos from:  halo_008.hdf5

* read 129 halos from:  halo_009.hdf5

* read 153 halos from:  halo_010.hdf5

* read 170 halos from:  halo_011.hdf5

* read 199 halos from:  halo_012.hdf5

* read 230 halos from:  halo_013.hdf5

* read 268 halos from:  halo_014.hdf5

* read 295 halos from:  halo_015.hdf5

* read 327 halos from:  halo_016.hdf5

* read 362 halos from:  halo_017.hdf5

* read 400 halos from:  halo_018.hdf5

* read 419 halos from:  halo_019.hdf5

* read 458 halos from:  halo_020.hdf5

* read 505 halos from:  halo_021.hdf5

* read 532 halos from:  halo_022.hdf5

* read 567 halos from:  halo_023.hdf5

* read 605 halos from:  halo_024.hdf5

* read 634 halos from:  halo_025.hdf5

* read 673 halos from:  halo_026.hdf5
* read 673 halos with star particles from:  star_026.hdf5

* read 739 halos from:  halo_027.hdf5

* read 821 halos from:  halo_028.hdf5

* read 868 halos from:  halo_029.hdf5

* read 967 halos from:  halo_030.hdf5

* read 1050 halos from:  halo_031.hdf5

* read 1138 halos from:  halo_032.hdf5

* read 1234 halos from:  halo_033.hdf5
* read 1234 halos with star particles from:  star_033.hdf5

* read 1313 halos from:  halo_034.hdf5

* read 1426 halos from:  halo_035.hdf5

* read 1559 halos from:  halo_036.hdf5

* read 1662 halos from:  halo_037.hdf5

* read 1783 halos from:  halo_038.hdf5

* read 1867 halos from:  halo_039.hdf5

* read 2021 halos from:  halo_040.hdf5

* read 2132 halos from:  halo_041.hdf5
* read 2132 halos with star particles from:  star_041.hdf5

* read 2246 halos from:  halo_042.hdf5

* read 2378 halos from:  halo_043.hdf5

* read 2515 halos from:  halo_044.hdf5

* read 2625 halos from:  halo_045.hdf5

* read 2781 halos from:  halo_046.hdf5

* read 2927 halos from:  halo_047.hdf5

* read 3011 halos from:  halo_048.hdf5

* read 3195 halos from:  halo_049.hdf5

* read 3336 halos from:  halo_050.hdf5

* read 3519 halos from:  halo_051.hdf5

* read 3644 halos from:  halo_052.hdf5
* read 3644 halos with star particles from:  star_052.hdf5

* read 3752 halos from:  halo_053.hdf5

* read 3866 halos from:  halo_054.hdf5

* read 3950 halos from:  halo_055.hdf5
* read 3950 halos with star particles from:  star_055.hdf5

* read 4081 halos from:  halo_056.hdf5

* read 4220 halos from:  halo_057.hdf5
* read 4220 halos with star particles from:  star_057.hdf5

* read 4351 halos from:  halo_058.hdf5

* read 4470 halos from:  halo_059.hdf5

* read 4630 halos from:  halo_060.hdf5
* read 4630 halos with star particles from:  star_060.hdf5

* read 4721 halos from:  halo_061.hdf5

* read 4880 halos from:  halo_062.hdf5

* read 5033 halos from:  halo_063.hdf5

* read 5115 halos from:  halo_064.hdf5
* read 5115 halos with star particles from:  star_064.hdf5

* read 5139 halos from:  halo_065.hdf5

* read 5261 halos from:  halo_066.hdf5

* read 5407 halos from:  halo_067.hdf5
* read 5407 halos with star particles from:  star_067.hdf5

* read 5443 halos from:  halo_068.hdf5

* read 5514 halos from:  halo_069.hdf5

* read 5664 halos from:  halo_070.hdf5

* read 5631 halos from:  halo_071.hdf5
* read 5631 halos with star particles from:  star_071.hdf5

* read 5752 halos from:  halo_072.hdf5

* read 5743 halos from:  halo_073.hdf5

* read 5905 halos from:  halo_074.hdf5

* read 5930 halos from:  halo_075.hdf5
* read 5930 halos with star particles from:  star_075.hdf5

* read 5972 halos from:  halo_076.hdf5

* read 5976 halos from:  halo_077.hdf5

* read 6118 halos from:  halo_078.hdf5

* read 6141 halos from:  halo_079.hdf5
* read 6141 halos with star particles from:  star_079.hdf5

* read 6212 halos from:  halo_080.hdf5

* read 6276 halos from:  halo_081.hdf5

* read 6374 halos from:  halo_082.hdf5

* read 6348 halos from:  halo_083.hdf5
* read 6348 halos with star particles from:  star_083.hdf5

* read 6400 halos from:  halo_084.hdf5

* read 6486 halos from:  halo_085.hdf5

* read 6455 halos from:  halo_086.hdf5

* read 6438 halos from:  halo_087.hdf5

* read 6565 halos from:  halo_088.hdf5
* read 6565 halos with star particles from:  star_088.hdf5

* read 6523 halos from:  halo_089.hdf5

* read 6558 halos from:  halo_090.hdf5

* read 6622 halos from:  halo_091.hdf5
* read 6622 halos with star particles from:  star_091.hdf5

* read 6574 halos from:  halo_092.hdf5

* read 6575 halos from:  halo_093.hdf5
* read 6575 halos with star particles from:  star_093.hdf5

* read 6708 halos from:  halo_094.hdf5

* read 6664 halos from:  halo_095.hdf5

* read 6692 halos from:  halo_096.hdf5
* read 6692 halos with star particles from:  star_096.hdf5

* read 6673 halos from:  halo_097.hdf5

* read 6780 halos from:  halo_098.hdf5

* read 6778 halos from:  halo_099.hdf5
* read 6778 halos with star particles from:  star_099.hdf5

* read 6722 halos from:  halo_100.hdf5

* read 6709 halos from:  halo_101.hdf5

* read 6704 halos from:  halo_102.hdf5
* read 6704 halos with star particles from:  star_102.hdf5

* read 6747 halos from:  halo_103.hdf5

* read 6761 halos from:  halo_104.hdf5

* read 6769 halos from:  halo_105.hdf5
* read 6769 halos with star particles from:  star_105.hdf5

* read 6750 halos from:  halo_106.hdf5

* read 6786 halos from:  halo_107.hdf5

* read 6821 halos from:  halo_108.hdf5

* read 6824 halos from:  halo_109.hdf5
* read 6824 halos with star particles from:  star_109.hdf5

* read 6801 halos from:  halo_110.hdf5

* read 6775 halos from:  halo_111.hdf5

* read 6757 halos from:  halo_112.hdf5
* read 6757 halos with star particles from:  star_112.hdf5

* read 6756 halos from:  halo_113.hdf5

* read 6780 halos from:  halo_114.hdf5

* read 6783 halos from:  halo_115.hdf5

* read 6796 halos from:  halo_116.hdf5
* read 6796 halos with star particles from:  star_116.hdf5

* read 6749 halos from:  halo_117.hdf5

* read 6779 halos from:  halo_118.hdf5

* read 6722 halos from:  halo_119.hdf5

* read 6762 halos from:  halo_120.hdf5
* read 6762 halos with star particles from:  star_120.hdf5

* read 6730 halos from:  halo_121.hdf5

* read 6732 halos from:  halo_122.hdf5

* read 6732 halos from:  halo_123.hdf5

* read 6739 halos from:  halo_124.hdf5
* read 6739 halos with star particles from:  star_124.hdf5

* read 6727 halos from:  halo_125.hdf5

* read 6696 halos from:  halo_126.hdf5

* read 6706 halos from:  halo_127.hdf5

* read 6675 halos from:  halo_128.hdf5
* read 6675 halos with star particles from:  star_128.hdf5

* read 6688 halos from:  halo_129.hdf5

* read 6697 halos from:  halo_130.hdf5

* read 6689 halos from:  halo_131.hdf5

* read 6643 halos from:  halo_132.hdf5

* read 6602 halos from:  halo_133.hdf5
* read 6602 halos with star particles from:  star_133.hdf5

* read 6608 halos from:  halo_134.hdf5

* read 6545 halos from:  halo_135.hdf5

* read 6530 halos from:  halo_136.hdf5

* read 6480 halos from:  halo_137.hdf5
* read 6480 halos with star particles from:  star_137.hdf5

* read 6531 halos from:  halo_138.hdf5

* read 6444 halos from:  halo_139.hdf5

* read 6530 halos from:  halo_140.hdf5

* read 6519 halos from:  halo_141.hdf5

* read 6473 halos from:  halo_142.hdf5
* read 6473 halos with star particles from:  star_142.hdf5

* read 6456 halos from:  halo_143.hdf5

* read 6473 halos from:  halo_144.hdf5

* read 6463 halos from:  halo_145.hdf5

* read 6455 halos from:  halo_146.hdf5

* read 6405 halos from:  halo_147.hdf5

* read 6366 halos from:  halo_148.hdf5
* read 6366 halos with star particles from:  star_148.hdf5

* read 6394 halos from:  halo_149.hdf5

* read 6365 halos from:  halo_150.hdf5

* read 6370 halos from:  halo_151.hdf5

* read 6365 halos from:  halo_152.hdf5

* read 6347 halos from:  halo_153.hdf5
* read 6347 halos with star particles from:  star_153.hdf5

* read 6331 halos from:  halo_154.hdf5
# halo catalog at z = 0 (snapshot 600)
hal_z0 = hals[600]

# halo catalog at z = 1 (snapshot 277)
hal_z1 = hals[277]_____no_output_____# by default, if you read multiple snapshots it will store so the halo catalog list index = snapshot index
# but if you just want to read a few snapshots and store as short list, you can do the following

hals = rockstar.io.IO.read_catalogs('redshift', [0, 1], all_snapshot_list=False)

hal_z1 = hals[0]
hal_z0 = hals[1]
# in utilities.simulation.Snapshot():
  reading:  snapshot_times.txt
  input redshift = [0, 1]:  using snapshot indices = [600 277]
  redshifts = [0. 1.]

* read 4878 halos from:  halo_277.hdf5
* read 4878 halos with star particles from:  star_277.hdf5

* read 3484 halos from:  halo_600.hdf5
* read 3484 halos with star particles from:  star_600.hdf5

# halo properties_____no_output_____

hal = rockstar.io.IO.read_catalogs('redshift', 0)
# in utilities.simulation.Snapshot():
  reading:  snapshot_times.txt
  input redshift = 0:  using snapshot index = 600, redshift = 0.000

# in rockstar_analysis.rockstar_io.IO():
* read 3484 halos from:  halo_600.hdf5

# in rockstar_analysis.rockstar_io.Particle():
* read 3484 halos with star particles from:  star_600.hdf5

# halo properties are stored as dictionary

for k in hal.keys():
    print(k)accrete.rate
accrete.rate.100Myr
accrete.rate.tdyn
am.phantom
am.progenitor.main
axis.b/a
axis.c/a
descendant.snapshot
host.distance
host.index
host.velocity
host.velocity.rad
host.velocity.tan
id
infall.first.mass
infall.first.snapshot
infall.first.vel.circ.max
infall.mass
infall.snapshot
infall.vel.circ.max
major.merger.snapshot
mass
mass.180m
mass.200c
mass.200m
mass.500c
mass.bound
mass.half.snapshot
mass.lowres
mass.peak
mass.peak.snapshot
mass.vir
position
position.offset
progenitor.number
radius
scale.radius
scale.radius.klypin
spin.bullock
spin.peebles
tree.index
vel.circ.max
vel.circ.peak
vel.std
velocity
velocity.offset
lowres.mass.frac
star.form.time.100
star.form.time.50
star.form.time.90
star.form.time.95
star.form.time.dif.68
star.indices
star.mass
star.mass.neutral
star.massfraction
star.number
star.position
star.radius.50
star.radius.90
star.vel.circ.50
star.vel.std
star.vel.std.50
star.velocity
# 3-D position (particle_number x dimension_number array) [kpc comoving]

hal['position']_____no_output_____# 3-D velocity (particle_number x dimension_number array) [km/s physical]

hal['velocity']_____no_output_____# DM mass of halo [M_sun]
# I use 200m, 200 x the mean matter density, for the halo overdensity/virial definition

hal['mass']_____no_output_____# but rockstar also stores total halo mass based on different virial definitions [M_sun]

print('{}\n{}\n{}'.format(hal['mass.200m'], hal['mass.vir'], hal['mass.200c']))_____no_output_____# DM mass that is bound to halo [M_sun]

hal['mass.bound']_____no_output_____# halo radius, again using 200m for the overdentiy/virial definition [kpc physical]

hal['radius']_____no_output_____# NFW scale radius [kpc physical]

hal['scale.radius']_____no_output_____# maximum of the circular velocity profile [km/s physical]

print(hal['vel.circ.max'])_____no_output_____# standard deviation of the velocity (velocity disperion) [km/s physical]

print(hal['vel.std'])_____no_output_____# DM mass of low-resolution DM particles within R_200m [M_sun]

hal['mass.lowres']_____no_output_____# the fraction of DM mass within R_200m that is in low-resolution DM
# this is a derived quantity, so you need to call via the .prop() function

hal.prop('lowres.mass.frac')_____no_output_____# index of the primary host halo in catalog list

hal['host.index']_____no_output_____# 3-D distance to the primary host halo [kpc physical]

hal['host.distance']_____no_output_____# total (scalar) distance to the primary host halo [kpc physical]
# this is a derived quantity, so you need to call via the .prop() function

hal.prop('host.distance.total')_____no_output_____# 3-D velocity wrt the primary host halo [kpc physical]
# radial and tangential velocity wrt the primary host halo [kpc physical]

print(hal['host.velocity'])
print(hal['host.velocity.rad'])
print(hal['host.velocity.tan'])[[ -38.893913 -100.065125  -67.59067 ]
 [ -39.01779  -163.35327   -67.31996 ]
 [  11.996011 -147.69128   -35.49998 ]
 ...
 [  77.52912   -19.48314    14.95499 ]
 [ -74.89891   -65.96134   -25.713802]
 [  88.39607   -27.73228    13.954126]]
[107.72095   169.13635   151.28896   ...   7.553853  -84.47989
   6.9007425]
[67.01091  64.277084 18.125307 ... 80.974976 59.034695 93.4347  ]
# use .prop() to compute derived quantities, such the log of the mass
# see rockstar.io.HaloDictionaryClass for all options for derived quantities

hal.prop('log mass')_____no_output_____

# halo catalogs with baryonic particle properties_____no_output_____I assign baryonic particle properties (such as stars) in post-processing, after generating the DM halo catalogs. I store those properties in a separate file, for example, star_600.hdf5. The above reader automatically looks if this file exists at the snapshot of interest and will read and append these properties to the halo catalog. Not all snapshots have baryonic particle properties.

Currently I impose a 15 kpc (physical) max radius to assign a star particle to a halo. _____no_output_____

# all stellar properties have dictionary keys as 'star.*' (ignore star.mass.rockstar)
# list of star particle properties
for k in hal:
    if 'star.' in k:
        print(k)star.form.time.100
star.form.time.50
star.form.time.90
star.form.time.95
star.form.time.dif.68
star.indices
star.mass
star.mass.neutral
star.massfraction
star.number
star.position
star.radius.50
star.radius.90
star.vel.circ.50
star.vel.std
star.vel.std.50
star.velocity
# find halos with star particles

his = ut.array.get_indices(hal['star.mass'], [1, Inf])_____no_output_____# mass of all star particles in halo [M_sun]

hal['star.mass'][his]_____no_output_____# number of star particles in halo [M_sun]

hal['star.number'][his]_____no_output_____# radius that encloses 50%, 90% of the stellar mass [kpc physical]

print(hal['star.radius.50'][his])
print(hal['star.radius.90'][his])[2.7605097 2.8120294 3.9363506 2.3187587 3.0943637 2.773992  3.5594394
 2.0976882 2.5729434 3.4748592 1.7299412 2.6946738 2.885782  2.2415848
 2.2643697 4.1248717 2.8092728]
[ 9.917109   3.7087386  8.764568   5.5444274  5.9604287  8.241288
  8.58264    6.666064   4.631308   8.758817   7.0835123  3.9401145
  7.474184   3.1880832 14.554998   8.811111   6.023005 ]
# can compute stellar density (within R_50) as a derived property [M_sun / kpc^3]

hal.prop('star.density.50', his)_____no_output_____# stellar velocity dispersion (standard deviation) at R_50 [km / s]

hal['star.vel.std.50'][his]_____no_output_____# center-of-mass position and velocity of star particles [kpc comoving]

print(hal['star.position'][his])
print(hal['star.velocity'][his])[[41781.56  43480.15  46658.395]
 [41830.27  43030.49  46740.45 ]
 [41622.32  43976.594 46311.254]
 [41639.176 43975.79  46519.863]
 [41891.668 43969.49  46325.54 ]
 [41851.258 44105.36  46358.438]
 [41853.625 44090.336 46375.69 ]
 [41821.977 44122.    46288.445]
 [41831.31  44127.754 46443.855]
 [41772.45  44267.758 46189.91 ]
 [41832.285 44397.598 46186.855]
 [41714.55  44149.48  46278.426]
 [41746.652 44401.58  46368.426]
 [41811.88  44248.215 46335.656]
 [41845.875 44250.89  46238.785]
 [42326.566 46242.703 46897.89 ]
 [41710.25  44243.83  46567.26 ]]
[[  -9.464741   104.19139     -4.5497684]
 [ -18.685646    92.534355    15.438123 ]
 [-102.12357    126.88925     60.099598 ]
 [ -92.73803    101.32438     96.83005  ]
 [-128.08545    128.89117    204.56511  ]
 [-187.8551      42.681217  -100.38308  ]
 [  25.128942   111.413994   -63.950726 ]
 [ -49.453175    73.01806     97.339516 ]
 [ -21.407557   -60.986347   198.22601  ]
 [ -61.37039    -50.457153   145.8585   ]
 [  57.688744   -33.58449    185.96797  ]
 [ 119.816986   108.36716    243.43805  ]
 [ -97.16071    -62.887352    51.609383 ]
 [-117.37648     10.499603   286.31894  ]
 [  49.12765    124.48231    115.62765  ]
 [ -38.31858    129.56767    143.72916  ]
 [ -34.063534   -10.502019   -12.5289955]]
# time (age of Universe) when galaxy formed 50%, 90%, etc of its current stellar mass [Gyr]

print(hal['star.form.time.50'][his])
print(hal['star.form.time.90'][his])[1.0796949  0.860665   7.4421144  4.444367   0.9286473  3.3452203
 2.8379028  6.9067817  1.0172235  5.11471    1.3203455  0.61192775
 3.2727437  1.5335069  0.87201387 7.5832977  4.4236155 ]
[ 1.079912    0.86157835 11.915186    7.9318376   0.929332    5.8099756
  5.4541674  11.299019    1.1361079   8.031222    1.3231392   0.61205685
  5.316226    1.5336047   1.5286106  12.264062   10.433421  ]
# can convert this to lookback-time via derived property [Gyr]

hal.prop('star.form.time.lookback.50', his)_____no_output_____# indices of member star particles in the particle list at the same snapshot
# for example, star particles assigned to halo 0 would be part_indices = hal['star.indies'][0]
# then if you read in the particle snapshot, you can access member star particles via
# part['star'][property_name][part_indices]

hal['star.indices'][his[0]]_____no_output_____

# additional information stored in sub-dictionaries_____no_output_____

# dictionary of useful information about the simulation

hal.info_____no_output_____# dictionary class of information about the cosmology of the simulation

hal.Cosmology_____no_output_____# dictionary of information about this snapshot's index, scale-factor, redshift, time, lookback-time

hal.snapshot_____no_output_____# dictionary of arrays about *all* snapshots of the simulation

print(hal.Snapshot.keys())
print(hal.Snapshot['redshift'])dict_keys(['index', 'scalefactor', 'redshift', 'time', 'time.width'])
[9.90000000e+01 1.90000000e+01 1.50000000e+01 1.46059113e+01
 1.42307692e+01 1.38732395e+01 1.35321102e+01 1.32062778e+01
 1.28947372e+01 1.25965662e+01 1.23109245e+01 1.20370369e+01
 1.17741938e+01 1.15217390e+01 1.12790699e+01 1.10456276e+01
 1.08208952e+01 1.06043959e+01 1.03956833e+01 1.01943464e+01
 1.00000000e+01 9.81967163e+00 9.64516163e+00 9.47619057e+00
 9.31250000e+00 9.15384579e+00 9.00000000e+00 8.84375000e+00
 8.69230747e+00 8.54545403e+00 8.40298557e+00 8.26470566e+00
 8.13043499e+00 8.00000000e+00 7.86153841e+00 7.72727251e+00
 7.59701490e+00 7.47058821e+00 7.34782600e+00 7.22857141e+00
 7.11267614e+00 7.00000000e+00 6.89743567e+00 6.79746819e+00
 6.69999981e+00 6.60493851e+00 6.51219511e+00 6.42168665e+00
 6.33333349e+00 6.24705887e+00 6.16279078e+00 6.08045959e+00
 6.00000000e+00 5.92307711e+00 5.84782600e+00 5.77419329e+00
 5.70212793e+00 5.63157892e+00 5.56250000e+00 5.49484539e+00
 5.42857122e+00 5.36363649e+00 5.30000019e+00 5.23762369e+00
 5.17647076e+00 5.11650467e+00 5.05769253e+00 5.00000000e+00
 4.94339609e+00 4.88785028e+00 4.83333349e+00 4.77981663e+00
 4.72727251e+00 4.67567587e+00 4.62500000e+00 4.57522106e+00
 4.52631569e+00 4.47826099e+00 4.43103456e+00 4.38461542e+00
 4.33898306e+00 4.29411745e+00 4.25000000e+00 4.20661163e+00
 4.16393423e+00 4.12195110e+00 4.08064508e+00 4.03999996e+00
 4.00000000e+00 3.96124029e+00 3.92307687e+00 3.88549614e+00
 3.84848475e+00 3.81203008e+00 3.77611947e+00 3.74074078e+00
 3.70588231e+00 3.67153287e+00 3.63768125e+00 3.60431647e+00
 3.57142854e+00 3.53900719e+00 3.50704241e+00 3.47552443e+00
 3.44444442e+00 3.41379309e+00 3.38356161e+00 3.35374141e+00
 3.32432437e+00 3.29530191e+00 3.26666665e+00 3.23841071e+00
 3.21052623e+00 3.18300653e+00 3.15584421e+00 3.12903237e+00
 3.10256410e+00 3.07643318e+00 3.05063295e+00 3.02515721e+00
 3.00000000e+00 2.97452235e+00 2.94936705e+00 2.92452836e+00
 2.90000010e+00 2.87577629e+00 2.85185194e+00 2.82822084e+00
 2.80487800e+00 2.78181815e+00 2.75903606e+00 2.73652697e+00
 2.71428561e+00 2.69230771e+00 2.67058825e+00 2.64912271e+00
 2.62790704e+00 2.60693645e+00 2.58620691e+00 2.56571436e+00
 2.54545450e+00 2.52542377e+00 2.50561810e+00 2.48603344e+00
 2.46666670e+00 2.44751382e+00 2.42857146e+00 2.40983605e+00
 2.39130425e+00 2.37297297e+00 2.35483861e+00 2.33689833e+00
 2.31914902e+00 2.30158734e+00 2.28421044e+00 2.26701570e+00
 2.25000000e+00 2.23316050e+00 2.21649480e+00 2.20000005e+00
 2.18367338e+00 2.16751266e+00 2.15151525e+00 2.13567829e+00
 2.11999989e+00 2.10447764e+00 2.08910894e+00 2.07389164e+00
 2.05882359e+00 2.04390240e+00 2.02912617e+00 2.01449275e+00
 2.00000000e+00 1.98578203e+00 1.97169805e+00 1.95774651e+00
 1.94392514e+00 1.93023264e+00 1.91666675e+00 1.90322578e+00
 1.88990831e+00 1.87671232e+00 1.86363637e+00 1.85067868e+00
 1.83783782e+00 1.82511210e+00 1.81250000e+00 1.79999995e+00
 1.78761065e+00 1.77533042e+00 1.76315784e+00 1.75109172e+00
 1.73913038e+00 1.72727275e+00 1.71551716e+00 1.70386267e+00
 1.69230771e+00 1.68085110e+00 1.66949153e+00 1.65822780e+00
 1.64705884e+00 1.63598335e+00 1.62500000e+00 1.61410785e+00
 1.60330582e+00 1.59259260e+00 1.58196723e+00 1.57142866e+00
 1.56097555e+00 1.55060732e+00 1.54032254e+00 1.53012049e+00
 1.51999998e+00 1.50996017e+00 1.50000000e+00 1.49011862e+00
 1.48031497e+00 1.47058821e+00 1.46093750e+00 1.45136189e+00
 1.44186056e+00 1.43243241e+00 1.42307687e+00 1.41379309e+00
 1.40458024e+00 1.39543724e+00 1.38636363e+00 1.37735856e+00
 1.36842108e+00 1.35955060e+00 1.35074627e+00 1.34200740e+00
 1.33333325e+00 1.32472324e+00 1.31617653e+00 1.30769229e+00
 1.29927015e+00 1.29090905e+00 1.28260875e+00 1.27436817e+00
 1.26618707e+00 1.25806451e+00 1.25000000e+00 1.24199295e+00
 1.23404264e+00 1.22614837e+00 1.21830988e+00 1.21052635e+00
 1.20279717e+00 1.19512200e+00 1.18750000e+00 1.17993081e+00
 1.17241383e+00 1.16494846e+00 1.15753424e+00 1.15017056e+00
 1.14285707e+00 1.13559318e+00 1.12837839e+00 1.12121212e+00
 1.11409402e+00 1.10702336e+00 1.10000002e+00 1.09302330e+00
 1.08609271e+00 1.07920790e+00 1.07236838e+00 1.06557381e+00
 1.05882347e+00 1.05211735e+00 1.04545450e+00 1.03883505e+00
 1.03225815e+00 1.02572346e+00 1.01923084e+00 1.01277959e+00
 1.00636935e+00 1.00000000e+00 9.93650794e-01 9.87341821e-01
 9.81072605e-01 9.74842787e-01 9.68652010e-01 9.62499976e-01
 9.56386328e-01 9.50310588e-01 9.44272399e-01 9.38271582e-01
 9.32307720e-01 9.26380396e-01 9.20489311e-01 9.14634109e-01
 9.08814609e-01 9.03030276e-01 8.97280991e-01 8.91566277e-01
 8.85885894e-01 8.80239487e-01 8.74626875e-01 8.69047582e-01
 8.63501489e-01 8.57988179e-01 8.52507412e-01 8.47058773e-01
 8.41642201e-01 8.36257279e-01 8.30903828e-01 8.25581372e-01
 8.20289910e-01 8.15028906e-01 8.09798300e-01 8.04597676e-01
 7.99426913e-01 7.94285715e-01 7.89173782e-01 7.84090877e-01
 7.79036820e-01 7.74011314e-01 7.69014120e-01 7.64044881e-01
 7.59103596e-01 7.54189909e-01 7.49303579e-01 7.44444370e-01
 7.39612222e-01 7.34806597e-01 7.30027497e-01 7.25274682e-01
 7.20547915e-01 7.15847015e-01 7.11171687e-01 7.06521690e-01
 7.01897025e-01 6.97297275e-01 6.92722380e-01 6.88171983e-01
 6.83646083e-01 6.79144382e-01 6.74666703e-01 6.70212805e-01
 6.65782511e-01 6.61375701e-01 6.56992078e-01 6.52631581e-01
 6.48293972e-01 6.43979073e-01 6.39686704e-01 6.35416687e-01
 6.31168783e-01 6.26942992e-01 6.22739017e-01 6.18556678e-01
 6.14395916e-01 6.10256374e-01 6.06138110e-01 6.02040827e-01
 5.97964406e-01 5.93908608e-01 5.89873374e-01 5.85858583e-01
 5.81863999e-01 5.77889383e-01 5.73934793e-01 5.69999993e-01
 5.66084802e-01 5.62189102e-01 5.58312714e-01 5.54455400e-01
 5.50617278e-01 5.46797991e-01 5.42997479e-01 5.39215684e-01
 5.35452306e-01 5.31707287e-01 5.27980506e-01 5.24271786e-01
 5.20581126e-01 5.16908228e-01 5.13252974e-01 5.09615421e-01
 5.05995214e-01 5.02392292e-01 4.98806685e-01 4.95238096e-01
 4.91686493e-01 4.88151699e-01 4.84633595e-01 4.81132090e-01
 4.77647096e-01 4.74178404e-01 4.70726013e-01 4.67289686e-01
 4.63869512e-01 4.60465103e-01 4.57076609e-01 4.53703701e-01
 4.50346410e-01 4.47004586e-01 4.43678200e-01 4.40367013e-01
 4.37070906e-01 4.33789998e-01 4.30523902e-01 4.27272707e-01
 4.24036294e-01 4.20814514e-01 4.17607188e-01 4.14414406e-01
 4.11235988e-01 4.08071697e-01 4.04921710e-01 4.01785702e-01
 3.98663700e-01 3.95555586e-01 3.92461210e-01 3.89380515e-01
 3.86313498e-01 3.83259892e-01 3.80219787e-01 3.77193004e-01
 3.74179393e-01 3.71179014e-01 3.68191689e-01 3.65217388e-01
 3.62255991e-01 3.59307408e-01 3.56371492e-01 3.53448302e-01
 3.50537598e-01 3.47639501e-01 3.44753712e-01 3.41880292e-01
 3.39019209e-01 3.36170197e-01 3.33333313e-01 3.30508500e-01
 3.27695608e-01 3.24894488e-01 3.22105289e-01 3.19327712e-01
 3.16561788e-01 3.13807487e-01 3.11064690e-01 3.08333308e-01
 3.05613309e-01 3.02904606e-01 3.00206989e-01 2.97520697e-01
 2.94845402e-01 2.92181104e-01 2.89527714e-01 2.86885202e-01
 2.84253597e-01 2.81632692e-01 2.79022396e-01 2.76422799e-01
 2.73833692e-01 2.71255106e-01 2.68686891e-01 2.66128987e-01
 2.63581514e-01 2.61044204e-01 2.58516997e-01 2.56000012e-01
 2.53493011e-01 2.50995994e-01 2.48508900e-01 2.46031702e-01
 2.43564397e-01 2.41106704e-01 2.38658801e-01 2.36220494e-01
 2.33791694e-01 2.31372505e-01 2.28962794e-01 2.26562500e-01
 2.24171504e-01 2.21789896e-01 2.19417498e-01 2.17054293e-01
 2.14700207e-01 2.12355196e-01 2.10019305e-01 2.07692295e-01
 2.05374300e-01 2.03065097e-01 2.00764805e-01 1.98473305e-01
 1.96190506e-01 1.93916306e-01 1.91650897e-01 1.89393893e-01
 1.87145606e-01 1.84905693e-01 1.82674199e-01 1.80451095e-01
 1.78236395e-01 1.76029995e-01 1.73831806e-01 1.71641797e-01
 1.69459999e-01 1.67286202e-01 1.65120602e-01 1.62963003e-01
 1.60813302e-01 1.58671603e-01 1.56537801e-01 1.54411793e-01
 1.52293593e-01 1.50183201e-01 1.48080394e-01 1.45985395e-01
 1.43897995e-01 1.41818196e-01 1.39745906e-01 1.37681201e-01
 1.35623902e-01 1.33573994e-01 1.31531507e-01 1.29496396e-01
 1.27468601e-01 1.25448003e-01 1.23434700e-01 1.21428601e-01
 1.19429603e-01 1.17437698e-01 1.15452901e-01 1.13475204e-01
 1.11504398e-01 1.09540597e-01 1.07583798e-01 1.05633803e-01
 1.03690699e-01 1.01754397e-01 9.98248979e-02 9.79020968e-02
 9.59860012e-02 9.40767005e-02 9.21738967e-02 9.02777985e-02
 8.83881971e-02 8.65051970e-02 8.46287012e-02 8.27585980e-02
 8.08949992e-02 7.90378004e-02 7.71870017e-02 7.53424987e-02
 7.35042989e-02 7.16724023e-02 6.98466972e-02 6.80271983e-02
 6.62138984e-02 6.44067973e-02 6.26057982e-02 6.08108006e-02
 5.90219013e-02 5.72391003e-02 5.54622002e-02 5.36913015e-02
 5.19262999e-02 5.01671992e-02 4.84139994e-02 4.66667004e-02
 4.49251011e-02 4.31893989e-02 4.14594002e-02 3.97351012e-02
 3.80165018e-02 3.63035984e-02 3.45963985e-02 3.28947008e-02
 3.11987009e-02 2.95081995e-02 2.78232004e-02 2.61438005e-02
 2.44698003e-02 2.28013005e-02 2.11382005e-02 1.94805004e-02
 1.78282000e-02 1.61812007e-02 1.45396003e-02 1.29032005e-02
 1.12720998e-02 9.64630023e-03 8.02570023e-03 6.41029980e-03
 4.80000023e-03 3.19490000e-03 1.59490004e-03 1.43519999e-03
 1.27550005e-03 1.11590000e-03 9.56300006e-04 7.96800014e-04
 6.37300021e-04 4.77900001e-04 3.18600010e-04 1.59300005e-04
 0.00000000e+00]

# halo merger trees_____no_output_____The Rockstar halo finder treats each snapshot as independent, so halos at different snapshots do not know about each other. ConsistentTrees produces halo merger trees that link halos over time.

Note: ConsistentTrees applies some smoothing and physical consistency checks on halos over time, which leads to two important differences from the halo catalog: (1) not every halo in the catalog exists in the merger tree (especially those that are marginally resolved) (2) some halos in the merger tree are 'phantom' halos that have been interpolated across snapshots but do not exist in the halo catalog at that snapshot._____no_output_____Like with the halo catalogs, the reader automatically looks if baryonic particle property files exists at each snapshot and will read and append these properties to the halo merger trees. Again, not all snapshots have baryonic particle properties, so not all halos in the tree will have valid values for these._____no_output_____

# read halo merger trees across all snapshots
# this is a concatenated list of all halos across all snaphots, with pointers to progenitor and descendant halos

halt = rockstar.io.IO.read_tree()
# in utilities.simulation.Snapshot():
  reading:  snapshot_times.txt
* read 2268668 halos from:  tree.hdf5

* assigning star properties to halo merger trees
* read 673 halos with star particles from:  star_026.hdf5
# halo merger tree properties are stored as dictionary

for k in halt.keys():
    print(k)am.phantom
am.progenitor.main
axis.b/a
axis.c/a
catalog.index
central.index
central.local.index
descendant.index
descendant.snapshot
dindex
final.index
host.distance
host.index
host.velocity
host.velocity.rad
host.velocity.tan
major.merger.snapshot
mass
mass.180m
mass.200c
mass.200m
mass.500c
mass.bound
mass.lowres
mass.vir
position
position.offset
progenitor.co.dindex
progenitor.co.index
progenitor.last.dindex
progenitor.main.index
progenitor.main.last.dindex
progenitor.number
radius
scale.radius
scale.radius.klypin
snapshot
spin.bullock
spin.peebles
tid
vel.circ.max
vel.std
velocity
velocity.offset
lowres.mass.frac
star.form.time.100
star.form.time.50
star.form.time.90
star.form.time.95
star.form.time.dif.68
star.indices
star.mass
star.mass.neutral
star.massfraction
star.number
star.position
star.radius.50
star.radius.90
star.vel.circ.50
star.vel.std
star.vel.std.50
star.velocity
# now each halo has a corredponding snapshot index

halt['snapshot']_____no_output_____# so, get all halos at snapshot 600 (z = 0) and print their masses

hindices = np.where(halt['snapshot'] == 600)[0]
print(halt['mass'][hindices])[1.0446296e+12 6.0505699e+11 2.0990027e+11 ... 5.9103990e+06 4.2217950e+06
 3.3773505e+06]
# alternately, get catalog of halos only at snapshot 600 from tree

hal = rockstar.io.IO.get_catalog_from_tree(halt, 600)_____no_output_____hal['mass']_____no_output_____# whether halo is 'phantom' interpolation across snapshots

halt['am.phantom']_____no_output_____# tree index of its descendant at a later (usually the next) snapshot
# ConsistentTrees allows only one descendant per halo

print(halt['descendant.index'])

# for example, get descendant of halo index 100 and print its mass
hindex = 100
desc_index = halt['descendant.index'][hindex]
print(desc_index, halt['mass'][desc_index])[-2268669        0        0 ...  2268664  2268665  2268666]
84 13791026.0
# number of progenitor halos (can be arbitrarily large) at an earler (usually the previous) snapshot

halt['progenitor.number']_____no_output_____# tree index of main (most massive) progenitor
# iteratively loop over this to get list of main progenitors going back in time

halt['progenitor.main.index']_____no_output_____# whether I am the main (most massive) progenitor of my descendant

halt['am.progenitor.main']_____no_output_____# tree index of next co-progenitor

halt['progenitor.co.index']_____no_output_____# tree index of my descendant at the final snapshot (z = 0)

halt['final.index']_____no_output_____# example workflow

# start with a halo with tree index 0 (at z = 0)
hindex = 0
print(halt['snapshot'][hindex])
print(halt['mass'][hindex])

# find its progenitors, list their mass
prog_index = halt['progenitor.main.index'][hindex]
prog_indices = []
while prog_index >= 0:
    prog_indices.append(prog_index)
    prog_index = halt['progenitor.co.index'][prog_index]
print(prog_indices)
print(halt['mass'][prog_indices])

# for the main progenitor, find its progenitors, list their mass
hindex = prog_indices[0]
prog_index = halt['progenitor.main.index'][hindex]
prog_indices = []
while prog_index >= 0:
    prog_indices.append(prog_index)
    prog_index = halt['progenitor.co.index'][prog_index]
print(prog_indices)
print(halt['mass'][prog_indices])600
1044629600000.0
[1, 2]
[1.0447863e+12 6.1918805e+06]
[3, 4, 5, 6]
[1.04423077e+12 1.23837610e+07 1.94202280e+07 1.63233620e+07]
# get list of main progenitors as far back as can go

hindex = 0
prog_main_index = hindex
prog_main_indices = []
while prog_main_index >= 0:
    prog_main_indices.append(prog_main_index)
    prog_main_index = halt['progenitor.main.index'][prog_main_index]

print(prog_main_indices)
print(halt['mass'][prog_main_indices])
print(halt['position'][prog_main_indices])[0, 1, 3, 8, 13, 18, 23, 29, 35, 41, 47, 53, 61, 73, 88, 104, 121, 139, 158, 179, 204, 231, 259, 287, 316, 347, 379, 412, 447, 483, 520, 558, 596, 635, 676, 718, 762, 808, 854, 900, 948, 996, 1045, 1095, 1145, 1199, 1253, 1307, 1362, 1420, 1480, 1540, 1603, 1666, 1731, 1799, 1868, 1938, 2007, 2077, 2151, 2226, 2303, 2381, 2458, 2535, 2611, 2687, 2765, 2845, 2929, 3015, 3102, 3190, 3279, 3370, 3461, 3554, 3646, 3740, 3837, 3935, 4034, 4134, 4237, 4344, 4457, 4572, 4688, 4806, 4925, 5048, 5172, 5298, 5423, 5549, 5677, 5805, 5933, 6061, 6190, 6321, 6453, 6585, 6718, 6851, 6985, 7121, 7259, 7396, 7540, 7682, 7825, 7966, 8107, 8246, 8389, 8537, 8688, 8843, 8999, 9157, 9315, 9475, 9635, 9793, 9951, 10111, 10275, 10439, 10606, 10774, 10943, 11114, 11288, 11461, 11635, 11811, 11987, 12162, 12337, 12514, 12692, 12872, 13055, 13240, 13428, 13618, 13815, 14011, 14207, 14405, 14607, 14810, 15015, 15223, 15431, 15640, 15850, 16062, 16276, 16494, 16714, 16934, 17157, 17381, 17605, 17831, 18058, 18287, 18518, 18752, 18987, 19225, 19463, 19702, 19941, 20178, 20417, 20656, 20897, 21140, 21385, 21631, 21877, 22125, 22371, 22619, 22870, 23123, 23381, 23641, 23904, 24169, 24438, 24710, 24982, 25254, 25528, 25805, 26084, 26367, 26655, 26943, 27233, 27524, 27816, 28109, 28405, 28703, 29004, 29308, 29613, 29919, 30225, 30539, 30853, 31170, 31488, 31805, 32123, 32442, 32762, 33085, 33410, 33738, 34067, 34398, 34733, 35068, 35405, 35750, 36098, 36449, 36805, 37163, 37523, 37884, 38247, 38616, 38986, 39358, 39735, 40113, 40494, 40879, 41265, 41657, 42056, 42457, 42862, 43270, 43680, 44096, 44517, 44940, 45371, 45806, 46248, 46695, 47142, 47592, 48043, 48500, 48960, 49421, 49887, 50357, 50831, 51306, 51788, 52274, 52766, 53266, 53766, 54273, 54782, 55293, 55808, 56327, 56849, 57378, 57911, 58452, 58999, 59557, 60126, 60705, 61286, 61878, 62473, 63068, 63675, 64288, 64906, 65527, 66154, 66785, 67421, 68062, 68709, 69363, 70029, 70696, 71373, 72051, 72731, 73418, 74110, 74806, 75505, 76207, 76919, 77641, 78367, 79095, 79830, 80573, 81316, 82065, 82819, 83581, 84347, 85121, 85898, 86680, 87469, 88262, 89062, 89870, 90680, 91498, 92318, 93142, 93973, 94811, 95651, 96496, 97349, 98206, 99063, 99930, 100801, 101677, 102561, 103452, 104345, 105245, 106152, 107067, 107990, 108919, 109853, 110798, 111748, 112706, 113668, 114638, 115614, 116594, 117588, 118584, 119586, 120596, 121611, 122632, 123664, 124705, 125751, 126800, 127851, 128903, 129959, 131026, 132089, 133154, 134222, 135302, 136383, 137468, 138556, 139648, 140746, 141855, 142972, 144093, 145222, 146355, 147493, 148637, 149790, 150948, 152109, 153276, 154453, 155646, 156843, 158042, 159240, 160451, 161674, 162902, 164138, 165378, 166630, 167890, 169163, 170439, 171725, 173022, 174322, 175622, 176926, 178242, 179570, 180902, 182252, 183603, 184960, 186326, 187695, 189068, 190448, 191839, 193231, 194621, 196018, 197421, 198832, 200247, 201667, 203093, 204531, 205979, 207437, 208910, 210394, 211892, 213395, 214904, 216419, 217942, 219479, 221029, 222583, 224149, 225727, 227305, 228886, 230479, 232083, 233686, 235296, 236909, 238526, 240139, 241759, 243391, 245024, 246665, 248309, 249956, 251612, 253277, 254944, 256626, 258317, 260018, 261730, 263449, 265177, 266913, 268660, 270415, 272179, 273953, 275732, 277510, 279294, 281082, 282869, 284664, 286455, 288260, 290073, 291898, 293734, 295571, 297416, 299270, 301123, 302985, 304849, 306713, 308582, 310446, 312323, 314206, 316092, 317978, 319865, 321770, 323690, 325612, 327533, 329454, 331381, 333313, 335242, 337175, 339105, 341024, 342947, 344870, 346782, 348691, 350601, 352507, 354402, 356312, 358198, 360075, 361934, 363779, 365620, 367455, 369269, 371071, 372861, 374638, 376386, 378124, 379838, 381524, 383202, 384844, 386454, 388039, 389607, 391131, 392621, 394069, 395472, 396852, 398207, 399528, 400813, 402069, 403289, 404459, 405577, 406647, 407684, 408686, 409661, 410596, 411489, 412333, 413139, 413915, 414651, 415353, 416013, 416651, 417262, 417847, 418391, 418883, 419351, 419786, 420192, 420571, 420925, 421258, 421564, 421845, 422113, 422368, 422604, 422832, 423046, 423248, 423436, 423611, 423772, 423917, 424048, 424171, 424277, 424371, 424453, 424528, 424595, 424653, 424700, 424738]
[1.04462962e+12 1.04478632e+12 1.04423077e+12 1.04398855e+12
 1.04333332e+12 1.04290602e+12 1.04243587e+12 1.04243587e+12
 1.04212247e+12 1.04182337e+12 1.04149569e+12 1.04022789e+12
 1.03830487e+12 1.03693727e+12 1.03534186e+12 1.03380340e+12
 1.03145302e+12 1.02884613e+12 1.02622508e+12 1.02408834e+12
 1.02237884e+12 1.02099707e+12 1.02009969e+12 1.01904561e+12
 1.01766385e+12 1.01713674e+12 1.01633904e+12 1.01576927e+12
 1.01518521e+12 1.01438751e+12 1.01351850e+12 1.01327634e+12
 1.01396008e+12 1.01358974e+12 1.01263527e+12 1.01247864e+12
 1.01200862e+12 1.01185185e+12 1.01109688e+12 1.01048438e+12
 1.00994299e+12 1.00950141e+12 1.00881767e+12 1.00844732e+12
 1.00757838e+12 1.00699433e+12 1.00639605e+12 1.00632481e+12
 1.00562679e+12 1.00501429e+12 1.00455842e+12 1.00361824e+12
 1.00311971e+12 1.00263533e+12 1.00146722e+12 1.00072653e+12
 9.99529972e+11 9.99928758e+11 9.98860390e+11 9.97606818e+11
 9.97037048e+11 9.96723655e+11 9.95099738e+11 9.94544189e+11
 9.93717977e+11 9.93418740e+11 9.93005666e+11 9.90854644e+11
 9.89999989e+11 9.88561277e+11 9.86367459e+11 9.86638123e+11
 9.85370329e+11 9.84415994e+11 9.83433019e+11 9.83162356e+11
 9.80498579e+11 9.80769178e+11 9.78774917e+11 9.77393156e+11
 9.76096788e+11 9.75256420e+11 9.73646660e+11 9.73019873e+11
 9.72350423e+11 9.70612539e+11 9.69487221e+11 9.68461517e+11
 9.68148124e+11 9.67122485e+11 9.66054117e+11 9.65071208e+11
 9.62492891e+11 9.63005710e+11 9.61737916e+11 9.61438810e+11
 9.59643845e+11 9.58689444e+11 9.58290657e+11 9.57706535e+11
 9.55854684e+11 9.55427324e+11 9.54629554e+11 9.54529874e+11
 9.53133892e+11 9.53490014e+11 9.52407425e+11 9.51566926e+11
 9.50697984e+11 9.50085485e+11 9.48746453e+11 9.46980061e+11
 9.46396004e+11 9.44330441e+11 9.42848999e+11 9.42735098e+11
 9.41851804e+11 9.40284838e+11 9.39586945e+11 9.39259265e+11
 9.37763471e+11 9.36623866e+11 9.35840449e+11 9.33105369e+11
 9.32606902e+11 9.30170929e+11 9.29572585e+11 9.27207981e+11
 9.24985721e+11 9.24344779e+11 9.22763526e+11 9.19458677e+11
 9.17706572e+11 9.17236417e+11 9.15042730e+11 9.12891707e+11
 9.12279208e+11 9.10797767e+11 9.07293426e+11 9.07008541e+11
 9.05726460e+11 9.04045593e+11 9.02905987e+11 9.00726522e+11
 8.98888892e+11 8.97749287e+11 8.96039846e+11 8.94330470e+11
 8.92165292e+11 8.90284868e+11 8.88262164e+11 8.86395961e+11
 8.85128167e+11 8.83475808e+11 8.82079760e+11 8.79487156e+11
 8.76851888e+11 8.75683709e+11 8.73262088e+11 8.71723631e+11
 8.68760682e+11 8.65883193e+11 8.62222221e+11 8.58219414e+11
 8.53860418e+11 8.48490004e+11 8.43390321e+11 8.37492867e+11
 8.32891716e+11 8.29131063e+11 8.26994328e+11 8.24373215e+11
 8.22792028e+11 8.20512752e+11 8.18774934e+11 8.17735074e+11
 8.15455863e+11 8.14131053e+11 8.12478628e+11 8.11125375e+11
 8.09330475e+11 8.08319058e+11 8.06381748e+11 8.04145267e+11
 8.02564145e+11 8.00698008e+11 7.99316247e+11 7.97435888e+11
 7.95199472e+11 7.94017071e+11 7.92364712e+11 7.90398894e+11
 7.89159608e+11 7.86680906e+11 7.84458711e+11 7.81011386e+11
 7.76823374e+11 7.72692312e+11 7.69458700e+11 7.68205128e+11
 7.66339056e+11 7.65185163e+11 7.64131017e+11 7.62735034e+11
 7.62264945e+11 7.60341856e+11 7.59857545e+11 7.59145300e+11
 7.57663793e+11 7.57022786e+11 7.56210860e+11 7.55569787e+11
 7.55284902e+11 7.54045616e+11 7.53319084e+11 7.51766405e+11
 7.50997144e+11 7.49900268e+11 7.49501415e+11 7.49059834e+11
 7.48176605e+11 7.47193696e+11 7.47008557e+11 7.46096886e+11
 7.45384641e+11 7.44045543e+11 7.43319077e+11 7.42507086e+11
 7.41809127e+11 7.40840440e+11 7.40441588e+11 7.39472900e+11
 7.39017097e+11 7.38575516e+11 7.38062696e+11 7.37906000e+11
 7.37649558e+11 7.37806254e+11 7.36809124e+11 7.36011354e+11
 7.35883231e+11 7.35683740e+11 7.35056953e+11 7.35655297e+11
 7.34686609e+11 7.33632463e+11 7.34244962e+11 7.33418815e+11
 7.32962947e+11 7.31809120e+11 7.31353252e+11 7.30840433e+11
 7.30598277e+11 7.30071237e+11 7.30142474e+11 7.29515688e+11
 7.29430163e+11 7.29572639e+11 7.29330483e+11 7.30113966e+11
 7.29900319e+11 7.30641007e+11 7.30256376e+11 7.30954400e+11
 7.32307718e+11 7.33119644e+11 7.33418815e+11 7.33960143e+11
 7.34757847e+11 7.35626789e+11 7.37179468e+11 7.37735082e+11
 7.39102556e+11 7.39729342e+11 7.38205106e+11 7.38262122e+11
 7.38390311e+11 7.38276344e+11 7.38689417e+11 7.39116843e+11
 7.39729342e+11 7.40270670e+11 7.40313399e+11 7.40897456e+11
 7.42065504e+11 7.42364676e+11 7.43119651e+11 7.44059830e+11
 7.44928772e+11 7.45641017e+11 7.45698034e+11 7.45997140e+11
 7.45726476e+11 7.45555558e+11 7.45655239e+11 7.45185149e+11
 7.45056961e+11 7.44558428e+11 7.44159576e+11 7.42977176e+11
 7.41438718e+11 7.40113973e+11 7.38418819e+11 7.37478640e+11
 7.37022771e+11 7.37464353e+11 7.37521369e+11 7.37051279e+11
 7.37663844e+11 7.38547007e+11 7.38888909e+11 7.37920221e+11
 7.37592607e+11 7.37307656e+11 7.36737886e+11 7.34572642e+11
 7.33547004e+11 7.32649554e+11 7.32065563e+11 7.30071237e+11
 7.27792026e+11 7.24273463e+11 7.22606817e+11 7.21452990e+11
 7.20527032e+11 7.19301968e+11 7.18162362e+11 7.17649609e+11
 7.17008536e+11 7.15569824e+11 7.14900308e+11 7.12692335e+11
 7.09643862e+11 7.05227915e+11 7.00940157e+11 6.96353292e+11
 6.92806287e+11 6.89857561e+11 6.87136768e+11 6.83561255e+11
 6.81253601e+11 6.78347604e+11 6.74088288e+11 6.69501424e+11
 6.66125337e+11 6.62065512e+11 6.57521377e+11 6.53461553e+11
 6.49700835e+11 6.46609699e+11 6.43319071e+11 6.40199426e+11
 6.36652421e+11 6.29957263e+11 6.23817654e+11 6.18262102e+11
 6.13632442e+11 6.08333332e+11 6.03589706e+11 5.97977203e+11
 5.91652454e+11 5.82891733e+11 5.68589746e+11 5.48746428e+11
 5.33575500e+11 5.23603968e+11 5.13019970e+11 5.02535586e+11
 4.94829044e+11 4.87079739e+11 4.80527090e+11 4.73148162e+11
 4.66168054e+11 4.62279180e+11 4.57806250e+11 4.54373212e+11
 4.50185167e+11 4.46595432e+11 4.44829041e+11 4.41566953e+11
 4.37820522e+11 4.34814845e+11 4.32236462e+11 4.29928776e+11
 4.27378934e+11 4.24131068e+11 4.18660942e+11 4.14430200e+11
 4.10712244e+11 4.07336157e+11 4.03247858e+11 3.99002862e+11
 3.94843292e+11 3.90783468e+11 3.86153841e+11 3.81367517e+11
 3.76139612e+11 3.69786323e+11 3.61509978e+11 3.51980061e+11
 3.37934483e+11 3.26980076e+11 3.20356123e+11 3.16111127e+11
 3.13190875e+11 3.10868935e+11 3.09131051e+11 3.06780635e+11
 3.04387457e+11 3.02948712e+11 3.01566951e+11 3.00940165e+11
 3.00014240e+11 2.98632479e+11 2.96282063e+11 2.94487196e+11
 2.92122493e+11 2.89871790e+11 2.87207981e+11 2.84259254e+11
 2.82122519e+11 2.79173792e+11 2.77407400e+11 2.74245009e+11
 2.70740750e+11 2.67279188e+11 2.62977208e+11 2.58447278e+11
 2.54672355e+11 2.50826195e+11 2.47051272e+11 2.42678055e+11
 2.38105412e+11 2.34814816e+11 2.31723647e+11 2.29273502e+11
 2.26851865e+11 2.24216531e+11 2.20498575e+11 2.15484334e+11
 2.09173774e+11 2.03675222e+11 1.97720801e+11 1.93831895e+11
 1.89586899e+11 1.84487182e+11 1.76809116e+11 1.62962964e+11
 1.51239311e+11 1.44700850e+11 1.40857557e+11 1.38203709e+11
 1.35541309e+11 1.32760682e+11 1.31276358e+11 1.30552709e+11
 1.29998578e+11 1.29146724e+11 1.28407405e+11 1.26903132e+11
 1.28894583e+11 1.27306269e+11 1.28015671e+11 1.28313385e+11
 1.28142451e+11 1.27405990e+11 1.26065533e+11 1.25018522e+11
 1.23662393e+11 1.22152419e+11 1.21226502e+11 1.21106842e+11
 1.20970084e+11 1.20636760e+11 1.19954416e+11 1.20464384e+11
 1.20813388e+11 1.21324790e+11 1.21410257e+11 1.21823363e+11
 1.22431619e+11 1.23283472e+11 1.22739311e+11 1.21695158e+11
 1.20133902e+11 1.18066954e+11 1.15193733e+11 1.11062680e+11
 1.07316240e+11 3.73632492e+10 3.30527068e+10 3.43290593e+10
 4.02478612e+10 2.85940183e+10 2.83304858e+10 2.77834772e+10
 2.93290598e+10 3.64643860e+10 3.65911654e+10 3.63703706e+10
 3.52207995e+10 3.44928788e+10 3.69629635e+10 3.61680896e+10
 3.47150991e+10 3.34487183e+10 3.04373207e+10 3.16923064e+10
 3.08162376e+10 2.88333332e+10 2.64857539e+10 2.63945851e+10
 2.62307697e+10 2.62763540e+10 2.65555558e+10 2.68119675e+10
 2.73433068e+10 2.78660977e+10 2.82008556e+10 2.84088320e+10
 2.82179482e+10 2.78760694e+10 2.75470090e+10 2.70384599e+10
 2.66082611e+10 2.61923062e+10 2.56339026e+10 2.48689459e+10
 2.42094019e+10 2.36723651e+10 2.29472932e+10 2.21011395e+10
 2.11623916e+10 1.98475776e+10 1.86410250e+10 1.72592579e+10
 1.61495726e+10 1.34366095e+10 1.36978627e+10 1.18262108e+10
 1.05267804e+10 9.55940147e+09 8.31538483e+09 7.57635328e+09
 6.80256410e+09 6.41367501e+09 6.04629606e+09 5.32863232e+09
 4.49558374e+09 3.93717939e+09 3.48148147e+09 3.01680896e+09
 2.82122496e+09 2.67293440e+09 2.48746445e+09 2.29829069e+09
 2.23831910e+09 2.17806259e+09 2.06168090e+09 1.93803418e+09
 1.79672358e+09 1.67207962e+09 1.48945869e+09 1.18320512e+09
 1.06162400e+09 1.01940166e+09 9.60299136e+08 8.85156672e+08
 8.30840448e+08 7.11495744e+08 6.76039872e+08 7.29230784e+08
 6.56339072e+08 6.53803392e+08 6.17222208e+08 6.03988608e+08
 5.85128192e+08 5.47692288e+08 4.91410240e+08 4.63546976e+08
 4.08105376e+08 3.05085472e+08 2.72165248e+08 2.60897440e+08
 2.67094016e+08 2.83133888e+08 2.72435904e+08 2.54430192e+08
 2.37264960e+08 2.17279200e+08 2.01239312e+08 1.79287744e+08
 1.28340456e+08 1.00195160e+08 7.20512800e+07 5.96666680e+07]
[[41821.938 44121.984 46288.46 ]
 [41822.05  44121.824 46288.25 ]
 [41822.195 44121.668 46288.023]
 ...
 [43206.383 41736.426 44146.996]
 [43208.477 41728.617 44142.766]
 [43212.594 41722.254 44141.152]]
# halt.prop() computes derived quantities and can make walking the tree easier

# for halo with tree index = 0, get its main progenitors going back as far as can (including self)
hindex = 0
prog_indices = halt.prop('progenitor.main.indices', hindex)

# print mass history
print(prog_indices)
print(halt['mass'][prog_indices])[     0      1      3      8     13     18     23     29     35     41
     47     53     61     73     88    104    121    139    158    179
    204    231    259    287    316    347    379    412    447    483
    520    558    596    635    676    718    762    808    854    900
    948    996   1045   1095   1145   1199   1253   1307   1362   1420
   1480   1540   1603   1666   1731   1799   1868   1938   2007   2077
   2151   2226   2303   2381   2458   2535   2611   2687   2765   2845
   2929   3015   3102   3190   3279   3370   3461   3554   3646   3740
   3837   3935   4034   4134   4237   4344   4457   4572   4688   4806
   4925   5048   5172   5298   5423   5549   5677   5805   5933   6061
   6190   6321   6453   6585   6718   6851   6985   7121   7259   7396
   7540   7682   7825   7966   8107   8246   8389   8537   8688   8843
   8999   9157   9315   9475   9635   9793   9951  10111  10275  10439
  10606  10774  10943  11114  11288  11461  11635  11811  11987  12162
  12337  12514  12692  12872  13055  13240  13428  13618  13815  14011
  14207  14405  14607  14810  15015  15223  15431  15640  15850  16062
  16276  16494  16714  16934  17157  17381  17605  17831  18058  18287
  18518  18752  18987  19225  19463  19702  19941  20178  20417  20656
  20897  21140  21385  21631  21877  22125  22371  22619  22870  23123
  23381  23641  23904  24169  24438  24710  24982  25254  25528  25805
  26084  26367  26655  26943  27233  27524  27816  28109  28405  28703
  29004  29308  29613  29919  30225  30539  30853  31170  31488  31805
  32123  32442  32762  33085  33410  33738  34067  34398  34733  35068
  35405  35750  36098  36449  36805  37163  37523  37884  38247  38616
  38986  39358  39735  40113  40494  40879  41265  41657  42056  42457
  42862  43270  43680  44096  44517  44940  45371  45806  46248  46695
  47142  47592  48043  48500  48960  49421  49887  50357  50831  51306
  51788  52274  52766  53266  53766  54273  54782  55293  55808  56327
  56849  57378  57911  58452  58999  59557  60126  60705  61286  61878
  62473  63068  63675  64288  64906  65527  66154  66785  67421  68062
  68709  69363  70029  70696  71373  72051  72731  73418  74110  74806
  75505  76207  76919  77641  78367  79095  79830  80573  81316  82065
  82819  83581  84347  85121  85898  86680  87469  88262  89062  89870
  90680  91498  92318  93142  93973  94811  95651  96496  97349  98206
  99063  99930 100801 101677 102561 103452 104345 105245 106152 107067
 107990 108919 109853 110798 111748 112706 113668 114638 115614 116594
 117588 118584 119586 120596 121611 122632 123664 124705 125751 126800
 127851 128903 129959 131026 132089 133154 134222 135302 136383 137468
 138556 139648 140746 141855 142972 144093 145222 146355 147493 148637
 149790 150948 152109 153276 154453 155646 156843 158042 159240 160451
 161674 162902 164138 165378 166630 167890 169163 170439 171725 173022
 174322 175622 176926 178242 179570 180902 182252 183603 184960 186326
 187695 189068 190448 191839 193231 194621 196018 197421 198832 200247
 201667 203093 204531 205979 207437 208910 210394 211892 213395 214904
 216419 217942 219479 221029 222583 224149 225727 227305 228886 230479
 232083 233686 235296 236909 238526 240139 241759 243391 245024 246665
 248309 249956 251612 253277 254944 256626 258317 260018 261730 263449
 265177 266913 268660 270415 272179 273953 275732 277510 279294 281082
 282869 284664 286455 288260 290073 291898 293734 295571 297416 299270
 301123 302985 304849 306713 308582 310446 312323 314206 316092 317978
 319865 321770 323690 325612 327533 329454 331381 333313 335242 337175
 339105 341024 342947 344870 346782 348691 350601 352507 354402 356312
 358198 360075 361934 363779 365620 367455 369269 371071 372861 374638
 376386 378124 379838 381524 383202 384844 386454 388039 389607 391131
 392621 394069 395472 396852 398207 399528 400813 402069 403289 404459
 405577 406647 407684 408686 409661 410596 411489 412333 413139 413915
 414651 415353 416013 416651 417262 417847 418391 418883 419351 419786
 420192 420571 420925 421258 421564 421845 422113 422368 422604 422832
 423046 423248 423436 423611 423772 423917 424048 424171 424277 424371
 424453 424528 424595 424653 424700 424738]
[1.04462962e+12 1.04478632e+12 1.04423077e+12 1.04398855e+12
 1.04333332e+12 1.04290602e+12 1.04243587e+12 1.04243587e+12
 1.04212247e+12 1.04182337e+12 1.04149569e+12 1.04022789e+12
 1.03830487e+12 1.03693727e+12 1.03534186e+12 1.03380340e+12
 1.03145302e+12 1.02884613e+12 1.02622508e+12 1.02408834e+12
 1.02237884e+12 1.02099707e+12 1.02009969e+12 1.01904561e+12
 1.01766385e+12 1.01713674e+12 1.01633904e+12 1.01576927e+12
 1.01518521e+12 1.01438751e+12 1.01351850e+12 1.01327634e+12
 1.01396008e+12 1.01358974e+12 1.01263527e+12 1.01247864e+12
 1.01200862e+12 1.01185185e+12 1.01109688e+12 1.01048438e+12
 1.00994299e+12 1.00950141e+12 1.00881767e+12 1.00844732e+12
 1.00757838e+12 1.00699433e+12 1.00639605e+12 1.00632481e+12
 1.00562679e+12 1.00501429e+12 1.00455842e+12 1.00361824e+12
 1.00311971e+12 1.00263533e+12 1.00146722e+12 1.00072653e+12
 9.99529972e+11 9.99928758e+11 9.98860390e+11 9.97606818e+11
 9.97037048e+11 9.96723655e+11 9.95099738e+11 9.94544189e+11
 9.93717977e+11 9.93418740e+11 9.93005666e+11 9.90854644e+11
 9.89999989e+11 9.88561277e+11 9.86367459e+11 9.86638123e+11
 9.85370329e+11 9.84415994e+11 9.83433019e+11 9.83162356e+11
 9.80498579e+11 9.80769178e+11 9.78774917e+11 9.77393156e+11
 9.76096788e+11 9.75256420e+11 9.73646660e+11 9.73019873e+11
 9.72350423e+11 9.70612539e+11 9.69487221e+11 9.68461517e+11
 9.68148124e+11 9.67122485e+11 9.66054117e+11 9.65071208e+11
 9.62492891e+11 9.63005710e+11 9.61737916e+11 9.61438810e+11
 9.59643845e+11 9.58689444e+11 9.58290657e+11 9.57706535e+11
 9.55854684e+11 9.55427324e+11 9.54629554e+11 9.54529874e+11
 9.53133892e+11 9.53490014e+11 9.52407425e+11 9.51566926e+11
 9.50697984e+11 9.50085485e+11 9.48746453e+11 9.46980061e+11
 9.46396004e+11 9.44330441e+11 9.42848999e+11 9.42735098e+11
 9.41851804e+11 9.40284838e+11 9.39586945e+11 9.39259265e+11
 9.37763471e+11 9.36623866e+11 9.35840449e+11 9.33105369e+11
 9.32606902e+11 9.30170929e+11 9.29572585e+11 9.27207981e+11
 9.24985721e+11 9.24344779e+11 9.22763526e+11 9.19458677e+11
 9.17706572e+11 9.17236417e+11 9.15042730e+11 9.12891707e+11
 9.12279208e+11 9.10797767e+11 9.07293426e+11 9.07008541e+11
 9.05726460e+11 9.04045593e+11 9.02905987e+11 9.00726522e+11
 8.98888892e+11 8.97749287e+11 8.96039846e+11 8.94330470e+11
 8.92165292e+11 8.90284868e+11 8.88262164e+11 8.86395961e+11
 8.85128167e+11 8.83475808e+11 8.82079760e+11 8.79487156e+11
 8.76851888e+11 8.75683709e+11 8.73262088e+11 8.71723631e+11
 8.68760682e+11 8.65883193e+11 8.62222221e+11 8.58219414e+11
 8.53860418e+11 8.48490004e+11 8.43390321e+11 8.37492867e+11
 8.32891716e+11 8.29131063e+11 8.26994328e+11 8.24373215e+11
 8.22792028e+11 8.20512752e+11 8.18774934e+11 8.17735074e+11
 8.15455863e+11 8.14131053e+11 8.12478628e+11 8.11125375e+11
 8.09330475e+11 8.08319058e+11 8.06381748e+11 8.04145267e+11
 8.02564145e+11 8.00698008e+11 7.99316247e+11 7.97435888e+11
 7.95199472e+11 7.94017071e+11 7.92364712e+11 7.90398894e+11
 7.89159608e+11 7.86680906e+11 7.84458711e+11 7.81011386e+11
 7.76823374e+11 7.72692312e+11 7.69458700e+11 7.68205128e+11
 7.66339056e+11 7.65185163e+11 7.64131017e+11 7.62735034e+11
 7.62264945e+11 7.60341856e+11 7.59857545e+11 7.59145300e+11
 7.57663793e+11 7.57022786e+11 7.56210860e+11 7.55569787e+11
 7.55284902e+11 7.54045616e+11 7.53319084e+11 7.51766405e+11
 7.50997144e+11 7.49900268e+11 7.49501415e+11 7.49059834e+11
 7.48176605e+11 7.47193696e+11 7.47008557e+11 7.46096886e+11
 7.45384641e+11 7.44045543e+11 7.43319077e+11 7.42507086e+11
 7.41809127e+11 7.40840440e+11 7.40441588e+11 7.39472900e+11
 7.39017097e+11 7.38575516e+11 7.38062696e+11 7.37906000e+11
 7.37649558e+11 7.37806254e+11 7.36809124e+11 7.36011354e+11
 7.35883231e+11 7.35683740e+11 7.35056953e+11 7.35655297e+11
 7.34686609e+11 7.33632463e+11 7.34244962e+11 7.33418815e+11
 7.32962947e+11 7.31809120e+11 7.31353252e+11 7.30840433e+11
 7.30598277e+11 7.30071237e+11 7.30142474e+11 7.29515688e+11
 7.29430163e+11 7.29572639e+11 7.29330483e+11 7.30113966e+11
 7.29900319e+11 7.30641007e+11 7.30256376e+11 7.30954400e+11
 7.32307718e+11 7.33119644e+11 7.33418815e+11 7.33960143e+11
 7.34757847e+11 7.35626789e+11 7.37179468e+11 7.37735082e+11
 7.39102556e+11 7.39729342e+11 7.38205106e+11 7.38262122e+11
 7.38390311e+11 7.38276344e+11 7.38689417e+11 7.39116843e+11
 7.39729342e+11 7.40270670e+11 7.40313399e+11 7.40897456e+11
 7.42065504e+11 7.42364676e+11 7.43119651e+11 7.44059830e+11
 7.44928772e+11 7.45641017e+11 7.45698034e+11 7.45997140e+11
 7.45726476e+11 7.45555558e+11 7.45655239e+11 7.45185149e+11
 7.45056961e+11 7.44558428e+11 7.44159576e+11 7.42977176e+11
 7.41438718e+11 7.40113973e+11 7.38418819e+11 7.37478640e+11
 7.37022771e+11 7.37464353e+11 7.37521369e+11 7.37051279e+11
 7.37663844e+11 7.38547007e+11 7.38888909e+11 7.37920221e+11
 7.37592607e+11 7.37307656e+11 7.36737886e+11 7.34572642e+11
 7.33547004e+11 7.32649554e+11 7.32065563e+11 7.30071237e+11
 7.27792026e+11 7.24273463e+11 7.22606817e+11 7.21452990e+11
 7.20527032e+11 7.19301968e+11 7.18162362e+11 7.17649609e+11
 7.17008536e+11 7.15569824e+11 7.14900308e+11 7.12692335e+11
 7.09643862e+11 7.05227915e+11 7.00940157e+11 6.96353292e+11
 6.92806287e+11 6.89857561e+11 6.87136768e+11 6.83561255e+11
 6.81253601e+11 6.78347604e+11 6.74088288e+11 6.69501424e+11
 6.66125337e+11 6.62065512e+11 6.57521377e+11 6.53461553e+11
 6.49700835e+11 6.46609699e+11 6.43319071e+11 6.40199426e+11
 6.36652421e+11 6.29957263e+11 6.23817654e+11 6.18262102e+11
 6.13632442e+11 6.08333332e+11 6.03589706e+11 5.97977203e+11
 5.91652454e+11 5.82891733e+11 5.68589746e+11 5.48746428e+11
 5.33575500e+11 5.23603968e+11 5.13019970e+11 5.02535586e+11
 4.94829044e+11 4.87079739e+11 4.80527090e+11 4.73148162e+11
 4.66168054e+11 4.62279180e+11 4.57806250e+11 4.54373212e+11
 4.50185167e+11 4.46595432e+11 4.44829041e+11 4.41566953e+11
 4.37820522e+11 4.34814845e+11 4.32236462e+11 4.29928776e+11
 4.27378934e+11 4.24131068e+11 4.18660942e+11 4.14430200e+11
 4.10712244e+11 4.07336157e+11 4.03247858e+11 3.99002862e+11
 3.94843292e+11 3.90783468e+11 3.86153841e+11 3.81367517e+11
 3.76139612e+11 3.69786323e+11 3.61509978e+11 3.51980061e+11
 3.37934483e+11 3.26980076e+11 3.20356123e+11 3.16111127e+11
 3.13190875e+11 3.10868935e+11 3.09131051e+11 3.06780635e+11
 3.04387457e+11 3.02948712e+11 3.01566951e+11 3.00940165e+11
 3.00014240e+11 2.98632479e+11 2.96282063e+11 2.94487196e+11
 2.92122493e+11 2.89871790e+11 2.87207981e+11 2.84259254e+11
 2.82122519e+11 2.79173792e+11 2.77407400e+11 2.74245009e+11
 2.70740750e+11 2.67279188e+11 2.62977208e+11 2.58447278e+11
 2.54672355e+11 2.50826195e+11 2.47051272e+11 2.42678055e+11
 2.38105412e+11 2.34814816e+11 2.31723647e+11 2.29273502e+11
 2.26851865e+11 2.24216531e+11 2.20498575e+11 2.15484334e+11
 2.09173774e+11 2.03675222e+11 1.97720801e+11 1.93831895e+11
 1.89586899e+11 1.84487182e+11 1.76809116e+11 1.62962964e+11
 1.51239311e+11 1.44700850e+11 1.40857557e+11 1.38203709e+11
 1.35541309e+11 1.32760682e+11 1.31276358e+11 1.30552709e+11
 1.29998578e+11 1.29146724e+11 1.28407405e+11 1.26903132e+11
 1.28894583e+11 1.27306269e+11 1.28015671e+11 1.28313385e+11
 1.28142451e+11 1.27405990e+11 1.26065533e+11 1.25018522e+11
 1.23662393e+11 1.22152419e+11 1.21226502e+11 1.21106842e+11
 1.20970084e+11 1.20636760e+11 1.19954416e+11 1.20464384e+11
 1.20813388e+11 1.21324790e+11 1.21410257e+11 1.21823363e+11
 1.22431619e+11 1.23283472e+11 1.22739311e+11 1.21695158e+11
 1.20133902e+11 1.18066954e+11 1.15193733e+11 1.11062680e+11
 1.07316240e+11 3.73632492e+10 3.30527068e+10 3.43290593e+10
 4.02478612e+10 2.85940183e+10 2.83304858e+10 2.77834772e+10
 2.93290598e+10 3.64643860e+10 3.65911654e+10 3.63703706e+10
 3.52207995e+10 3.44928788e+10 3.69629635e+10 3.61680896e+10
 3.47150991e+10 3.34487183e+10 3.04373207e+10 3.16923064e+10
 3.08162376e+10 2.88333332e+10 2.64857539e+10 2.63945851e+10
 2.62307697e+10 2.62763540e+10 2.65555558e+10 2.68119675e+10
 2.73433068e+10 2.78660977e+10 2.82008556e+10 2.84088320e+10
 2.82179482e+10 2.78760694e+10 2.75470090e+10 2.70384599e+10
 2.66082611e+10 2.61923062e+10 2.56339026e+10 2.48689459e+10
 2.42094019e+10 2.36723651e+10 2.29472932e+10 2.21011395e+10
 2.11623916e+10 1.98475776e+10 1.86410250e+10 1.72592579e+10
 1.61495726e+10 1.34366095e+10 1.36978627e+10 1.18262108e+10
 1.05267804e+10 9.55940147e+09 8.31538483e+09 7.57635328e+09
 6.80256410e+09 6.41367501e+09 6.04629606e+09 5.32863232e+09
 4.49558374e+09 3.93717939e+09 3.48148147e+09 3.01680896e+09
 2.82122496e+09 2.67293440e+09 2.48746445e+09 2.29829069e+09
 2.23831910e+09 2.17806259e+09 2.06168090e+09 1.93803418e+09
 1.79672358e+09 1.67207962e+09 1.48945869e+09 1.18320512e+09
 1.06162400e+09 1.01940166e+09 9.60299136e+08 8.85156672e+08
 8.30840448e+08 7.11495744e+08 6.76039872e+08 7.29230784e+08
 6.56339072e+08 6.53803392e+08 6.17222208e+08 6.03988608e+08
 5.85128192e+08 5.47692288e+08 4.91410240e+08 4.63546976e+08
 4.08105376e+08 3.05085472e+08 2.72165248e+08 2.60897440e+08
 2.67094016e+08 2.83133888e+08 2.72435904e+08 2.54430192e+08
 2.37264960e+08 2.17279200e+08 2.01239312e+08 1.79287744e+08
 1.28340456e+08 1.00195160e+08 7.20512800e+07 5.96666680e+07]
# print stellar mass history - recall that not all snapshots necessarily have star particle information

print(halt['star.mass'][prog_indices])[1.18660276e+11            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan 1.18752903e+11
            nan            nan            nan            nan
            nan 1.18552773e+11            nan            nan
            nan            nan            nan 1.18551863e+11
            nan            nan            nan            nan
            nan 1.17996028e+11            nan            nan
            nan            nan            nan 1.17655233e+11
            nan            nan            nan            nan
            nan 1.17186454e+11            nan            nan
            nan            nan 1.17338194e+11            nan
            nan            nan            nan            nan
 1.17197685e+11            nan            nan            nan
            nan 1.16887175e+11            nan            nan
            nan            nan 1.17158380e+11            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan 1.15311165e+11            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan 1.10649999e+11            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
 1.02120800e+11            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan 9.66192415e+10            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
 9.12709222e+10            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
 8.56430920e+10            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
 7.57989458e+10            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan 6.60548649e+10            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan 5.57221151e+10
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan 4.60806922e+10            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
 3.64002877e+10            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
 2.93189878e+10            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan 2.46423511e+10
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan 2.05208699e+10            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
 1.79173601e+10            nan            nan            nan
            nan            nan            nan            nan
            nan 1.38665810e+10            nan            nan
            nan            nan            nan            nan
            nan 1.13886464e+10            nan            nan
            nan            nan            nan            nan
            nan 9.02544077e+09            nan            nan
            nan            nan            nan            nan
 6.78264934e+09            nan            nan            nan
            nan            nan            nan 5.66930381e+09
            nan            nan            nan            nan
            nan 3.73089715e+09            nan            nan
            nan            nan            nan 3.44640998e+09
            nan            nan            nan            nan
 2.98184038e+09            nan            nan            nan
            nan            nan 2.43616230e+09            nan
            nan            nan            nan 2.20910362e+09
            nan            nan            nan 1.59517658e+09
            nan            nan            nan            nan
 9.15415616e+08            nan            nan            nan
 8.56037632e+08            nan            nan            nan
 7.86940800e+08            nan            nan            nan
 6.29620160e+08            nan            nan            nan
 3.13484000e+08            nan            nan 2.33490992e+08
            nan            nan            nan 2.18582720e+08
            nan            nan 1.90617664e+08            nan
            nan 1.46347840e+08            nan            nan
 1.38594448e+08            nan            nan 1.24191136e+08
            nan 1.25934160e+08            nan            nan
 1.19543296e+08            nan            nan            nan
            nan 1.00559536e+08            nan            nan
            nan 7.21757440e+07            nan            nan
            nan 6.61122320e+07            nan            nan
            nan 3.93203520e+07            nan            nan
            nan 2.88685020e+07            nan            nan
 2.09101480e+07            nan            nan            nan
 1.26648420e+07            nan            nan 7.93452650e+06
            nan 5.83833600e+06            nan            nan
 3.81376975e+06            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan 8.01439750e+05
            nan            nan            nan            nan
            nan            nan            nan 8.12308250e+05
            nan            nan            nan            nan
            nan            nan 8.30590125e+05            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan]
# for halo with tree index = 1, get all of its progenitors at previous snapshot, print their masses

hindex = 1
prog_indices = halt.prop('progenitor.indices', hindex)

print(prog_indices)
print(halt['mass'][prog_indices])[3 4 5 6]
[1.04423077e+12 1.23837610e+07 1.94202280e+07 1.63233620e+07]
# for halo with tree index = 123456, get its descendants going forward as far as can (including self)

hindex = 123456
desc_indices = halt.prop('descendant.indices', hindex)

# print future mass growth
print(desc_indices)
print(halt['mass'][desc_indices])[123456 122426 121405 120390 119380 118377 117381 116387 115407 114431
 113460 112498 111541 110591 109647 108713 107784 106860 105945 105038
 104137 103244 102353 101469 100593  99722  98855  97999  97142  96289
  95445  94604  93765  92934  92111  91291  90472  89662  88852  88052
  87259  86470  85688  84911  84139  83372  82611  81859  81110  80367
  79625  78890  78162  77435  76713  76002  75299  74601  73905  73213
  72526  71846  71168  70490  69823  69157  68502  67855  67215  66579
  65946  65319  64698  64080  63467  62860  62264  61669  61076  60496
  59918  59349  58792  58244  57704  57171  56642  56120  55600  55085
  54574  54065  53558  53057  52558  52066  51580  51098  50623  50149
  49679  49212  48751  48291  47835  47384  46934  46487  46039  45597
  45162  44731  44308  43887  43471  43061  42653  42248  41847  41448
  41055  40668  40283  39902  39523  39146  38774  38404  38034  37672
  37310  36949  36590  36234  35883  35535  35190  34853  34518  34181
  33850  33521  33193  32868  32544  32224  31905  31587  31269  30951
  30634  30319  30005  29698  29392  29084  28780  28479  28182  27886
  27594  27303  27010  26720  26432  26144  25861  25582  25305  25030
  24754  24481  24209  23940  23675  23412  23152  22894  22640  22389
  22142  21894  21647  21400  21154  20909  20665  20424  20184  19945
  19706  19466  19226  18987  18752  18518  18287  18058  17831  17605
  17381  17157  16934  16714  16494  16276  16062  15850  15640  15431
  15223  15015  14810  14607  14405  14207  14011  13815  13618  13428
  13240  13055  12872  12692  12514  12337  12162  11987  11811  11635
  11461  11288  11114  10943  10774  10606  10439  10275  10111   9951
   9793   9635   9475   9315   9157   8999   8843   8688   8537   8389
   8246   8107   7966   7825   7682   7540   7396   7259   7121   6985
   6851   6718   6585   6453   6321   6190   6061   5933   5805   5677
   5549   5423   5298   5172   5048   4925   4806   4688   4572   4457
   4344   4237   4134   4034   3935   3837   3740   3646   3554   3461
   3370   3279   3190   3102   3015   2929   2845   2765   2687   2611
   2535   2458   2381   2303   2226   2151   2077   2007   1938   1868
   1799   1731   1666   1603   1540   1480   1420   1362   1307   1253
   1199   1145   1095   1045    996    948    900    854    808    762
    718    676    635    596    558    520    483    447    412    379
    347    316    287    259    231    204    179    158    139    121
    104     88     73     61     53     47     41     35     29     23
     18     13      8      3      1      0]
[2.08276360e+07 2.75826200e+07 2.11082620e+07 2.30783480e+07
 2.27977200e+07 2.02649580e+07 1.99829060e+07 2.13903140e+07
 1.99829060e+07 2.50484320e+07 2.84259260e+07 2.78632480e+07
 2.78632480e+07 2.50484320e+07 2.50484320e+07 2.64558400e+07
 2.53304840e+07 3.06780620e+07 2.11082620e+07 2.58931620e+07
 2.67378920e+07 3.65883200e+07 3.61659560e+07 3.57435880e+07
 3.18034180e+07 3.13108980e+07 3.08183760e+07 3.03258540e+07
 2.98333340e+07 3.29287740e+07 3.34928780e+07 3.18034180e+07
 2.78632480e+07 3.68703720e+07 2.32122511e+10 2.41737892e+10
 2.50470072e+10 2.36182323e+10 2.36054118e+10 2.30028493e+10
 2.31410258e+10 2.21538468e+10 2.10427351e+10 2.81794888e+10
 2.68304835e+10 2.69088317e+10 2.66239324e+10 2.61054116e+10
 2.52877496e+10 2.52977213e+10 2.52421652e+10 2.42977219e+10
 2.39131054e+10 2.39230771e+10 2.32321946e+10 2.36324782e+10
 2.30441595e+10 2.26111119e+10 2.29458698e+10 2.27008553e+10
 2.23376077e+10 2.25341870e+10 2.24544154e+10 2.22350418e+10
 2.21723648e+10 2.17749279e+10 2.21709414e+10 2.13005701e+10
 2.11367506e+10 2.09886044e+10 2.07492874e+10 2.04814828e+10
 2.02136760e+10 1.98931620e+10 1.97407396e+10 1.96196577e+10
 1.92592589e+10 1.92393155e+10 1.88390318e+10 1.84330486e+10
 1.84829051e+10 1.81923082e+10 1.79088323e+10 1.78475786e+10
 1.78789171e+10 1.74658130e+10 1.76994304e+10 1.72834755e+10
 1.71695155e+10 1.18380339e+10 1.19462963e+10 1.16719370e+10
 1.65925929e+10 1.71752131e+10 1.17833339e+10 1.19578348e+10
 1.18340454e+10 1.16102564e+10 1.12069796e+10 1.15230771e+10
 1.71495731e+10 1.71880346e+10 1.17451571e+10 1.17521367e+10
 1.16984330e+10 1.22574070e+10 1.15196580e+10 1.20263537e+10
 9.02036992e+09 9.82962995e+09 1.20074076e+10 1.12303421e+10
 8.59401728e+09 1.03437322e+10 8.12592589e+09 9.71609702e+09
 6.98589696e+09 7.13504256e+09 5.87521382e+09 4.93404570e+09
 3.30498586e+09 3.05968640e+09 2.78803430e+09 3.65014246e+09
 3.04914534e+09 2.84772096e+09 2.55327642e+09 2.10612531e+09
 2.22962970e+09 1.94002854e+09 1.79729344e+09 1.80826214e+09
 1.72806272e+09 1.58561254e+09 1.59330483e+09 1.34109683e+09
 1.52350426e+09 1.33941594e+09 1.35770662e+09 1.04754982e+09
 1.03938746e+09 1.33518515e+09 1.18715098e+09 1.18518515e+09
 1.25384614e+09 1.18995725e+09 1.25159552e+09 1.22992870e+09
 1.22710822e+09 1.22626778e+09 1.26539891e+09 1.30310541e+09
 1.30085466e+09 1.34475776e+09 1.26764954e+09 1.32225075e+09
 1.35517094e+09 1.33041318e+09 1.43176640e+09 1.42635328e+09
 1.48205133e+09 1.43091162e+09 1.46011392e+09 1.46068378e+09
 1.49472934e+09 1.48433050e+09 1.48076928e+09 1.47108262e+09
 1.46837606e+09 1.45113958e+09 1.50427354e+09 1.49615386e+09
 1.58817664e+09 1.57606835e+09 1.74074074e+09 1.67606848e+09
 1.80584038e+09 1.85441587e+09 2.17735040e+09 1.38726490e+09
 1.64415962e+09 1.36949427e+09 1.09482906e+09 1.69772083e+09
 1.98005696e+09 1.46552704e+09 1.18856128e+09 8.37022784e+08
 6.50997120e+08 5.48817664e+08 4.61296320e+08 2.83133888e+08
 3.24786336e+08 8.22792028e+11 8.24373215e+11 8.26994328e+11
 8.29131063e+11 8.32891716e+11 8.37492867e+11 8.43390321e+11
 8.48490004e+11 8.53860418e+11 8.58219414e+11 8.62222221e+11
 8.65883193e+11 8.68760682e+11 8.71723631e+11 8.73262088e+11
 8.75683709e+11 8.76851888e+11 8.79487156e+11 8.82079760e+11
 8.83475808e+11 8.85128167e+11 8.86395961e+11 8.88262164e+11
 8.90284868e+11 8.92165292e+11 8.94330470e+11 8.96039846e+11
 8.97749287e+11 8.98888892e+11 9.00726522e+11 9.02905987e+11
 9.04045593e+11 9.05726460e+11 9.07008541e+11 9.07293426e+11
 9.10797767e+11 9.12279208e+11 9.12891707e+11 9.15042730e+11
 9.17236417e+11 9.17706572e+11 9.19458677e+11 9.22763526e+11
 9.24344779e+11 9.24985721e+11 9.27207981e+11 9.29572585e+11
 9.30170929e+11 9.32606902e+11 9.33105369e+11 9.35840449e+11
 9.36623866e+11 9.37763471e+11 9.39259265e+11 9.39586945e+11
 9.40284838e+11 9.41851804e+11 9.42735098e+11 9.42848999e+11
 9.44330441e+11 9.46396004e+11 9.46980061e+11 9.48746453e+11
 9.50085485e+11 9.50697984e+11 9.51566926e+11 9.52407425e+11
 9.53490014e+11 9.53133892e+11 9.54529874e+11 9.54629554e+11
 9.55427324e+11 9.55854684e+11 9.57706535e+11 9.58290657e+11
 9.58689444e+11 9.59643845e+11 9.61438810e+11 9.61737916e+11
 9.63005710e+11 9.62492891e+11 9.65071208e+11 9.66054117e+11
 9.67122485e+11 9.68148124e+11 9.68461517e+11 9.69487221e+11
 9.70612539e+11 9.72350423e+11 9.73019873e+11 9.73646660e+11
 9.75256420e+11 9.76096788e+11 9.77393156e+11 9.78774917e+11
 9.80769178e+11 9.80498579e+11 9.83162356e+11 9.83433019e+11
 9.84415994e+11 9.85370329e+11 9.86638123e+11 9.86367459e+11
 9.88561277e+11 9.89999989e+11 9.90854644e+11 9.93005666e+11
 9.93418740e+11 9.93717977e+11 9.94544189e+11 9.95099738e+11
 9.96723655e+11 9.97037048e+11 9.97606818e+11 9.98860390e+11
 9.99928758e+11 9.99529972e+11 1.00072653e+12 1.00146722e+12
 1.00263533e+12 1.00311971e+12 1.00361824e+12 1.00455842e+12
 1.00501429e+12 1.00562679e+12 1.00632481e+12 1.00639605e+12
 1.00699433e+12 1.00757838e+12 1.00844732e+12 1.00881767e+12
 1.00950141e+12 1.00994299e+12 1.01048438e+12 1.01109688e+12
 1.01185185e+12 1.01200862e+12 1.01247864e+12 1.01263527e+12
 1.01358974e+12 1.01396008e+12 1.01327634e+12 1.01351850e+12
 1.01438751e+12 1.01518521e+12 1.01576927e+12 1.01633904e+12
 1.01713674e+12 1.01766385e+12 1.01904561e+12 1.02009969e+12
 1.02099707e+12 1.02237884e+12 1.02408834e+12 1.02622508e+12
 1.02884613e+12 1.03145302e+12 1.03380340e+12 1.03534186e+12
 1.03693727e+12 1.03830487e+12 1.04022789e+12 1.04149569e+12
 1.04182337e+12 1.04212247e+12 1.04243587e+12 1.04243587e+12
 1.04290602e+12 1.04333332e+12 1.04398855e+12 1.04423077e+12
 1.04478632e+12 1.04462962e+12]

# interfacting between halo catalog and merger trees_____no_output_____Each halo in the merger trees has a pointers to its array index in the halo catalog: 'catalog.index'

Conversely, each halo in the catalog has a pointer to its array index in the halo merger trees: 'tree.index'

You can use these to go back and forth between the two.

Note: tree ids/indices are unique across all snapshots, but halo catalog ids/indices are unique only at a given snapshot_____no_output_____

# read halo merger trees across all snapshots
halt = rockstar.io.IO.read_tree()

# read halo catalog at each snapshot
hals = rockstar.io.IO.read_catalogs(snapshot_values='all')
# in utilities.simulation.Snapshot():
  reading:  snapshot_times.txt
* read 2268668 halos from:  tree.hdf5

* assigning star properties to halo merger trees
* read 673 halos with star particles from:  star_026.hdf5
# starting from the halo catalog at z = 0, get index of the halo in the merger trees
hal = hals[600]

cat_index = 100  # random halo of interest
print(hal['mass'][cat_index])
tree_index = hal['tree.index'][cat_index]
print(tree_index)
print(halt['mass'][tree_index])_____no_output_____# conversely, starting from the halo merger trees, get index of the halo in the snapshot catalog
# because halo catalog indices are *not* unique across snapshots,
# you also need to use which snapshot index the halo points to

tree_index = 100  # random halo of interest
print(halt['mass'][tree_index])
snapshot_index = halt['snapshot'][tree_index]  # index of snapshot in halo catalog
cat_index = halt['catalog.index'][tree_index]  # halo catalog index at snapshot
print(snapshot_index, cat_index)
print(hals[snapshot_index]['mass'][cat_index])_____no_output_____

See rockstar.analysis for examples of high-level analysis, including plotting these data.

See utilities package for low-level functions that may be useful._____no_output_____