def BB_law(x, param, redshift): """ Calculated the blackbody radiation from head dust. Inout is the observed frequency, normalizing factor and the temperature. It shifts to restframe frequency and calculate the blackbody spectrum. The output is the specific intensity which is constant over distances. :param x: Frequency in Hz :param param: List of the normalization factor and temperature, param=[norm,temp] :param redshift: The redshift z of the object :return: the observed flux_nu of the blackbody model """ norm, temp = param redshift_shifted_freq = (1 + redshift) * x * u.Hz stradian = 4 * np.pi bbfunction = ampm.BlackBody(temp * u.K) # The astropy.blackbody_nu gives the specific intensity of the blackbody ragiation in # units erg s^-1 cm^-2 Hz^-1 sr^-1, the specific intenisty is # constant over distance due to the r^2 dependence of the solid angle and flux cancel out each other. # but to have a comparable quanitiy to the oberved flux we need to multiply by # the solid angle, which for a sphere is 4pi # return stradian*(10**norm)*analytic_functions.blackbody.blackbody_nu(redshift_shifted_freq, temp).value y_z = stradian * (10**norm) * bbfunction(redshift_shifted_freq).value y_z *= (1. + redshift) return y_z
def MBB_law_z(nu_obs, param): """ Calculate the flux for a modified black body. Formula taken from Gilli et al. 2014 param nu: array of frequency param param: array of the parameter values param redshift: redshift of the source return: calculated flux for the frequencies provided in the array with the given parameter parameter array description: p[0]: norm => normalisation fator in log p[1]: temp => temerature of the BB in Kelvin p[2]: beta => index of the slope p[3]: nu_0 => pivotal frequency for the two different regime of emission in log p[4]: redshift => redshift """ norm, temp, beta, redshift = param bbfunction = ampm.BlackBody(temp * u.K) # beta = 2.0 nu_0 = np.log10(1.5e12) nu_rest = nu_obs * ( 1 + redshift) * u.Hz # shift the frequency range to restframe y_z = (10**norm) * bbfunction(nu_rest).value * ( 1. - np.exp(-1.0 * (nu_rest.value / 10**nu_0)**beta)) y_z *= (1. + redshift) # shift the flux to observed frame return y_z
def from_tree_transform(cls, node, ctx): return physical_models.BlackBody(scale=node['scale'], temperature=node['temperature'])