This is a README file for the data presented in our ApJ paper, "Mapping the Growth of Supermassive Black Holes as a Function of Galaxy Stellar Mass and Redshift" by F. Zou et al. (2024). The data are released on Zenodo, where the link is given in Section 5 of Zou et al. (2024).
Any queries or feedback should be sent to Fan Zou (fanzou01@gmail.com). Users should download the latest version of these data before using the data for their science projects so that they will benefit from any updates (see the "release history" below).

There are three folders in the data release:
main/ -- the whole galaxy population.
quiescent/ -- the quiescent galaxy population.
starforming/ -- the star-forming galaxy population.
For the latter two, see Section 4.3 of Zou et al. (2024) for more details.

Each folder contains the following files:
maps_{param}.fits: the parameter maps across the stellar mass-redshift plane. {param} includes the four double power-law parameters, "logA", "loglambdac", "gamma1", and "gamma2" (see Equation 2 of Zou et al., 2024) and "logbhar" (i.e., the long-term population mean BHAR). Each file contains five HDUs, and the first, second, third, fourth, and fifth HDUs represent the median, 16th, 84th, 5th, and 95th percentile maps of the posterior, respectively. The map grid is linearly spaced as 49 bins along 9.5 < logM* < 12 and 50 bins along log(1.05) < log(1+z) < log5. Examples of codes for handling the maps are provided below. These maps are also presented in Figures 2 and 6 of Zou et al. (2024).
plambda.fits: the accretion distribution, p(lambda | M*, z), evaluated at 5*7 (M*, z) values, i.e., all the bin centers in Figure 3 of Zou et al. (2024). Each HDU records the results of one (M*, z) set, and the HDU name is "logmstar_{logmstar}_z_{z}". Each HDU contains six columns -- "loglambda" is the log(lambda) grid, and the "median", "q16", "q84", "q5", "q95" columns are the median, 16th, 84th, 5th, and 95th percentiles of the log[p(lambda | M*, z)] posterior.

********** example codes **********
Here, we provide simple example codes to illustrate how to load the maps and construct some interpolation functions. We use the median logBHAR map under the main/ directory as an example, and all the other maps work the same. Both Julia and Python codes are shown below.

=====================
>>> Julia version <<<
=====================
using AstroImages
using Interpolations

# set the grid
const z_bottom = 0.05
const z_top = 4.
const logmstar_bottom = 9.5
const logmstar_top = 12.
const gridsize_mstar = 50 # the logM bin size is 49
const gridsize_z = 51 # the z bin size is 50
logmgrid_bound = range(logmstar_bottom, logmstar_top, gridsize_mstar)
logmgrid = (logmgrid_bound[1:(end - 1)] .+ logmgrid_bound[2:end]) ./ 2.
log1pzgrid_bound = range(log10(1. + z_bottom), log10(1. + z_top), gridsize_z)
log1pzgrid = (log1pzgrid_bound[1:(end - 1)] .+ log1pzgrid_bound[2:end]) ./ 2.

# load the median logBHAR map
medmap_logbhar = load("output/main/maps_logbhar.fits", 1)
# interpolation function to calculate logBHAR
# note the input parameters are (logM*, log(1+z))
interpfunc = linear_interpolation((logmgrid, log1pzgrid), medmap_logbhar, extrapolation_bc = Line())

# example usage of the interpolation function
logmstar = 9.5:0.01:12.
z = 1.5
interpfunc(logmstar, log10(1. + z))


======================
>>> Python version <<<
======================
from astropy.io import fits
from scipy import interpolate
import numpy as np

# set the grid
z_bottom = 0.05
z_top = 4.
logmstar_bottom = 9.5
logmstar_top = 12.
gridsize_mstar = 50 # the M bin size is 49
gridsize_z = 51 # the z bin size is 50
logmgrid_bound = np.linspace(logmstar_bottom, logmstar_top, gridsize_mstar)
logmgrid = (logmgrid_bound[:-1] + logmgrid_bound[1:]) / 2.
log1pzgrid_bound = np.linspace(np.log10(1. + z_bottom), np.log10(1. + z_top), gridsize_z)
log1pzgrid = (log1pzgrid_bound[:-1] + log1pzgrid_bound[1:]) / 2.

# load the median logBHAR map
medmap_logbhar = fits.open("output/main/maps_logbhar.fits")[0].data
# interpolation function to calculate logBHAR
# note the input parameters are (logM*, log(1+z))
interpfunc = interpolate.RegularGridInterpolator((logmgrid, log1pzgrid), medmap_logbhar.T, bounds_error = False, fill_value = None)

# example usage of the interpolation function
logmstar = np.linspace(9.5, 12., 100)
z = 1.5
interpfunc((logmstar, np.log10(1. + z)))


********** release history **********
This is version 1, released on 02/29/2024.
