synthesizer.load_data.load_scsam

A submodule for loading SC-SAM data into Synthesizer.

SC-SAM sfhist files tabulate, per galaxy, the stellar mass formed in each (age, metallicity) bin. The file starts with three header lines (the grid shape, the metallicity bins in log10(Z / 0.02) and the age-bin centres in Gyr), then per galaxy a line of halo_ind birthhalo_id redshift followed by the age x Z mass grid in 10^9 Msun.

Example usage:

from synthesizer.load_data.load_scsam import load_SCSAM

galaxies, halo_inds, birthhalo_ids = load_SCSAM(
    "sfhist.dat", "particle", grid
)

Functions

synthesizer.load_data.load_scsam.load_SCSAM(fname, method, grid, verbose=False, dtype=<class 'numpy.float64'>)[source]

Read an SC-SAM star formation history file.

Each (age bin, Z bin) cell is a top-hat of star formation between the bin edges (midpoints between the tabulated centres). Adapted from code by Aaron Yung.

Parameters:
  • fname (str) – The SC-SAM sfhist file to read.

  • method (str) – ‘particle’ returns particle galaxies with one particle per non-zero cell, split at every grid age the cell’s age bin contains so young star formation is resolved. ‘parametric’ integrates each cell over the grid age cells (the parametric.Stars convention) and returns parametric galaxies. ‘parametric_NNI’ and ‘parametric_RGI’ are deprecated aliases for ‘parametric’.

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

  • 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:

galaxies (list): particle.Galaxy or parametric.Galaxy

objects in file order, each carrying its redshift.

halo_ind_list (list): halo indices. birthhalo_id_list (list): birth halo IDs.

Return type:

tuple

Raises:

InconsistentArguments – If method is unknown or the header or payload is inconsistent.

Examples using synthesizer.load_data.load_scsam.load_SCSAM

SC-SAM example

SC-SAM example