synthesizer.load_data.load_shark

A submodule for loading SHARK data into Synthesizer.

SHARK (Lagos+ 2018, https://github.com/ICRAR/shark) writes per-galaxy star formation and metal enrichment histories to star_formation_histories.hdf5 when run with output_sf_histories = true. Each galaxy’s history is stored per component (disk, merger-driven bulge, disk-instability-driven bulge) as the star formation rate and the metallicity of stars formed in each inter-snapshot time bin.

Example usage:

from synthesizer.load_data.load_shark import load_SHARK

# Particle galaxies (one "particle" per non-zero time bin, split
# across the grid ages where the bins are wider than the grid spacing)
galaxies = load_SHARK("star_formation_histories.hdf5", grid)

# Parametric galaxies binned onto the SPS grid
galaxies = load_SHARK(
    "star_formation_histories.hdf5", grid, method="parametric"
)

Notes

  • The SFHs are gross star formation (mass formed), so total initial mass exceeds the (post-recycling) stellar masses in the SHARK galaxies.hdf5 catalogue by a factor 1 / (1 - recycle).

  • Rows in star_formation_histories.hdf5 are a subset of the galaxies.hdf5 catalogue in a different order; join catalogue properties using the id_galaxy attribute attached to each returned galaxy, never by row position.

  • SFRs here are in Msun / yr / h, unlike the catalogue sfr_* datasets which are in Msun / Gyr / h.

  • The time bins are contiguous and the last one ends at the output snapshot, so ages are built from delta_t alone. (lbt_mean is the lookback time from z=0, not from the output.)

Functions

synthesizer.load_data.load_shark.load_SHARK(fname, grid, method='particle', components=('disks', 'bulges_mergers', 'bulges_diskins'), verbose=False, dtype=<class 'numpy.float64'>)[source]

Read a SHARK star formation histories file.

Each (time bin, component) entry is a top-hat of star formation with mass SFR * delta_t / h (converted to Msun) and the metallicity of the stars formed in that bin. Bins with zero star formation are dropped (SHARK zero-fills bins before a galaxy forms).

Parameters:
  • fname (str) – The SHARK star_formation_histories.hdf5 file to read.

  • grid (Grid) – Grid whose age and metallicity axes define the SFZH, and whose age spacing sets how finely the SHARK bins are split.

  • method (str) – ‘particle’ (default) returns particle galaxies with one particle per non-zero bin per component, split at every grid age the bin contains so young star formation is resolved. ‘parametric’ integrates each bin over the grid age cells (the parametric.Stars convention) and returns parametric galaxies. Note the per-particle component tags are lost in the combined SFZH; pass e.g. components=("disks",) for per-component parametric galaxies.

  • components (tuple) – SHARK components to include, a subset of (‘disks’, ‘bulges_mergers’, ‘bulges_diskins’).

  • verbose (bool) – Are we talking?

  • dtype (type) – The numpy dtype to cast all numerical particle arrays to. Defaults to np.float64 to match standard SPS grids. Set to np.float32 (with Grid(use_precision=np.float32)) to reduce memory.

Returns:

particle.Galaxy (method=’particle’) or parametric.Galaxy

(method=’parametric’) objects, in file row order, each with an id_galaxy attribute. Particle stars carry a star_component array indexing components.

Return type:

list

Raises:

InconsistentArguments – If method is unknown, components contains an unknown or repeated component, or a history has the wrong shape.