yt_astro_analysis.halo_analysis.halo_finding.rockstar.rockstar.RockstarHaloFinder

class yt_astro_analysis.halo_analysis.halo_finding.rockstar.rockstar.RockstarHaloFinder(ts, num_readers=1, num_writers=None, outbase='rockstar_halos', particle_type='all', mass_field='particle_mass', star_types=None, force_res=None, initial_metric_scaling=1.0, non_dm_metric_scaling=10.0, suppress_galaxies=1, total_particles=None, dm_only=False, particle_mass=None, min_halo_size=25, restart=False)

Spawns the Rockstar Halo finder, distributes particles and finds halos.

Rockstar has three main processes: reader, writer, and the server which coordinates reader/writer processes.

Parameters:
  • ts (DatasetSeries, Dataset) – The dataset or datsets on which halo finding will be run. If you intend to make a merger tree later, you must run Rockstar using a DatasetSeries containing all the snapshot to be included.

  • num_readers (int) – The number of reader can be increased from the default of 1 in the event that a single snapshot is split among many files. This can help in cases where performance is IO-limited. Default is 1. If run inline, it is equal to the number of MPI threads.

  • num_writers (int) – The number of writers determines the number of processing threads as well as the number of threads writing output data. The default is set to comm.size-num_readers-1. If run inline, the default is equal to the number of MPI threads.

  • outbase (str) – This is where the out*list files that Rockstar makes should be placed. Default is ‘rockstar_halos’.

  • particle_type (str) – This is the “particle type” that can be found in the data. This can be a filtered particle or an inherent type.

  • mass_field (optional, str) – The field to be used for the particle masses. The sampled field will be (<particle_type>, <mass_field>). This can be used to provide alternative particle masses for halo finding. Default: “particle_mass”

  • star_types (str list/array) – The types (as returned by data((particle_type, particle_type)) to be recognized as star particles.

  • force_res (float) – This parameter specifies the force resolution that Rockstar uses in units of Mpccm/h (comoving Mpc/h). If no value is provided, this parameter is automatically set to the width of the smallest grid element in the simulation from the last data snapshot (i.e. the one where time has evolved the longest) in the time series: ds_last.index.get_smallest_dx().to("Mpccm/h").

  • initial_metric_scaling (float) – The position element of the fof distance metric is divided by this parameter, set to 1 by default. If the initial_metric_scaling=0.1 the position element will have 10 times more weight than the velocity element, biasing the metric towards position information more so than velocity information. That was found to be needed for hydro-ART simulations with 10’s of parsecs resolution. Default: 1.0.

  • non_dm_metric_scaling (float) – The metric scaling to be used for non-dm particles. The effect of this parameter is currently unknown. Default: 10.

  • suppress_galaxies (int) – Wether to include non-dm halos (i.e. galaxies) in the catalogs. The effect of this parameter is currently unknown. Default: 1.

  • total_particles (int) – If supplied, this is a pre-calculated total number of particles present in the simulation. For example, this is useful when analyzing a series of snapshots where the number of dark matter particles should not change and this will save some disk access time. If left unspecified, it will be calculated automatically. Default: None.

  • particle_mass (optional, None, float, tuple, or unyt_quantity) – If supplied, this mass will be used to calculate the average particle spacing used in the friend-of-friends algorithm. The particle spacing will be (particle_mass / omega_matter * rho_cr)^1/3. If None, the mass is set as the minimum of all particles to be read. If a float, units are assumed to be in Msun/h. If a tuple, the format is assume to be (<value>, <units>). If a unyt_quantity, it must be convertible to units of Msun/h. To modify the masses of particles used for halo finding, see the mass_field keyword. Default: None.

  • restart (optional, bool) – Set to True to have rockstar restart from the first uncompleted snapshot. If False, rockstar will start at the first snapshot in the simulation. Default: False

Return type:

None

Examples

To use the script below you must run it using MPI: mpirun -np 4 python run_rockstar.py

>>> import yt
>>> yt.enable_parallelism()
>>> from yt.extensions.astro_analysis.halo_analysis import HaloCatalog
>>> data_ds = yt.load('Enzo_64/RD0006/RedshiftOutput0006')
>>> hc = HaloCatalog(data_ds=data_ds, finder_method='rockstar',
...                  finder_kwargs={"num_readers": 1, "num_writers": 2})
>>> hc.create()

__init__(ts[, num_readers, num_writers, ...])

get_dependencies(fields)

partition_index_2d(axis)

partition_index_3d(ds[, padding, rank_ratio])

partition_index_3d_bisection_list()

Returns an array that is used to drive _partition_index_3d_bisection, below.

partition_region_3d(left_edge, right_edge[, ...])

Given a region, it subdivides it into smaller regions for parallel analysis.

run([block_ratio, callbacks, restart])

comm