def star_formation_rate(z, z_inhom=0.):
    """Returns the star formation rate, per comoving volume, evaluated at the specified redshift.

    Ref:
        A.M. Hopkins and J.F. Beacom, Astrophys. J. 651, 142 (2006) [astro-ph/060146]
        P. Baerwald, S. Huemmer, and W. Winter, Astropart. Phys. 35, 508 (2012) [1107.5583]

    Args:
      z (float): redshift
      z_inhom (float): redshift where the universe becomes inhomogenous, return 0. below this values

    Returns:
      float: star formation rate normalized to 1. at y = 0.
    """

    if z < z_inhom:
        return 0.
    elif z <= 0.97:
        return (1. + z)**3.44
    elif 0.97 < z <= 4.48:
        return 10.**1.09 * (1. + z)**-0.26
    else:
        return 10.**6.66 * (1. + z)**-7.8